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
createSchema reports success but mysql data base does show new schema #1379
The module db_connect_mysql connects to the mysql database server
using the database name "mysql", userid: root, and with root's password.
I have tested this script. It has error checking to detect and report
errors. I have run this script that proved it is working correctly.
MySql workbench shows the connection.
Received:
node C:$work\node\staff_db\create_schema.js
Executing (default): SHOW TABLES
sequelize create schema succeeded
createschema stored on db-server
Press any key to continue . . .
when I look inside the database (using root) I do not see
the "my_data" schema, as being defined.
For some reason it appears that the createSchema resulted in a SQL command
of SHOW TABLES. Why I do not know.
My environment:
Up-to-date Windows 7 OS 64, Intel corei3
Oracle MySql - V5.6
Java Script modules:
node - V0.2.10
mysql - v2.0.1
sequelize - v1.7.0-rc5
So I don't think you could do select * from schema.table, you would have to
specify use schema (which is actually a database) first. I also don't think
you'd be able to query across multiple schemas.
I'm wondering if create schema should actually throw an error for mysql, to
avoid confusion..
Schemas in mysql are implemented as prefixes, as we decided back when the feature got implemented, that's fine for me - Makes it possible to query multiple schemas on the same connection like it works on postgres.
I don't think we should change it to use and create multiple databases.
@janmeier reports that querying across multiple databases (or schemas if you will) is actually possible for mysql.
So i suppose in the future an argument could be made for schemas in mysql to be supported using multiple databases - However this would massively break BC, so don't expect it to be introduced soon.
Please let us know if schemas as prefixes do not work for you, and open a feature request for mysql schemas to be implemented as databases. Closing this.
Activity
mickhansen commentedon Feb 11, 2014
MySQL does not support schemas. The way sequelize supports schemas for MySQL is by prefixing table names when models are defined and using a schema.
Please show your models and the appropriate .schema() calls.
janmeier commentedon Feb 11, 2014
In mysql create schema is equivalent to create database
http://dev.mysql.com/doc/refman/5.7/en/schemata-table.html
So I don't think you could do select * from schema.table, you would have to
specify use schema (which is actually a database) first. I also don't think
you'd be able to query across multiple schemas.
I'm wondering if create schema should actually throw an error for mysql, to
avoid confusion..
mickhansen commentedon Feb 12, 2014
Schemas in mysql are implemented as prefixes, as we decided back when the feature got implemented, that's fine for me - Makes it possible to query multiple schemas on the same connection like it works on postgres.
I don't think we should change it to use and create multiple databases.
mickhansen commentedon Feb 12, 2014
@janmeier reports that querying across multiple databases (or schemas if you will) is actually possible for mysql.
So i suppose in the future an argument could be made for schemas in mysql to be supported using multiple databases - However this would massively break BC, so don't expect it to be introduced soon.
Please let us know if schemas as prefixes do not work for you, and open a feature request for mysql schemas to be implemented as databases. Closing this.