Skip to content

Instantly share code, notes, and snippets.

@unicodeveloper
Created August 18, 2017 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unicodeveloper/2ef8f5e87378fd6062424068e9c363ca to your computer and use it in GitHub Desktop.
Save unicodeveloper/2ef8f5e87378fd6062424068e9c363ca to your computer and use it in GitHub Desktop.
// Define our users table migration
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable(‘users’, {
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
},
email: {
type: Sequelize.STRING,
},
password: {
type: Sequelize.STRING,
},
firstname: {
type: Sequelize.STRING,
},
lastname: {
type: Sequelize.STRING,
},
bio: {
type: Sequelize.TEXT,
},
createdAt: {
type: Sequelize.DATE,
},
updatedAt: {
type: Sequelize.DATE,
},
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable(‘users’);
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment