@tomei/sso
Version:
Tomei SSO Package
77 lines (74 loc) • 1.76 kB
JavaScript
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('sso_GroupReportingUser', {
GroupReportingUserId: {
type: Sequelize.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
GroupCode: {
type: Sequelize.STRING(10),
allowNull: false,
references: {
model: 'sso_Group',
key: 'GroupCode',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
UserId: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'sso_User',
key: 'UserId',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
Rank: {
type: Sequelize.TINYINT,
allowNull: false,
},
Status: {
type: Sequelize.STRING(10),
allowNull: false,
defaultValue: 'Active',
},
CreatedById: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'sso_User',
key: 'UserId',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
CreatedAt: {
type: Sequelize.DATE,
allowNull: false,
},
UpdatedById: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: 'sso_User',
key: 'UserId',
},
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
UpdatedAt: {
type: Sequelize.DATE,
allowNull: false,
},
});
},
async down(queryInterface) {
await queryInterface.dropTable('sso_GroupReportingUser');
},
};