-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
db:makemigrations not working #82
Comments
Make sure you are running the file, not just opening it from the terminal. Try |
Do you have an index.js file in the models directory that imports all of the models? (if you ran |
Seems like a dead repo, but what I did earlier since my imports weren't working was I forked the repo and made it so I can pass my connection in the CLI. Check it out Here How I used it was when I instantiate and export my db connection: config/db.js
Then in my models directory I left index.js completely empty. Lastly, in the command inside your package.json you can use Let me know if this helps! |
I read a tutorial on how to use, installing:
npm install --save github:scimonster/sequelize-auto-migrations#a063aa6535a3f580623581bf866cef2d609531ba
Edit package.json
"scripts": {
...
"db:makemigrations": "./node_modules/sequelize-auto-migrations/bin/makemigration.js",
}
After:
npm run db:makemigrations
But when running, nothing happens, just open the file 'makemigration.js'.
I have a .sequelizerc file:
const { resolve } = require('path');
module.exports = {
config: resolve(__dirname, 'src', 'config', 'database.js'),
'models-path': resolve(__dirname, 'src', 'app', 'models'),
'migrations-path': resolve(__dirname, 'src', 'database', 'migrations'),
'seeders-path': resolve(__dirname, 'src', 'database', 'seeds'),
};
Could that be it? if anyone can help me, i will be very grateful.
The text was updated successfully, but these errors were encountered: