diff --git a/src/database/models/spells/Ingredient.ts b/src/database/models/spells/Ingredient.ts index 750a3bc..ff9c04f 100644 --- a/src/database/models/spells/Ingredient.ts +++ b/src/database/models/spells/Ingredient.ts @@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver"; interface IngredientAttributes { id: number + uuid: string name: string description: string @@ -12,8 +13,9 @@ interface IngredientAttributes { interface IngredientCreationAttributes extends Optional { } -class Ingredient extends Model implements IngredientAttributes { - public id!: number +export class Ingredient extends Model implements IngredientAttributes { + public readonly id!: number + public readonly uuid!: string public name!: string public description!: string @@ -31,6 +33,11 @@ export default () => { autoIncrement: true, primaryKey: true }, + uuid: { + type: DataTypes.UUIDV4, + allowNull: false, + unique: true + }, name: { type: DataTypes.STRING, allowNull: false, diff --git a/src/database/models/spells/MetaSchool.ts b/src/database/models/spells/MetaSchool.ts index cf6d99c..d8c7ef0 100644 --- a/src/database/models/spells/MetaSchool.ts +++ b/src/database/models/spells/MetaSchool.ts @@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver"; interface MetaSchoolAttributes { id: number + uuid: string name: string description: string @@ -12,8 +13,9 @@ interface MetaSchoolAttributes { interface MetaSchoolCreationAttributes extends Optional { } -class MetaSchool extends Model implements MetaSchoolAttributes { - public id!: number +export class MetaSchool extends Model implements MetaSchoolAttributes { + public readonly id!: number + public readonly uuid!: string public name!: string public description!: string @@ -31,6 +33,11 @@ export default () => { autoIncrement: true, primaryKey: true }, + uuid: { + type: DataTypes.UUIDV4, + allowNull: false, + unique: true + }, name: { type: DataTypes.STRING, allowNull: false, diff --git a/src/database/models/spells/School.ts b/src/database/models/spells/School.ts index 4875f84..36f6877 100644 --- a/src/database/models/spells/School.ts +++ b/src/database/models/spells/School.ts @@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver"; interface SchoolAttributes { id: number + uuid: string name: string description: string @@ -12,8 +13,9 @@ interface SchoolAttributes { interface SchoolCreationAttributes extends Optional { } -class School extends Model implements SchoolAttributes { - public id!: number +export class School extends Model implements SchoolAttributes { + public readonly id!: number + public readonly uuid!: string public name!: string public description!: string @@ -31,6 +33,11 @@ export default () => { autoIncrement: true, primaryKey: true }, + uuid: { + type: DataTypes.UUIDV4, + allowNull: false, + unique: true + }, name: { type: DataTypes.STRING, allowNull: false, diff --git a/src/database/models/spells/Spell.ts b/src/database/models/spells/Spell.ts index bdc8e4a..7fcedb7 100644 --- a/src/database/models/spells/Spell.ts +++ b/src/database/models/spells/Spell.ts @@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver"; interface SpellAttributes { id: number + uuid: string name: string description: string @@ -18,8 +19,9 @@ interface SpellAttributes { interface SpellCreationAttributes extends Optional { } -class Spell extends Model implements SpellAttributes { - public id!: number +export class SpellModel extends Model implements SpellAttributes { + public readonly id!: number + public readonly uuid!: string public name!: string public description!: string @@ -36,13 +38,18 @@ class Spell extends Model implements S } export default () => { - Spell.init( + SpellModel.init( { id: { type: DataTypes.INTEGER.UNSIGNED, autoIncrement: true, primaryKey: true }, + uuid: { + type: DataTypes.UUIDV4, + allowNull: false, + unique: true + }, name: { type: DataTypes.STRING, allowNull: false, diff --git a/src/database/models/users/Permission.ts b/src/database/models/users/Permission.ts index 2b1b4f6..f5848bf 100644 --- a/src/database/models/users/Permission.ts +++ b/src/database/models/users/Permission.ts @@ -4,13 +4,15 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver"; interface PermissionAttributes { id: number + uuid: string slug: string } interface PermissionCreationAttributes extends Optional { } -class Permission extends Model implements PermissionAttributes { - public id!: number +export class Permission extends Model implements PermissionAttributes { + public readonly id!: number + public readonly uuid!: string public slug!: string public readonly createdAt!: Date; @@ -25,6 +27,11 @@ export default () => { autoIncrement: true, primaryKey: true }, + uuid: { + type: DataTypes.UUIDV4, + allowNull: false, + unique: true + }, slug: { type: DataTypes.STRING, allowNull: false, diff --git a/src/database/models/users/Role.ts b/src/database/models/users/Role.ts index 7e24f9b..47e545f 100644 --- a/src/database/models/users/Role.ts +++ b/src/database/models/users/Role.ts @@ -4,14 +4,16 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver"; interface RoleAttributes { id: number + uuid: string name: string description: string } interface RoleCreationAttributes extends Optional { } -class Role extends Model implements RoleAttributes { - public id!: number +export class Role extends Model 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, diff --git a/src/database/models/users/User.ts b/src/database/models/users/User.ts index 7945c7f..676f53f 100644 --- a/src/database/models/users/User.ts +++ b/src/database/models/users/User.ts @@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver"; interface UserAttributes { id: number + uuid: string mail: string password: string @@ -15,8 +16,9 @@ interface UserAttributes { interface UserCreationAttributes extends Optional { } -class User extends Model implements UserAttributes { - public id!: number +export class User extends Model implements UserAttributes { + public readonly id!: number + public readonly uuid!: string public readonly mail!: string public readonly password!: string @@ -37,6 +39,11 @@ export default () => { autoIncrement: true, primaryKey: true }, + uuid: { + type: DataTypes.UUIDV4, + allowNull: false, + unique: true + }, mail: { type: DataTypes.STRING, allowNull: false,