Updated models and migrations to new spec
This commit is contained in:
40
migrations/20220317121527-create-band.js
Normal file
40
migrations/20220317121527-create-band.js
Normal file
@@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
module.exports = {
|
||||
async up(queryInterface, Sequelize) {
|
||||
await queryInterface.createTable('Bands', {
|
||||
id: {
|
||||
allowNull: false,
|
||||
autoIncrement: false,
|
||||
primaryKey: true,
|
||||
type: Sequelize.INTEGER
|
||||
},
|
||||
name: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
description: {
|
||||
type: Sequelize.TEXT
|
||||
},
|
||||
imageURL: {
|
||||
type: Sequelize.STRING
|
||||
},
|
||||
enabled: {
|
||||
allowNull: false,
|
||||
type: Sequelize.BOOLEAN,
|
||||
defaultValue: false
|
||||
},
|
||||
createdAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE,
|
||||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP')
|
||||
},
|
||||
updatedAt: {
|
||||
allowNull: false,
|
||||
type: Sequelize.DATE,
|
||||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP')
|
||||
}
|
||||
});
|
||||
},
|
||||
async down(queryInterface, Sequelize) {
|
||||
await queryInterface.dropTable('Bands');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user