Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function executeDump()
{
if ( argv[ 'cross-compatible' ] || config.getCurrent().settings.compatible )
{
console.log( 'Cross Compatible is currently not yet implemented! Switching back to Specific mode.' );
console.log( 'Note that in compatible mode partitions, fulltext indexes and other DataBase Specific Features you made will be lost. This may be possible in any future release.' );
}
else
{
console.log( 'Running in DataBase Specific mode.' );
}
createMigrationDir( argv[ 'migrations-dir' ], function ( err )
{
if ( err )
{
log.error( 'Failed to create migration directory at ', argv[ 'migrations-dir' ], err );
process.exit( 1 );
}
function buildMigration( err, builder )
{
if ( err === undefined )
process.exit( 1 );
builder.build( config.getCurrent().settings, function ( cb )
{
if ( config.getCurrent().settings.db_persist )
cb();
else
{
var originalDatabase = config.getCurrent().settings.database;
config.getCurrent().settings.database += '_diff';
executeDown( function ( err, complete, callback )
{
if ( err )
process.exit( 1 );
callback( function ( err )
{
if ( err )
function loadConfig()
{
if ( process.env.DATABASE_URL )
{
config.loadUrl( process.env.DATABASE_URL, argv.env );
}
else
{
config.load( argv.config, argv.env );
}
if ( verbose )
{
var current = config.getCurrent();
var s = JSON.parse( JSON.stringify( current.settings ) );
if ( s.password )
s.password = '******';
log.info( 'Using', current.env, 'settings:', s );
}
}