diff --git a/database/postgres/postgres.go b/database/postgres/postgres.go index 9f0a234..17c520e 100644 --- a/database/postgres/postgres.go +++ b/database/postgres/postgres.go @@ -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)}