고객사 관리및 설정값 수정정

This commit is contained in:
chpark 2024-12-19 15:55:38 +09:00
parent 6dfdd50c9e
commit 7b90ebd0d1
2 changed files with 61 additions and 7 deletions

View File

@ -44,13 +44,12 @@ const initializeServer = async () => {
// 데이터베이스 연결 대기
await waitForDatabase();
// // 개발 환경에서만 데이터베이스 동기화
// if (process.env.NODE_ENV !== "production") {
// await sequelize.sync({ force: true });
// // await sequelize.sync({ alter: true });
// logger.info("Database synchronized.");
// await require("./utils/createInitialAdmin")();
// }
// 개발 환경에서만 데이터베이스 동기화
if (process.env.NODE_ENV !== "production") {
await sequelize.sync({ alert: true });
logger.info("Database synchronized.");
//await require("./utils/createInitialAdmin")();
}
// 서버 시작
const port = config.port;

View File

@ -0,0 +1,55 @@
// models/OemMng.js
const { Model, DataTypes } = require("sequelize");
class OemMng extends Model {
static init(sequelize) {
super.init(
{
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
oem_code: {
type: DataTypes.STRING(64),
allowNull: true,
},
oem_name: {
type: DataTypes.STRING(64),
allowNull: true,
},
writer: {
type: DataTypes.STRING(32),
allowNull: true,
},
regdate: {
type: DataTypes.DATE,
allowNull: true,
},
status: {
type: DataTypes.STRING(32),
allowNull: true,
},
oem_no: {
type: DataTypes.STRING(32),
allowNull: true,
},
},
{
sequelize,
modelName: 'OemMng',
tableName: 'oem_mng1',
timestamps: true,
indexes: [
{
fields: ['id'],
},
],
}
);
return this;
}
}
module.exports = OemMng;