Updated db models
This commit is contained in:
@@ -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<IngredientAttributes, 'id'> { }
|
||||
|
||||
class Ingredient extends Model<IngredientAttributes, IngredientCreationAttributes> implements IngredientAttributes {
|
||||
public id!: number
|
||||
export class Ingredient extends Model<IngredientAttributes, IngredientCreationAttributes> 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,
|
||||
|
||||
@@ -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<MetaSchoolAttributes, 'id'> { }
|
||||
|
||||
class MetaSchool extends Model<MetaSchoolAttributes, MetaSchoolCreationAttributes> implements MetaSchoolAttributes {
|
||||
public id!: number
|
||||
export class MetaSchool extends Model<MetaSchoolAttributes, MetaSchoolCreationAttributes> 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,
|
||||
|
||||
@@ -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<SchoolAttributes, 'id'> { }
|
||||
|
||||
class School extends Model<SchoolAttributes, SchoolCreationAttributes> implements SchoolAttributes {
|
||||
public id!: number
|
||||
export class School extends Model<SchoolAttributes, SchoolCreationAttributes> 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,
|
||||
|
||||
@@ -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<SpellAttributes, 'id'> { }
|
||||
|
||||
class Spell extends Model<SpellAttributes, SpellCreationAttributes> implements SpellAttributes {
|
||||
public id!: number
|
||||
export class SpellModel extends Model<SpellAttributes, SpellCreationAttributes> implements SpellAttributes {
|
||||
public readonly id!: number
|
||||
public readonly uuid!: string
|
||||
public name!: string
|
||||
public description!: string
|
||||
|
||||
@@ -36,13 +38,18 @@ class Spell extends Model<SpellAttributes, SpellCreationAttributes> 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,
|
||||
|
||||
@@ -4,13 +4,15 @@ import { AuracleDatabaseDriver } from "../../AuracleDatabaseDriver";
|
||||
|
||||
interface PermissionAttributes {
|
||||
id: number
|
||||
uuid: string
|
||||
slug: string
|
||||
}
|
||||
|
||||
interface PermissionCreationAttributes extends Optional<PermissionAttributes, 'id'> { }
|
||||
|
||||
class Permission extends Model<PermissionAttributes, PermissionCreationAttributes> implements PermissionAttributes {
|
||||
public id!: number
|
||||
export class Permission extends Model<PermissionAttributes, PermissionCreationAttributes> 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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<UserAttributes, 'id'> { }
|
||||
|
||||
class User extends Model<UserAttributes, UserCreationAttributes> implements UserAttributes {
|
||||
public id!: number
|
||||
export class User extends Model<UserAttributes, UserCreationAttributes> 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,
|
||||
|
||||
Reference in New Issue
Block a user