Updated db models
This commit is contained in:
@@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
|||||||
|
|
||||||
interface IngredientAttributes {
|
interface IngredientAttributes {
|
||||||
id: number
|
id: number
|
||||||
|
uuid: string
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
|
|
||||||
@@ -12,8 +13,9 @@ interface IngredientAttributes {
|
|||||||
|
|
||||||
interface IngredientCreationAttributes extends Optional<IngredientAttributes, 'id'> { }
|
interface IngredientCreationAttributes extends Optional<IngredientAttributes, 'id'> { }
|
||||||
|
|
||||||
class Ingredient extends Model<IngredientAttributes, IngredientCreationAttributes> implements IngredientAttributes {
|
export class Ingredient extends Model<IngredientAttributes, IngredientCreationAttributes> implements IngredientAttributes {
|
||||||
public id!: number
|
public readonly id!: number
|
||||||
|
public readonly uuid!: string
|
||||||
public name!: string
|
public name!: string
|
||||||
public description!: string
|
public description!: string
|
||||||
|
|
||||||
@@ -31,6 +33,11 @@ export default () => {
|
|||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUIDV4,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true
|
||||||
|
},
|
||||||
name: {
|
name: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
|||||||
|
|
||||||
interface MetaSchoolAttributes {
|
interface MetaSchoolAttributes {
|
||||||
id: number
|
id: number
|
||||||
|
uuid: string
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
|
|
||||||
@@ -12,8 +13,9 @@ interface MetaSchoolAttributes {
|
|||||||
|
|
||||||
interface MetaSchoolCreationAttributes extends Optional<MetaSchoolAttributes, 'id'> { }
|
interface MetaSchoolCreationAttributes extends Optional<MetaSchoolAttributes, 'id'> { }
|
||||||
|
|
||||||
class MetaSchool extends Model<MetaSchoolAttributes, MetaSchoolCreationAttributes> implements MetaSchoolAttributes {
|
export class MetaSchool extends Model<MetaSchoolAttributes, MetaSchoolCreationAttributes> implements MetaSchoolAttributes {
|
||||||
public id!: number
|
public readonly id!: number
|
||||||
|
public readonly uuid!: string
|
||||||
public name!: string
|
public name!: string
|
||||||
public description!: string
|
public description!: string
|
||||||
|
|
||||||
@@ -31,6 +33,11 @@ export default () => {
|
|||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUIDV4,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true
|
||||||
|
},
|
||||||
name: {
|
name: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
|||||||
|
|
||||||
interface SchoolAttributes {
|
interface SchoolAttributes {
|
||||||
id: number
|
id: number
|
||||||
|
uuid: string
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
|
|
||||||
@@ -12,8 +13,9 @@ interface SchoolAttributes {
|
|||||||
|
|
||||||
interface SchoolCreationAttributes extends Optional<SchoolAttributes, 'id'> { }
|
interface SchoolCreationAttributes extends Optional<SchoolAttributes, 'id'> { }
|
||||||
|
|
||||||
class School extends Model<SchoolAttributes, SchoolCreationAttributes> implements SchoolAttributes {
|
export class School extends Model<SchoolAttributes, SchoolCreationAttributes> implements SchoolAttributes {
|
||||||
public id!: number
|
public readonly id!: number
|
||||||
|
public readonly uuid!: string
|
||||||
public name!: string
|
public name!: string
|
||||||
public description!: string
|
public description!: string
|
||||||
|
|
||||||
@@ -31,6 +33,11 @@ export default () => {
|
|||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUIDV4,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true
|
||||||
|
},
|
||||||
name: {
|
name: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
|||||||
|
|
||||||
interface SpellAttributes {
|
interface SpellAttributes {
|
||||||
id: number
|
id: number
|
||||||
|
uuid: string
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
|
|
||||||
@@ -18,8 +19,9 @@ interface SpellAttributes {
|
|||||||
|
|
||||||
interface SpellCreationAttributes extends Optional<SpellAttributes, 'id'> { }
|
interface SpellCreationAttributes extends Optional<SpellAttributes, 'id'> { }
|
||||||
|
|
||||||
class Spell extends Model<SpellAttributes, SpellCreationAttributes> implements SpellAttributes {
|
export class SpellModel extends Model<SpellAttributes, SpellCreationAttributes> implements SpellAttributes {
|
||||||
public id!: number
|
public readonly id!: number
|
||||||
|
public readonly uuid!: string
|
||||||
public name!: string
|
public name!: string
|
||||||
public description!: string
|
public description!: string
|
||||||
|
|
||||||
@@ -36,13 +38,18 @@ class Spell extends Model<SpellAttributes, SpellCreationAttributes> implements S
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
Spell.init(
|
SpellModel.init(
|
||||||
{
|
{
|
||||||
id: {
|
id: {
|
||||||
type: DataTypes.INTEGER.UNSIGNED,
|
type: DataTypes.INTEGER.UNSIGNED,
|
||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUIDV4,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true
|
||||||
|
},
|
||||||
name: {
|
name: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
|
|||||||
@@ -4,13 +4,15 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
|||||||
|
|
||||||
interface PermissionAttributes {
|
interface PermissionAttributes {
|
||||||
id: number
|
id: number
|
||||||
|
uuid: string
|
||||||
slug: string
|
slug: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PermissionCreationAttributes extends Optional<PermissionAttributes, 'id'> { }
|
interface PermissionCreationAttributes extends Optional<PermissionAttributes, 'id'> { }
|
||||||
|
|
||||||
class Permission extends Model<PermissionAttributes, PermissionCreationAttributes> implements PermissionAttributes {
|
export class Permission extends Model<PermissionAttributes, PermissionCreationAttributes> implements PermissionAttributes {
|
||||||
public id!: number
|
public readonly id!: number
|
||||||
|
public readonly uuid!: string
|
||||||
public slug!: string
|
public slug!: string
|
||||||
|
|
||||||
public readonly createdAt!: Date;
|
public readonly createdAt!: Date;
|
||||||
@@ -25,6 +27,11 @@ export default () => {
|
|||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUIDV4,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true
|
||||||
|
},
|
||||||
slug: {
|
slug: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
|
|||||||
@@ -4,14 +4,16 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
|||||||
|
|
||||||
interface RoleAttributes {
|
interface RoleAttributes {
|
||||||
id: number
|
id: number
|
||||||
|
uuid: string
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RoleCreationAttributes extends Optional<RoleAttributes, 'id'> { }
|
interface RoleCreationAttributes extends Optional<RoleAttributes, 'id'> { }
|
||||||
|
|
||||||
class Role extends Model<RoleAttributes, RoleCreationAttributes> implements RoleAttributes {
|
export class Role extends Model<RoleAttributes, RoleCreationAttributes> implements RoleAttributes {
|
||||||
public id!: number
|
public readonly id!: number
|
||||||
|
public readonly uuid!: string
|
||||||
public name!: string
|
public name!: string
|
||||||
public description!: string
|
public description!: string
|
||||||
|
|
||||||
@@ -27,6 +29,11 @@ export default () => {
|
|||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUIDV4,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true
|
||||||
|
},
|
||||||
name: {
|
name: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
|||||||
|
|
||||||
interface UserAttributes {
|
interface UserAttributes {
|
||||||
id: number
|
id: number
|
||||||
|
uuid: string
|
||||||
mail: string
|
mail: string
|
||||||
password: string
|
password: string
|
||||||
|
|
||||||
@@ -15,8 +16,9 @@ interface UserAttributes {
|
|||||||
|
|
||||||
interface UserCreationAttributes extends Optional<UserAttributes, 'id'> { }
|
interface UserCreationAttributes extends Optional<UserAttributes, 'id'> { }
|
||||||
|
|
||||||
class User extends Model<UserAttributes, UserCreationAttributes> implements UserAttributes {
|
export class User extends Model<UserAttributes, UserCreationAttributes> implements UserAttributes {
|
||||||
public id!: number
|
public readonly id!: number
|
||||||
|
public readonly uuid!: string
|
||||||
public readonly mail!: string
|
public readonly mail!: string
|
||||||
public readonly password!: string
|
public readonly password!: string
|
||||||
|
|
||||||
@@ -37,6 +39,11 @@ export default () => {
|
|||||||
autoIncrement: true,
|
autoIncrement: true,
|
||||||
primaryKey: true
|
primaryKey: true
|
||||||
},
|
},
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUIDV4,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true
|
||||||
|
},
|
||||||
mail: {
|
mail: {
|
||||||
type: DataTypes.STRING,
|
type: DataTypes.STRING,
|
||||||
allowNull: false,
|
allowNull: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user