Merge pull request #110 from MikeFitzgerald/master

Fix postgres drop
This commit is contained in:
Dale Hui 2018-10-04 00:30:33 -07:00 committed by GitHub
commit 1e60261d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ func (p *Postgres) Version() (version int, dirty bool, err error) {
func (p *Postgres) Drop() error {
// select all tables in current schema
query := `SELECT table_name FROM information_schema.tables WHERE table_schema=(SELECT current_schema())`
query := `SELECT table_name FROM information_schema.tables WHERE table_schema=(SELECT current_schema()) AND table_type='BASE TABLE'`
tables, err := p.conn.QueryContext(context.Background(), query)
if err != nil {
return &database.Error{OrigErr: err, Query: []byte(query)}