How do you print raw requests during migration redirects?

I need to print raw requests that are executed during the migration. Any idea on how to do this?

I use the -migrate option to run scripts.

+7
database-migration
source share
1 answer

You can also define a custom function for the logging part. Just pass the function. The first parameter will be the string that is being registered.

You can use the log , a very simple way :), add loggin: true ( DEPRECATED ) to the migration configuration

Oh, sorry. I find the source , they give no chance.

But you can fix this self :) by changing the value of "true" for a while.

Or software use :

var sequelize = require('sequelize'); var sequelize = new Sequelize('database', 'username', 'password', { logging: console.log }) var migrator = sequelize.getMigrator({ path: process.cwd() + '/database/migrations', filesFilter: /\.coffee$/, logging: console.log }) migrator .migrate({ method: 'down' }) .success(function() { // The migrations have been executed! }) 
0
source share

All Articles