Untitled
unknown
plain_text
2 years ago
767 B
9
Indexable
import { DataTypes, Model } from 'sequelize';
import db from '.';
class User extends Model {
public id!: number;
public username!: string;
public role!: string;
public email!: string;
public password!: string;
}
User.init(
{
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
autoIncrement: true,
},
username: {
type: DataTypes.STRING,
allowNull: false,
},
role: {
type: DataTypes.STRING,
allowNull: false,
},
email: {
type: DataTypes.STRING,
allowNull: false,
},
password: {
type: DataTypes.STRING,
allowNull: false,
},
},
{
sequelize: db,
modelName: 'User',
timestamps: false,
},
);
export default User;
Editor is loading...
Leave a Comment