22 lines
433 B
TypeScript
22 lines
433 B
TypeScript
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;
|
|
} |