@briswell/bw-domain
Version:
Domain Library for Node.js
84 lines (83 loc) • 2.26 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Sequelize = require("sequelize");
exports.default = (sqlize) => {
return sqlize.define('customer', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.BIGINT(20).UNSIGNED,
},
name: {
allowNull: false,
type: Sequelize.STRING(100),
},
kana: {
allowNull: false,
type: Sequelize.STRING(200),
},
tel: {
type: Sequelize.STRING(100),
},
staffName: {
type: Sequelize.STRING(50),
field: 'staff_name',
},
email: {
allowNull: true,
type: Sequelize.STRING(100),
},
zip: {
allowNull: true,
type: Sequelize.STRING(8),
},
address1: {
type: Sequelize.STRING(50),
},
address2: {
type: Sequelize.STRING(300),
},
disableFlag: {
allowNull: false,
type: Sequelize.SMALLINT(6).UNSIGNED,
defaultValue: 0,
field: 'disable_flag',
},
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: 'customer',
paranoid: true
});
};