UNPKG

@tomei/sso

Version:
94 lines (91 loc) 2.1 kB
'use strict'; /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { await queryInterface.createTable('sso_Group', { GroupCode: { type: Sequelize.STRING(10), allowNull: false, primaryKey: true, }, Name: { type: Sequelize.STRING(50), allowNull: false, }, Description: { type: Sequelize.STRING(100), allowNull: true, }, Type: { type: Sequelize.ENUM, values: [ 'Company', 'Department', 'Team', 'Project', 'Building', 'Role', ], allowNull: false, }, ParentGroupCode: { type: Sequelize.STRING(10), allowNull: true, references: { model: 'sso_Group', key: 'GroupCode', }, onUpdate: 'CASCADE', onDelete: 'CASCADE', }, Path: { type: Sequelize.STRING(100), allowNull: false, }, InheritParentPrivilegeYN: { type: Sequelize.CHAR(1), defaultValue: 'N', }, InheritParentSystemAccessYN : { type: Sequelize.CHAR(1), defaultValue: 'N', }, 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_Group'); }, };