async function sync() {
		const coreModelNames = coreModels.map(file => path.basename(file, '.js')) // ['User', 'Location', 'UserLocation']
		const filteredModels = []
		Object.keys(models).forEach(key => {
			const model = models[key]
			if (!model.options.doNotSync) {
				debug('Allowing this model to sync()', model.name)
				filteredModels.push(model)
			}
		})

		await sequelize.sync()

		// Run migrations if enabled
		if (runMigrations && fs.existsSync(migrationsDir)) {
			debug('Running sequelize migrations')
			const umzug = new Umzug({
				storage: 'sequelize',
				storageOptions: {
					sequelize: sequelize
				},
				migrations: {
					params: [sequelize.getQueryInterface(), sequelize.constructor],
					path: migrationsDir,
					pattern: /\.js$/
				}
			})

			// Run Migrations
			await umzug.up()

			debug('Finished sequelize migrations')
		} else {
			console.warn(
				'Could not find any migrations sequelize migrationsDir %s',
				migrationsDir
			)
		}
	}
// So don't run migrations on any model relies on core db
So don't run migrations on any model relies on core db
So don ' t run migrations on any model relies on core db
async function sync() {
		const coreModelNames = coreModels.map(file => path.basename(file, '.js')) 
		const filteredModels = []
		Object.keys(models).forEach(key => {
			const model = models[key]
			if (!model.options.doNotSync) {
				debug('Allowing this model to sync()', model.name)
				filteredModels.push(model)
			}
		})
		await sequelize.sync()
		if (runMigrations && fs.existsSync(migrationsDir)) {
			debug('Running sequelize migrations')
			const umzug = new Umzug({
				storage: 'sequelize',
				storageOptions: {
					sequelize: sequelize
				},
				migrations: {
					params: [sequelize.getQueryInterface(), sequelize.constructor],
					path: migrationsDir,
					pattern: /\.js$/
				}
			})
			await umzug.up()
			debug('Finished sequelize migrations')
		} else {
			console.warn(
				'Could not find any migrations sequelize migrationsDir %s',
				migrationsDir
			)
		}
	}
async function sync ( ) { const coreModelNames = coreModels . map ( file => path . basename ( file , '.js' ) ) const filteredModels = [ ] Object . keys ( models ) . forEach ( key => { const model = models [ key ] if ( ! model . options . doNotSync ) { debug ( 'Allowing this model to sync()' , model . name ) filteredModels . push ( model ) } } ) await sequelize . sync ( ) if ( runMigrations && fs . existsSync ( migrationsDir ) ) { debug ( 'Running sequelize migrations' ) const umzug = new Umzug ( { storage : 'sequelize' , storageOptions : { sequelize : sequelize } , migrations : { params : [ sequelize . getQueryInterface ( ) , sequelize . constructor ] , path : migrationsDir , pattern : / \.js$ / } } ) await umzug . up ( ) debug ( 'Finished sequelize migrations' ) } else { console . warn ( 'Could not find any migrations sequelize migrationsDir %s' , migrationsDir ) } }
So don't run migrations on any model relies on core db
So don ' t run migrations on any model relies on core db
// ['User', 'Location', 'UserLocation'] // Run migrations if enabled // Run Migrations