Skip to content
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

mssql db:create is broken in v5.2.0 #710

Closed
naoak opened this issue Nov 2, 2018 · 1 comment
Closed

mssql db:create is broken in v5.2.0 #710

naoak opened this issue Nov 2, 2018 · 1 comment

Comments

@naoak
Copy link

naoak commented Nov 2, 2018

What you are doing?

Simply, I'd like to create a database with dialect mssql.
v5.1.0 was OK, but v5.2.0 is broken.

// main.js
const {promisify} = require('util');
const childProcess = require('child_process');
const execAsync = promisify(childProcess.exec);
const cliPath = './node_modules/.bin/sequelize';

async function main() {
  try {
    await execAsync(`${cliPath} db:create`, {cwd: __dirname});
    await execAsync(`${cliPath} db:drop`, {cwd: __dirname});
  }
  catch (e) {
    console.error(e);
  }
}

main();
// config/config.js
module.exports = {
  development: {
    database: 'test_aw-sql-models',
    username: 'SA',
    password: '********',
    host: 'localhost',
    dialect: 'mssql',
    dialectOptions: { encrypt: true },
    operatorsAliases: false,
    pool: { max: 5, min: 0, acquire: 30000, idle: 10000 },
    logging: false,
    typeValidation: true
  }
};

What do you expect to happen?

Expect test_aw-sql-models database to be created without error.

What is actually happening?

Command failed.

{ Error: Command failed: ./node_modules/.bin/sequelize db:create
ERROR: Unclosed quotation mark after the character string 'END;'.

    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:554:12)
  killed: false,
  code: 1,
  signal: null,
  cmd: './node_modules/.bin/sequelize db:create',
  stdout: '\n\u001b[4mSequelize CLI [Node: 8.9.0, CLI: 5.2.0, ORM: 4.41.0]\u001b[24m\n\nLoaded configuration file "config/config.js".\nUsing environment "development".\n\n\n',
  stderr: '\u001b[31mERROR:\u001b[39m Unclosed quotation mark after the character string \'END;\'.\n' }

Dialect: mssql
Database version: docker image: microsoft/mssql-server-linux:2017-latest
Sequelize CLI version: v5.2.0
Sequelize version: v4.41.0

Thanks.

@Undre4m
Copy link
Contributor

Undre4m commented Nov 3, 2018

Getting same error:

Sequelize CLI [Node: 8.9.4, CLI: 5.2.0, ORM: 4.38.0]

Loaded configuration file ".sequelizerc.fu".
Executing (default): ')BEGINCREATE DATABASE N'lapara'END;

ERROR: Unclosed quotation mark after the character string 'END;'.

Dialect: mssql
Sequelize CLI version: 5.2.0
Sequelize version: 4.38.0
Node version: 8.9.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants