location route

NO validation
no middleware to auth
This commit is contained in:
newtbot
2023-12-30 03:59:04 +08:00
parent 0aefebae75
commit 233ebafdcb
10 changed files with 305 additions and 36 deletions

View File

@ -0,0 +1,44 @@
"use strict";
const { Sequelize, DataTypes } = require("sequelize");
const { sequelize } = require("../mySQL");
sequelize.sync();
const locationModel = sequelize.define(
"location",
{
id: {
type: DataTypes.INTEGER,
allowNull: true,
primaryKey: true,
autoIncrement: true,
},
name: {
type: DataTypes.STRING,
allowNull: false,
length: 10,
},
added_by: {
type: DataTypes.STRING,
allowNull: false,
length: 10,
},
description: {
type: DataTypes.STRING,
allowNull: true,
length: 100,
},
createdAt: {
type: DataTypes.DATE,
allowNull: true,
},
updatedAt: {
type: DataTypes.DATE,
allowNull: true,
},
},
{
timestamps: true,
}
);
module.exports = { locationModel };