How to use the db-migrate/lib/config.js.getCurrent function in db-migrate

To help you get started, we’ve selected a few db-migrate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wzrdtales / node-ultimate-migrate / index.js View on Github external
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 );
        }
github wzrdtales / node-ultimate-migrate / index.js View on Github external
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 )
github wzrdtales / node-ultimate-migrate / index.js View on Github external
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 );
    }
}