Updated db models
This commit is contained in:
@@ -4,14 +4,16 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
||||
|
||||
interface RoleAttributes {
|
||||
id: number
|
||||
uuid: string
|
||||
name: string
|
||||
description: string
|
||||
}
|
||||
|
||||
interface RoleCreationAttributes extends Optional<RoleAttributes, 'id'> { }
|
||||
|
||||
class Role extends Model<RoleAttributes, RoleCreationAttributes> implements RoleAttributes {
|
||||
public id!: number
|
||||
export class Role extends Model<RoleAttributes, RoleCreationAttributes> implements RoleAttributes {
|
||||
public readonly id!: number
|
||||
public readonly uuid!: string
|
||||
public name!: string
|
||||
public description!: string
|
||||
|
||||
@@ -27,6 +29,11 @@ export default () => {
|
||||
autoIncrement: true,
|
||||
primaryKey: true
|
||||
},
|
||||
uuid: {
|
||||
type: DataTypes.UUIDV4,
|
||||
allowNull: false,
|
||||
unique: true
|
||||
},
|
||||
name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
|
||||
Reference in New Issue
Block a user