GithubHelp home page GithubHelp logo

Comments (8)

sdepold avatar sdepold commented on May 12, 2024

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.

rayshan avatar rayshan commented on May 12, 2024

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.

tylerFowler avatar tylerFowler commented on May 12, 2024

+1 I'm actually still seeing this in the 1.7.0 CLI.

from cli.

paulxtiseo avatar paulxtiseo commented on May 12, 2024

+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.

sdepold avatar sdepold commented on May 12, 2024

alright. let's fix this

from cli.

sdepold avatar sdepold commented on May 12, 2024

boom landed in master. I will wait for another PR till I release a new patch version

from cli.

sdepold avatar sdepold commented on May 12, 2024

and it's live as 1.9.1

from cli.

rayshan avatar rayshan commented on May 12, 2024

Thanks!

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.