synt_backend
Version:
Synt light-weight node backend service
80 lines (79 loc) • 1.9 kB
JavaScript
"use strict";
module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable("GeneralLedgerAccounts", {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER,
},
VMEId: {
type: Sequelize.INTEGER,
references: {
model: "VMEs",
key: "id",
},
allowNull: false,
defaultValue: Sequelize.UUIDV4,
onUpdate: "CASCADE",
onDelete: "CASCADE",
},
GeneralLedgerDefinitionId: {
type: Sequelize.INTEGER,
references: {
model: "GeneralLedgerDefinitions",
key: "id",
},
allowNull: true,
defaultValue: Sequelize.UUIDV4,
onUpdate: "NO ACTION",
onDelete: "CASCADE",
},
DistributionKeyId: {
type: Sequelize.INTEGER,
references: {
model: "DistributionKeys",
key: "id",
},
allowNull: false,
defaultValue: Sequelize.UUIDV4,
onUpdate: "CASCADE",
onDelete: "CASCADE",
},
code: {
type: Sequelize.INTEGER.UNSIGNED,
},
name: {
type: Sequelize.STRING,
allowNull: true,
},
description: {
type: Sequelize.STRING,
allowNull: true,
},
order_number: {
type: Sequelize.INTEGER.UNSIGNED,
defaultValue: 0,
allowNull: false,
},
balance_type: {
type: Sequelize.ENUM("B", "R"),
},
start_value: {
type: Sequelize.DECIMAL(8, 2),
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
},
});
},
down: async (queryInterface) => {
await queryInterface.dropTable("GeneralLedgerAccounts");
},
};