UNPKG

@tomei/rental

Version:
97 lines (94 loc) 2.8 kB
'use strict'; /** @type {import('sequelize-cli').Migration} */ module.exports = { async up(queryInterface, Sequelize) { await queryInterface.createTable('rental_Rental', { RentalId: { type: Sequelize.STRING(30), allowNull: false, primaryKey: true, }, CustomerId: { type: Sequelize.STRING(30), allowNull: false, }, CustomerType: { type: Sequelize.STRING(30), allowNull: false, }, ItemId: { type: Sequelize.STRING(30), allowNull: false, }, ItemType: { type: Sequelize.STRING(30), allowNull: false, }, PriceId: { type: Sequelize.STRING(30), allowNull: false, references: { model: 'rental_Price', key: 'PriceId', }, onUpdate: 'CASCADE', onDelete: 'CASCADE', }, StartDateTime: { type: Sequelize.DATE, allowNull: false, }, EndDateTime: { type: Sequelize.DATE, allowNull: false, }, Status: { type: Sequelize.STRING(50), allowNull: false, }, CancelRemarks: { type: Sequelize.STRING(3000), }, TerminateRemarks: { type: Sequelize.STRING(3000), }, EscheatmentYN: { type: Sequelize.CHAR(1), }, AgreementNo: { type: Sequelize.STRING(30), allowNull: false, unique: true, references: { model: 'rental_Agreement', key: 'AgreementNo', }, onUpdate: 'CASCADE', onDelete: 'CASCADE', }, AccountType: { type: Sequelize.STRING(10), allowNull: false, }, CreatedById: { type: Sequelize.STRING(30), allowNull: false, }, CreatedAt: { type: Sequelize.DATE, allowNull: false, }, UpdatedById: { type: Sequelize.STRING(30), allowNull: false, }, UpdatedAt: { type: Sequelize.DATE, allowNull: false, }, }); }, async down(queryInterface) { await queryInterface.dropTable('rental_Rental'); }, };