vr-models 1.0.26 → 1.0.28
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.
|
@@ -13,8 +13,11 @@ export interface BanAttributes {
|
|
|
13
13
|
revokedAt?: Date;
|
|
14
14
|
revokedBy?: string;
|
|
15
15
|
revocationReason?: string;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
16
18
|
user: User;
|
|
17
19
|
admin: User;
|
|
20
|
+
revokingAdmin?: User;
|
|
18
21
|
}
|
|
19
22
|
export interface BanCreationAttributes extends Omit<BanAttributes, "id" | "createdAt" | "updatedAt"> {
|
|
20
23
|
id?: string;
|
|
@@ -34,6 +37,9 @@ export declare class Ban extends Model<InferAttributes<Ban>, InferCreationAttrib
|
|
|
34
37
|
revocationReason: CreationOptional<string | undefined>;
|
|
35
38
|
user: NonAttribute<User>;
|
|
36
39
|
admin: NonAttribute<User>;
|
|
40
|
+
revokingAdmin?: NonAttribute<User>;
|
|
41
|
+
readonly createdAt: CreationOptional<Date>;
|
|
42
|
+
readonly updatedAt: CreationOptional<Date>;
|
|
37
43
|
static initialize(sequelize: any): void;
|
|
38
44
|
static associate(models: Record<string, ModelStatic<Model>>): void;
|
|
39
45
|
}
|
|
@@ -57,6 +57,14 @@ class Ban extends vr_migrations_1.Model {
|
|
|
57
57
|
type: vr_migrations_1.DataTypes.TEXT,
|
|
58
58
|
allowNull: true,
|
|
59
59
|
},
|
|
60
|
+
createdAt: {
|
|
61
|
+
type: vr_migrations_1.DataTypes.DATE,
|
|
62
|
+
defaultValue: vr_migrations_1.DataTypes.NOW,
|
|
63
|
+
},
|
|
64
|
+
updatedAt: {
|
|
65
|
+
type: vr_migrations_1.DataTypes.DATE,
|
|
66
|
+
defaultValue: vr_migrations_1.DataTypes.NOW,
|
|
67
|
+
},
|
|
60
68
|
}, {
|
|
61
69
|
sequelize,
|
|
62
70
|
modelName: "Ban",
|
|
@@ -80,6 +88,12 @@ class Ban extends vr_migrations_1.Model {
|
|
|
80
88
|
onDelete: "CASCADE",
|
|
81
89
|
onUpdate: "CASCADE",
|
|
82
90
|
});
|
|
91
|
+
this.belongsTo(models.User, {
|
|
92
|
+
foreignKey: "revokedBy",
|
|
93
|
+
as: "revokingAdmin",
|
|
94
|
+
onDelete: "CASCADE",
|
|
95
|
+
onUpdate: "CASCADE",
|
|
96
|
+
});
|
|
83
97
|
}
|
|
84
98
|
}
|
|
85
99
|
exports.Ban = Ban;
|