45 lines
1.0 KiB
JavaScript
45 lines
1.0 KiB
JavaScript
|
module.exports = {
|
||
|
up: (queryInterface, Sequelize) => {
|
||
|
return queryInterface.createTable('users', {
|
||
|
id: {
|
||
|
allowNull: false,
|
||
|
autoIncrement: true,
|
||
|
primaryKey: true,
|
||
|
type: Sequelize.INTEGER
|
||
|
},
|
||
|
username: {
|
||
|
type: Sequelize.DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
unique: true,
|
||
|
},
|
||
|
email: {
|
||
|
type: Sequelize.DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
unique: true,
|
||
|
},
|
||
|
password: {
|
||
|
type: Sequelize.DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
},
|
||
|
salt: {
|
||
|
type: Sequelize.DataTypes.STRING,
|
||
|
allowNull: false,
|
||
|
},
|
||
|
firstName: {
|
||
|
type: Sequelize.DataTypes.STRING,
|
||
|
allowNull: true,
|
||
|
},
|
||
|
lastName: {
|
||
|
type: Sequelize.DataTypes.STRING,
|
||
|
allowNull: true,
|
||
|
},
|
||
|
createdAt: Sequelize.DataTypes.DATE,
|
||
|
updatedAt: Sequelize.DataTypes.DATE,
|
||
|
});
|
||
|
},
|
||
|
|
||
|
down: (queryInterface, Sequelize) => {
|
||
|
return queryInterface.dropTable('users');
|
||
|
}
|
||
|
};
|