Skip to content

Instantly share code, notes, and snippets.

@csorlandi
Created June 14, 2018 12:57
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 csorlandi/21d53c59d9a20c7c03a77ffc5b0838d9 to your computer and use it in GitHub Desktop.
Save csorlandi/21d53c59d9a20c7c03a77ffc5b0838d9 to your computer and use it in GitHub Desktop.
module.exports = {
up: (queryInterface, DataTypes) => {
queryInterface.createTable('Users', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: DataTypes.INTEGER,
},
name: {
allowNull: false,
type: DataTypes.STRING,
},
email: {
allowNull: false,
type: DataTypes.STRING,
unique: true,
},
password: {
allowNull: false,
type: DataTypes.STRING,
},
createdAt: {
allowNull: false,
type: DataTypes.DATE,
},
updatedAt: {
allowNull: false,
type: DataTypes.DATE,
},
});
},
down: (queryInterface) => {
queryInterface.dropTable('Users');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment