PIbd-23_Dyakonov_R_R_SUBD_P.../server/models/role.model.ts

22 lines
433 B
TypeScript
Raw Normal View History

import { Table, Column, Model, DataType, Length } from 'sequelize-typescript';
@Table({
timestamps: false,
tableName: "roles",
modelName: "Role",
})
export default class Role extends Model {
@Column({
primaryKey: true,
autoIncrement: true,
type: DataType.INTEGER
})
declare id: number;
@Length({ min: 1, max: 20 })
@Column({
allowNull: false,
type: DataType.STRING
})
declare name: string;
}