cli
cli copied to clipboard
db: migrate creates table with plural name, while freezeTableName:true option specified
What are you doing? I call db:migrate and it creates table with plural name, though I've specified freezeTableName: true option.
development: { dialect: "sqlite", storage:[hidden on purpose], operatorsAliases: Sequelize.Op, define: { freezeTableName: true }, query: { raw: true } // Always get raw result }, What do you expect to happen? I expect the name of created table to be singular while running db:migrate
What is actually happening? It creates a valid table , but with plural name. Instead of User it creates Users
Dialect: sqlite Dialect version: 3.1.13 Database version: 3.1.13 Sequelize version: 4.28.0 Tested with latest release: No
modifying the migration script as suggested by hbgdPro (https://github.com/sequelize/sequelize/issues/8785) also isn't helpful, because the sequelize queries are still expecting pluralized tables, which means I will get SequelizeDatabaseError, because it will look for e.g. table buildings instead building in database.
Same issue.
I have set "define" : { "freezeTableName" : true, "timestamps" : false, "underscored": true }
in config.json.
When I call db:migrate it create tables with plural names , timestanps , camelCase column ...
Dialect: mssql Dialect version driver: "SQL Server Native Client 11.0", Sequelize version: 4.33.0 Tested with latest release: yes
I got the same result. How to patch this ?
Configuration should be read in https://github.com/sequelize/cli/blob/master/src/helpers/migration-helper.js#L8 and in https://github.com/sequelize/cli/blob/master/src/assets/migrations/create-table.js
Still no answer on this issue? I have the same issue with Sequelize CLI [Node: 8.9.4, CLI: 5.4.0, ORM: 4.42.0]
Any update/plan to fix this issue?
Not fixed yet, in the other hand I rambled about if this is an issue or not here https://github.com/sequelize/sequelize/issues/7566#issuecomment-590027672
In models/index.js, add the line
config.freezeTableName = true;
Does anyone fix this?
In models/index.js, add the line
config.freezeTableName = true;
models/index.js
is not used when you use sequelize model:generate
try this by deleting the index file and try to add a new model with the CLI tool
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
any updates?