From e889a860d762797a8b813dc6fd3d8487b321fe58 Mon Sep 17 00:00:00 2001 From: Visoth Date: Wed, 10 Jul 2024 08:27:02 +0700 Subject: [PATCH] Change DB --- Config/config.env | 2 +- Controller/App_Versions.js | 2 +- Model/BC_Data.js | 2 +- Model/User.js | 23 +++++++++++++---------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Config/config.env b/Config/config.env index 03f9d86..42a1862 100644 --- a/Config/config.env +++ b/Config/config.env @@ -5,7 +5,7 @@ BEARER_HEADER=jdkewowjs@#Dfjsdkk3er@sfdgsdfgwer231 JWT_EXPIRE=7d JWT_COOKIE_EXPIRE=30 -APP_CODE=MBN +APP_CODE=POS ADMIN_USERNAME=bcsa diff --git a/Controller/App_Versions.js b/Controller/App_Versions.js index 093158c..c82348e 100644 --- a/Controller/App_Versions.js +++ b/Controller/App_Versions.js @@ -8,7 +8,7 @@ exports.getAppVersion = AsyncHandler(async (req, res, next) => { try { const appVersions = await AppVersion.findOne({ where: { - app_name: "MBN", // temporary change to MBN + app_name: "POS", // temporary change to MBN status: 1, } }); diff --git a/Model/BC_Data.js b/Model/BC_Data.js index 7015518..2306e5e 100644 --- a/Model/BC_Data.js +++ b/Model/BC_Data.js @@ -5,7 +5,7 @@ const db = require("../Config/db"); // what is this use for ? const DataModel = db.define( - "BCDATA", + "TDDATA", { ID: { type: sequelize.INTEGER, diff --git a/Model/User.js b/Model/User.js index db16f8b..39b9b10 100644 --- a/Model/User.js +++ b/Model/User.js @@ -6,27 +6,30 @@ const jwt = require("jsonwebtoken") const UserModel = db.define( "TDUSERS", { + USER_ID: { + type: sequelize.INTEGER, + primaryKey: true, + }, USER_CODE: { type: sequelize.STRING, - primaryKey: true, }, USER_NAME: { type: sequelize.STRING, }, - USER_PASS: { + USER_DESC: { type: sequelize.STRING, }, - USER_DESC: { + FIRST_NAME: { type: sequelize.STRING, }, - USER_CPAS: { + LAST_NAME: { type: sequelize.STRING, }, - USER_STAT: { - type: sequelize.CHAR, + ADDRESS: { + type: sequelize.STRING, }, - USER_LOG: { - type: sequelize.CHAR, + PHONE: { + type: sequelize.STRING, }, EMAIL: { type: sequelize.STRING, @@ -38,10 +41,10 @@ const UserModel = db.define( type: sequelize.STRING, }, USER_STATUS: { - type: sequelize.CHAR, // 1 = Active, 0 = Inactive + type: sequelize.CHAR, }, USER_TYPE: { - type: sequelize.CHAR, // S = Sale , U = User, D = Delivery , C = Customer + type: sequelize.CHAR, }, USER_LOG: { type: sequelize.STRING,