You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
support create / drop database with query interface #8821
As a workaround, I could change the queryInterface.createSchema with queryInterface.sequelize.query and put my CREATE DATABASE query, which gives me exactly what I need. Just reporting a broken functionality (i guess it's broken)
If you need more info about it, just let me know :)
EDIT: Just to avoid confusion
CREATE DATABASE creates a database with the given name. To use this statement, you need the CREATE privilege for the database. CREATE SCHEMA is a synonym for CREATE DATABASE.
Found this issue #1379 which reported the same problem.
Despite being a massive breaking change, I didn't fully got why not to support multiple schemas through prefixes.
In my case the prefixes would not only solve this createSchema problem, but also all my multi-tenant queries, which I would be able to just prefix the table with any schema in my database.
I'm open to provide more details/use cases if you need or want to.
Also, I can try contributing with some PRs to help with these changes.
Schema and batabase are different concept, they may be interchangeable in MySQL but are very different for other databases.
What you are looking for is createDatabase / dropDatabase statement which I am afraid we dont support yet. But I will be happy to accept an PR which add create/drop database support to query interface
Activity
matheusvellone commentedon Dec 29, 2017
Found this issue #1379 which reported the same problem.
Despite being a massive breaking change, I didn't fully got why not to support multiple schemas through prefixes.
In my case the prefixes would not only solve this
createSchemaproblem, but also all my multi-tenant queries, which I would be able to just prefix the table with any schema in my database.I'm open to provide more details/use cases if you need or want to.
Also, I can try contributing with some PRs to help with these changes.
sushantdhiman commentedon Jan 11, 2018
Schema and batabase are different concept, they may be interchangeable in MySQL but are very different for other databases.
What you are looking for is
createDatabase / dropDatabasestatement which I am afraid we dont support yet. But I will be happy to accept an PR which addcreate/drop databasesupport to query interface[-]createSchema with MySQL not working[/-][+]support create / drop database with query interface[/+]