Comments (8)
If I understand you correctly, you have the following or a similar config/config.json
file:
{
"development": {
"dialect": "sqlite",
"storage": "./db.development.sqlite",
"env": "development"
},
"test": {
"dialect": "sqlite",
"storage": "./db.test.sqlite",
"logging": false
},
"production": {
"username": "root",
"password": null,
"database": "database_production",
"host": "127.0.0.1",
"dialect": "mysql"
}
}
And you run a command like this:
sequelize --env=development db:migrate
And you receive an error then? My output looks like this:
Sequelize [Node: 0.10.32, CLI: 0.3.1, ORM: 2.0.0-dev13, sqlite3: ^2.2.7]
Loaded configuration file 'config/config.json'.
Using environment 'development'.
[21:41:08] Using sequelizefile ~/Projects/sequelize/cli/lib/sequelizefile.js
[21:41:08] Starting 'db:migrate'...
[21:41:08] Finished 'db:migrate' after 50 ms
Running migrations...
20141003210006-create-omnom.js
Completed in 12ms
Can you ensure that the issue still exists?
from cli.
Sorry it was indeed unclear. I actually meant to say .sequelizerc
. My config.json
looks like yours. My .sequelizerc
looks like:
module.exports = {
"env": 'development',
"coffee": true,
"config": "./db/config.json",
"migrationsPath": "./db/migrations",
"modelsPath": ".lib/models"
};
Then if I run sequelize --env=development db:migrate
, args.env
turns into an array, and this error is thrown:
'db:migrate' errored after 17 ms The dialect mysql is not supported. (Error: Please install mysql package manually)
Even though I'm using Postgres. I'm now on the latest 0.3.3
.
from cli.
+1 I'm actually still seeing this in the 1.7.0 CLI.
from cli.
+1, I think. I have the same or similar issue.
When I run sequelize db:migrate --migrations-path 'migrations/postgres' --config 'postgres/config.json'
, resolve()
throws an error in getConfigFile()
.
Starting 'db:migrate'...
at Object.posix.resolve (path.js:439:13)
at Object.module.exports.getConfigFile (/usr/local/lib/node_modules/sequelize-cli/lib/helpers/config-helper.js:13:19)
at Object.module.exports.configFileExists (/usr/local/lib/node_modules/sequelize-cli/lib/helpers/config-helper.js:24:31)
at getMigrator (/usr/local/lib/node_modules/sequelize-cli/lib/tasks/db.js:211:22)
My .sequelizerc
is set as:
var path = require('path')
module.exports = {
'config': path.resolve('migrations', 'config.json'),
}
Looking at args.config
in getConfigFile
when I run the CLI line with --config, it seems to be an array:
[ 'migrations/postgres/config.json',
'/Users/ptiseo/Documents/Repositories/Mailroom/migrations/config.json' ]
If I remove .sequelizerc
, the sequelize db:migrate --migrations-path 'migrations/postgres' --config 'migrations/postgres/config.json'
works.
This is with CLI v1.8.3.
from cli.
alright. let's fix this
from cli.
boom landed in master. I will wait for another PR till I release a new patch version
from cli.
and it's live as 1.9.1
from cli.
Thanks!
from cli.
Related Issues (20)
- use_env_variable returns undefined because not string value HOT 11
- Pending migration alert during app startup HOT 6
- Error on running db: migrate with Node 18.17.9 HOT 1
- Support for Improved Migration Directory Structure and Configuration HOT 2
- Model.associate adding new columns
- Proposal: Controller Generation in Sequelize
- Migrations should happen in a transaction HOT 30
- Tests are stuck HOT 5
- postgres: db:create should not fail if the database does exist
- BulkInsert "relation does not exist" in migration script
- const model = require(path.join(__dirname, file)).default( ^ TypeError: require(...).default is not a function
- const model = require(path.join(__dirname, file)).default( ^ TypeError: require(...).default is not a function HOT 1
- Sequelize CLI Fails to Authenticate with Postgres DB Containing a ':' in Password HOT 3
- CLI is not taking default env like node latest versions have (20.8.0)
- SequelizeMeta structure incompatible with SingleStore/memsql HOT 2
- Problem running migrations with yarn
- When on typescript project, sequelize-cli still generates javascript files. HOT 3
- Running migrations, on Azure database HOT 1
- Seeders state in database with using url option
- Migration undo command didn't work correctly. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.