@briswell/bw-domain
Version:
Domain Library for Node.js
64 lines (63 loc) • 1.76 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize = require("sequelize");
exports.default = (sqlize) => {
return sqlize.define('staff', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT(20).UNSIGNED
},
sectionId: {
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'section_id'
},
staffName: {
type: Sequelize.STRING(100),
field: 'staff_name'
},
type: {
type: Sequelize.SMALLINT(6).UNSIGNED
},
imagePath: {
type: Sequelize.STRING(255),
field: 'image_path'
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'created_at'
},
createdBy: {
allowNull: false,
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'created_by'
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
field: 'updated_at'
},
updatedBy: {
allowNull: false,
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'updated_by'
},
deletedAt: {
allowNull: true,
type: Sequelize.DATE,
field: 'deleted_at'
},
deletedBy: {
allowNull: true,
type: Sequelize.BIGINT(20).UNSIGNED,
field: 'deleted_by'
},
}, {
tableName: 'staff',
paranoid: true
});
};