mp/Database/model/locationModel.js
newtbot 233ebafdcb location route
NO validation
no middleware to auth
2023-12-30 03:59:04 +08:00

45 lines
747 B
JavaScript

"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 };