Open demsey2 opened 4 years ago
Did you initialize your db, with options that is similar to following?
const sequelize = new Sequelize({
database: config.DB_DATABASE!,
username: config.DB_USERNAME!,
password: config.DB_PASSWORD!,
dialect: 'mysql',
models,
benchmark: false,
logging: false
})
To actally create your tables run following
sequeliize.sync()
To foce update which drops all of the tables and recreates them
Becaureful with this one
sequelize.sync({ force: true })
yes this is how I initialize my db.
I don't have any problems with tables creation my issue is around switching db name in the same connection.
I did a research and it looks like it is possible and to achieve that I need to set that db.sequelize.dialect.supports.schemas = true;
i have come across this post where this option is used but on a model level, not on a db level: https://betterprogramming.pub/cross-database-associations-in-sequelize-orm-2be18091a918
can this help ?
is there also another way to achieve cross-db joins, btw ?
Versions
I'm submitting a ... [x] bug report [ ] feature request
Actual behavior: Sequelize doesn't have a Dialect type defined (not String type but Dialect type)
Expected behavior: a specific dialect should be defined