feat: add User data manager & User Database

This commit is contained in:
CrescentLeaf
2025-06-15 22:44:45 +08:00
parent f337896c66
commit 283bc7e296
2 changed files with 53 additions and 0 deletions

19
server/data/User.ts Normal file
View File

@@ -0,0 +1,19 @@
// @ts-types="npm:sequelize"
import { Sequelize, Op, Model, DataTypes } from 'sequelize'
export default class User extends Model {
declare created_id: number
static async initTable(sequelize: Sequelize, name: string) {
this.init({
created_id: {
type: DataTypes.INTEGER.UNSIGNED,
autoIncrement: true,
primaryKey: true,
}
}, {
sequelize: sequelize,
tableName: name,
})
await this.sync({ alter: true })
}
}