question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dropTable not schema-aware?

See original GitHub issue

So, you can createTable in a schema, it creates the table in the assigned schema, but seems like we are not able to dropTable on the down migration when reversing changes?

When using this migration:

return queryInterface.dropTable('ivr', {
      schema: 'raw_filemaker'
    });

gives DROP TABLE IF EXISTS "ivr";

This is in v3.6.0 w/postgresql.

Upon superficial scan, seems like return Utils._.template(query)(values).trim() + ';'; in createTableQuery properly prepends the schema, whereas return Utils._.template(query)({...}); at the end of dropTableQuery does not. Oddly, they both call this.quoteTable(tableName)?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

23reactions
alexmoncommented, Oct 21, 2015

@paulxtiseo @mickhansen is right, try :

return queryInterface.dropTable( { tableName: ‘ivr’, schema: ‘raw_filemaker’
} );

it worked for me

2reactions
v1d3rm3commented, Dec 6, 2018

I think it will be better if the options of dropTable are consistent with createTable, so you could define schemas in dropTablelike in createTable. I think it’s a security issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dropping a database column in production without waiting ...
In the case of a column drop, we have at our disposal a “cheap” schema-aware strategy: ignored_columns (see the Rails PR). This directive...
Read more >
Cannot drop table users because other objects depend on it
If you drop a database-user with 'cascade' option it will drop all dependend objects. For example all tables which the user owns (and...
Read more >
DROP TABLE | CockroachDB Docs
The DROP TABLE statement performs a schema change. For more information about how online schema changes work in CockroachDB, see Online Schema Changes....
Read more >
Complete Guide to SQL DROP Table Statement - eduCBA
Guide to SQL DROP Table. Here we discuss the introduction, how to create SQL drop table statement? examples and FAQ respectively.
Read more >
SQL Server DROP TABLE IF EXISTS Examples
Then run an ALTER TABLE [schema].[table] DROP CONSTRIANT to drop the constraints. Without the constraints we can drop the tables in any order...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found