sequilze REACTJS code example

Example 1: sequilze REACTJS

$ npm install --save sequelize

Example 2: sequilze REACTJS

psql ideaSELECT * FROM "Ideas";SELECT * FROM "Contents";

Example 3: sequilze REACTJS

'use strict';module.exports = {  up: (queryInterface, Sequelize) => {    return queryInterface.bulkInsert('Contents', [{      idea_id : 1,      post : 'Great lyrics',      audio : 'sounds',      createdAt : new Date(),      updatedAt : new Date()    }], {});  },down: (queryInterface, Sequelize) => {    queryInterface.bulkDelete('Contents', [{      post :'Great lyrics'    }])  }};

Example 4: sequilze REACTJS

'use strict';module.exports = {  up: (queryInterface, Sequelize) => {    return queryInterface.bulkInsert('Ideas', [{      subject : 'First song',      category : 'Music',      createdAt : new Date(),      updatedAt : new Date()    }], {});  },down: (queryInterface, Sequelize) => {    queryInterface.bulkDelete('Ideas', [{      subject :'First song'    }])  }};

Example 5: sequilze REACTJS

sequelize seed:create --name my-seed-file

Example 6: sequilze REACTJS

sequelize db:seed:all

Tags:

Misc Example