vr-models 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ export interface BanAttributes {
15
15
  revocationReason?: string;
16
16
  user: User;
17
17
  admin: User;
18
+ revokingAdmin?: User;
18
19
  }
19
20
  export interface BanCreationAttributes extends Omit<BanAttributes, "id" | "createdAt" | "updatedAt"> {
20
21
  id?: string;
@@ -34,6 +35,7 @@ export declare class Ban extends Model<InferAttributes<Ban>, InferCreationAttrib
34
35
  revocationReason: CreationOptional<string | undefined>;
35
36
  user: NonAttribute<User>;
36
37
  admin: NonAttribute<User>;
38
+ revokingAdmin?: NonAttribute<User>;
37
39
  static initialize(sequelize: any): void;
38
40
  static associate(models: Record<string, ModelStatic<Model>>): void;
39
41
  }
@@ -80,6 +80,12 @@ class Ban extends vr_migrations_1.Model {
80
80
  onDelete: "CASCADE",
81
81
  onUpdate: "CASCADE",
82
82
  });
83
+ this.belongsTo(models.User, {
84
+ foreignKey: "revokedBy",
85
+ as: "revokingAdmin",
86
+ onDelete: "CASCADE",
87
+ onUpdate: "CASCADE",
88
+ });
83
89
  }
84
90
  }
85
91
  exports.Ban = Ban;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vr-models",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Shared database models package for VR applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",