Added: api init project

This commit is contained in:
2023-12-31 00:21:26 +01:00
parent dad526fdee
commit cf20935e01
34 changed files with 8041 additions and 0 deletions

35
api/src/models/User.ts Normal file
View File

@@ -0,0 +1,35 @@
import { DataTypes, Model } from 'sequelize'
import path from 'path'
import db from '../config/sequelize.config.ts'
class Instance extends Model {}
Instance.init(
{
_id: {
type: DataTypes.UUID,
primaryKey: true,
allowNull: false,
unique: true,
},
username: {
type: DataTypes.STRING,
allowNull: false,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
},
{
sequelize: db,
tableName: path.basename(__filename).split('.')[0].toLowerCase(),
},
)
export default Instance