32 lines
695 B
JavaScript
32 lines
695 B
JavaScript
|
|
const { Sequelize } = require("sequelize");
|
||
|
|
|
||
|
|
module.exports = {
|
||
|
|
async up(queryInterface) {
|
||
|
|
await queryInterface.createTable("class", {
|
||
|
|
ID_CLASS: {
|
||
|
|
type: Sequelize.UUID,
|
||
|
|
primaryKey: true,
|
||
|
|
defaultValue: Sequelize.UUIDV4,
|
||
|
|
allowNull: false,
|
||
|
|
},
|
||
|
|
NAME_CLASS: {
|
||
|
|
type: Sequelize.STRING(100),
|
||
|
|
allowNull: false,
|
||
|
|
},
|
||
|
|
TOTAL_STUDENT: {
|
||
|
|
type: Sequelize.INTEGER(11),
|
||
|
|
allowNull: true,
|
||
|
|
},
|
||
|
|
TIME_CLASS: {
|
||
|
|
type: Sequelize.DATE,
|
||
|
|
allowNull: true,
|
||
|
|
defaultValue: Sequelize.NOW,
|
||
|
|
},
|
||
|
|
});
|
||
|
|
},
|
||
|
|
|
||
|
|
async down(queryInterface) {
|
||
|
|
await queryInterface.dropTable("class");
|
||
|
|
},
|
||
|
|
};
|