/** * Syncs the DB structure with the models defined above. * * If a { force: true } option is provided, existing tables will be DROPped before the new * schema is loaded. */ function syncModels() { return db.sync({ force: true }); }
start() { const dbcfg = config.database.mysql; this.sequelize = new Sequelize(dbcfg.database, dbcfg.username, dbcfg.password, dbcfg.options); this.load() this.sequelize.sync({force: false}).catch(err => { throw err }) return true }
// database db.sequelize.sync({ force : config.db.wipe }).then(() => { console.log('Database synced' + // eslint-disable-line no-console `${config.db.wipe ? ' - data it\'s wiped & schema recreated' : ''}`); });
before(function (done) { models.sequelize.sync({ force: true }).then(() => { app.listen(constants.SERVER_PORT, () => done()) }) })
sequelize.sync({force: true}) .then(() => { app.listen( config.port, () => console.log(`Example NodeJS, PSQL, and Express API running on port ${config.port}`) ); } );
const initializeDatabase = async (app) => { epilogue.initialize({ app, sequelize: database }) epilogue.resource({ model: Part, endpoints: ['/parts', '/parts/:id'] }) await database.sync() }
task('create/override fake database', async () => { await db.sequelize.sync({force: true}) .then(() => { // Create 10 persons. return q.all(_.times(10, () => { return createPerson(); })); }); })
sequelize.sync().then(function(result) { global.sequelize = sequelize; initWebapp(); }, function(err) { console.log('An error occurred while creating the table:', err); });
//Sync Database models.sequelize.sync().then(function() { console.log('connected to database') }).catch(function(err) { console.log(err) });
// syncs the sequelize models and then connects the Express app db.sequelize.sync().then(function () { http.listen(PORT, function () { console.log(`🌎 ==> Server now on port ${PORT}!`); }); });
database.sync().then(() => { app.listen(port, () => { console.log(`Listening on port ${port}`); }); });
db.sequelize.sync().then( () => { app.listen(PORT, () => { console.log(`Server rodando na porta ${PORT}`); }); });
// // Syncing our database and logging a message to the user upon success db.sequelize.sync().then(function() { app.listen(PORT, function() { console.log("==> 🌎 Listening on port %s. Visit http://localhost:%s/ in your browser.", PORT, PORT); }); });
/* conversation */ // User.belongsToMany(Conversation, { through: 'members' }); // Conversation.belongsToMany(User, { through: 'members' }); function sync(...args) { return sequelize.sync(...args); }