Question on sequelize-cli running db:migrate to create/alter tables on MySQL. Running migration as per the document.
I was seeing the sql (raw query) as part of the console output from sequelize-cli as shown below:
npx sequelize-cli db:migrate --config "dbconfig.json" --env "localdb"
npx: installed 106 in 17.63s
Sequelize CLI [Node: 10.13.0, CLI: 5.4.0, ORM: 4.37.10]
:
:
== 20190417134836-mstprices: migrating =======
Executing (default): CREATE TABLE IF NOT EXISTS `mstprices` (`id` INTEGER NOT NULL auto_increment , `units` VARCHAR(16), `price` DECIMAL(10,3), `siteid` INTEGER, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB;
Executing (default): CREATE TABLE IF NOT EXISTS `SequelizeMeta` (`name` VARCHAR(255) NOT NULL UNIQUE , PRIMARY KEY (`name`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_unicode_ci;
Executing (default): SHOW INDEX FROM `SequelizeMeta`
Executing (default): INSERT INTO `SequelizeMeta` (`name`) VALUES ('20190417134836-mstprices.js');
== 20190417134836-mstprices: migrated (0.182s)
I could grab these SQLs (CREATE TABLE ..) to run on production later
Now that I'm using a latest version and trying the same db:migrate to create some other table, for which I do not see the raw query displayed.
npx sequelize-cli db:migrate --config "dbconfig.json" --env "localdb"
Sequelize CLI [Node: 10.16.0, CLI: 5.5.1, ORM: 4.44.3]
Loaded configuration file "dbconfig.json".
Using environment "localdb".
sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators node_modules\sequelize\lib\sequelize.js:245:13
== 20191210064127-create-tbl-service-time-log: migrating =======
== 20191210064127-create-tbl-service-time-log: migrated (0.185s)
Is that some setting or sequelize-cli stopped printing the raw query on the console?
How do I get the SQLs that sequelize-cli executes on the db?