How to use migrate - 10 common examples

To help you get started, we’ve selected a few 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 mcongrove / ChariTi / app / lib / core.js View on Github external
// Global system Events
		Ti.Network.addEventListener("change", APP.networkObserver);
		Ti.Gesture.addEventListener("orientationchange", APP.orientationObserver);
		Ti.App.addEventListener("pause", APP.exitObserver);
		Ti.App.addEventListener("close", APP.exitObserver);
		Ti.App.addEventListener("resumed", APP.resumeObserver);

		if(OS_ANDROID) {
			APP.MainWindow.addEventListener("androidback", APP.backButtonObserver);
		}

		// Determine device characteristics
		APP.determineDevice();

		// Migrate to newer ChariTi version
		require("migrate").init();

		// Create a database
		APP.setupDatabase();

		// Reads in the JSON config file
		APP.loadContent();

		// Builds out the tab group
		APP.build();

		// Open the main window
		APP.MainWindow.open();

		// The initial screen to show
		APP.handleNavigation(0);
github CBMVC / ChariTi-CB / app / lib / core.js View on Github external
// Global system Events
		Ti.Network.addEventListener("change", APP.networkObserver);
		Ti.Gesture.addEventListener("orientationchange", APP.orientationObserver);
		Ti.App.addEventListener("pause", APP.exitObserver);
		Ti.App.addEventListener("close", APP.exitObserver);
		Ti.App.addEventListener("resumed", APP.resumeObserver);

		if(OS_ANDROID) {
			APP.MainWindow.addEventListener("androidback", APP.backButtonObserver);
		}

		// Determine device characteristics
		APP.determineDevice();

		// Migrate to newer version
		require("migrate").init();

		// Create a database
		APP.setupDatabase();

		// Reads in the JSON config file
		APP.loadContent();

		// Builds out the tab group
		APP.build();

		// Open the main window
		APP.MainWindow.open();

		// The initial screen to show
		APP.handleNavigation(APP.StartupScreen);
github CBMVC / CBMVC-Library-For-Titanium-Alloy / app / lib / core.js View on Github external
init: function(content) {

		// Global system Events
		Ti.Network.addEventListener("change", CB.networkObserver);
		Ti.Gesture.addEventListener("orientationchange", CB.orientationObserver);
		Ti.App.addEventListener("pause", CB.exitObserver);
		Ti.App.addEventListener("close", CB.exitObserver);
		Ti.App.addEventListener("resumed", CB.resumeObserver);

		// Determine device characteristics
		CB.determineDevice();

		// Migrate to newer version
		require("migrate").init();

		// Setup database
		CB.setupDatabase();

		// Init cache object
		CB.Cache.init();

		// Init utility object
		CB.Util.init(content.index);

		// The main content
		CB.MainContent = content.main;

		// The main content copy
		CB._mainContent = content.main;
github gimdongwoo / NIPA-Titanium-BoilerPlate-BaaS / app / lib / core.js View on Github external
APP.checkPermissions(function() {
      // Create a database
      APP.setupDatabase();

      // Reads in the JSON config file
      APP.loadContent();

      // Migrate to newer DB version
      require("migrate").init();

      // Initializes settings Model & user Model login try
      APP.initUser();

      // NOTICE:
      // The following sections are abstracted for PEEK

      _.defer(function() {
        // Updates the app from a remote source
        APP.update();

        _.defer(function() {
          // Set up push notifications
          APP.initPush();
        });
      });
github ExpressGateway / express-gateway / migrations / 1510050700766-index-applications.js View on Github external
                return db.sadd(appNameSetKey, app.id).catch((err) => log.error('Key existing', err)); // Try to add the missing index
              });
github ExpressGateway / express-gateway / migrations / 1509389756098-credential-username-userid-transform.js View on Github external
                    .catch(err => log.error('Credential existing already', err)) // Create a new one with the ID instead of the username
                  )
github deluan / contentful-migrate / lib / bootstrap / createFile.js View on Github external
mkdirp(directory, (makeDirectoryError) => {
      if (makeDirectoryError) {
        reject(logError(`🚨  Failed to create ${directory}`, makeDirectoryError))
      }

      // Fix up file path
      const date = dateformat(new Date(), 'UTC:yyyymmddHHMMss')
      const fileName = `${date}-create-${camelToDash(contentTypeId)}.js`
      const filePath = path.join(process.cwd(), directory, fileName)

      // Write the template file
      return fs.writeFile(filePath, fileContent, (writeFileError) => {
        if (writeFileError) {
          reject(logError(`🚨  Failed to create ${directory}/${fileName}`, writeFileError))
        }
        log('Created', `${directory}/${fileName}`)
        resolve({ contentTypeId, fileName })
      })
    })
github deluan / contentful-migrate / bin / commands / up.js View on Github external
.catch((err) => {
      log.error('error', err)
      console.log(chalk.bold.red(`\n🚨  Error applying migrations to "${environmentId}" environment! See above for error messages`))
      process.exit(1)
    })
}
github dmanjunath / node-redshift / lib / migration.js View on Github external
function performMigration(direction, migrationName) {
  var state = join(folderName, '.migrate');
  var set = migrate.load(state, folderName);

  set.on('migration', function (migration, direction) {
    console.log(direction, migration.title);
  });

  var migrationPath = migrationName ?
    join(folderName, migrationName) :
    migrationName;

  set[direction](migrationName, function (err) {
    if (err) {
      console.log('error', err);
      process.exit(1);
    }

    console.log('migration', 'complete');
github deluan / contentful-migrate / bin / commands / down.js View on Github external
.catch((err) => {
      log.error('error', err)
      process.exit(1)
    }))
}

migrate

Abstract migration framework for node

MIT
Latest version published 3 months ago

Package Health Score

79 / 100
Full package analysis