express routing

This commit is contained in:
newtbot
2023-12-19 18:51:23 +08:00
parent e9ed0144aa
commit 7c53b362eb
11 changed files with 696 additions and 41 deletions

View File

@ -0,0 +1,40 @@
'use strict';
const { Sequelize, DataTypes } = require('sequelize');
const { sequelize } = require("../mySql.js");
const userModel = sequelize.define('users', {
// Model attributes are defined here
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true
},
name: {
type: DataTypes.STRING,
allowNull: true,
length: 255
},
username: {
type: DataTypes.STRING,
allowNull: true,
length: 50
},
email: {
type: DataTypes.STRING,
allowNull: true,
length: 255
},
password: {
type: DataTypes.STRING,
allowNull: true,
length: 255
},
lastLogin: {
type: DataTypes.timestamps,
allowNull: true,
}
},{
timestamps: false, // Disable automatic timestamps
});
module.exports = { userModel }