diff options
author | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-10-10 20:34:45 +0200 |
---|---|---|
committer | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-10-10 20:34:45 +0200 |
commit | d7fa45771d8acf1d0127754a5e813b45e62e353b (patch) | |
tree | 1344a82e239258b4bed9de72239f78aa41522039 | |
parent | forgot to fix primary columns on invites (diff) | |
download | server-d7fa45771d8acf1d0127754a5e813b45e62e353b.tar.xz |
Change enums to numbers
-rw-r--r-- | util/src/entities/AuditLog.ts | 7 | ||||
-rw-r--r-- | util/src/entities/Channel.ts | 4 | ||||
-rw-r--r-- | util/src/entities/Message.ts | 4 | ||||
-rw-r--r-- | util/src/entities/Relationship.ts | 4 | ||||
-rw-r--r-- | util/src/entities/Role.ts | 2 | ||||
-rw-r--r-- | util/src/entities/Sticker.ts | 8 | ||||
-rw-r--r-- | util/src/entities/TeamMember.ts | 4 | ||||
-rw-r--r-- | util/src/entities/Webhook.ts | 4 |
8 files changed, 17 insertions, 20 deletions
diff --git a/util/src/entities/AuditLog.ts b/util/src/entities/AuditLog.ts index ae9feb76..4b3536b6 100644 --- a/util/src/entities/AuditLog.ts +++ b/util/src/entities/AuditLog.ts @@ -55,11 +55,8 @@ export class AuditLog extends BaseClass { @ManyToOne(() => User, (user: User) => user.id) user: User; - @Column({ - type: "simple-enum", - enum: AuditLogEvents, - }) - action_type: AuditLogEvents; + @Column() + action_type: number; @Column({ type: "simple-json", nullable: true }) options?: { diff --git a/util/src/entities/Channel.ts b/util/src/entities/Channel.ts index 51d8b026..e10bd8ed 100644 --- a/util/src/entities/Channel.ts +++ b/util/src/entities/Channel.ts @@ -39,8 +39,8 @@ export class Channel extends BaseClass { @Column({ type: "text", nullable: true }) icon?: string | null; - @Column({ type: "simple-enum", enum: ChannelType }) - type: ChannelType; + @Column() + type: number; @OneToMany(() => Recipient, (recipient: Recipient) => recipient.channel, { cascade: true, diff --git a/util/src/entities/Message.ts b/util/src/entities/Message.ts index c7f7a1d1..e364c57b 100644 --- a/util/src/entities/Message.ts +++ b/util/src/entities/Message.ts @@ -148,8 +148,8 @@ export class Message extends BaseClass { @Column({ nullable: true }) pinned?: boolean; - @Column({ type: "simple-enum", enum: MessageType }) - type: MessageType; + @Column() + type: number; @Column({ type: "simple-json", nullable: true }) activity?: { diff --git a/util/src/entities/Relationship.ts b/util/src/entities/Relationship.ts index e016b36b..2e886e71 100644 --- a/util/src/entities/Relationship.ts +++ b/util/src/entities/Relationship.ts @@ -35,8 +35,8 @@ export class Relationship extends BaseClass { @Column({ nullable: true }) nickname?: string; - @Column({ type: "simple-enum", enum: RelationshipType }) - type: RelationshipType; + @Column() + type: number; toPublicRelationship() { return { diff --git a/util/src/entities/Role.ts b/util/src/entities/Role.ts index 9fca99a5..4a3dae98 100644 --- a/util/src/entities/Role.ts +++ b/util/src/entities/Role.ts @@ -36,7 +36,7 @@ export class Role extends BaseClass { @Column() position: number; - @Column({ type: "simple-json", nullable: true }) + @Column({ type: "simple-json", nullable: true, }) tags?: { bot_id?: string; integration_id?: string; diff --git a/util/src/entities/Sticker.ts b/util/src/entities/Sticker.ts index ab224d1d..8956616e 100644 --- a/util/src/entities/Sticker.ts +++ b/util/src/entities/Sticker.ts @@ -36,9 +36,9 @@ export class Sticker extends BaseClass { }) guild?: Guild; - @Column({ type: "simple-enum", enum: StickerType }) - type: StickerType; + @Column() + type: number; - @Column({ type: "simple-enum", enum: StickerFormatType }) - format_type: StickerFormatType; + @Column() + format_type: number; } diff --git a/util/src/entities/TeamMember.ts b/util/src/entities/TeamMember.ts index bdfdccf0..5642a211 100644 --- a/util/src/entities/TeamMember.ts +++ b/util/src/entities/TeamMember.ts @@ -9,8 +9,8 @@ export enum TeamMemberState { @Entity("team_members") export class TeamMember extends BaseClass { - @Column({ type: "simple-enum", enum: TeamMemberState }) - membership_state: TeamMemberState; + @Column() + membership_state: number; @Column({ type: "simple-array" }) permissions: string[]; diff --git a/util/src/entities/Webhook.ts b/util/src/entities/Webhook.ts index 9d8609ae..0d500962 100644 --- a/util/src/entities/Webhook.ts +++ b/util/src/entities/Webhook.ts @@ -12,8 +12,8 @@ export enum WebhookType { @Entity("webhooks") export class Webhook extends BaseClass { - @Column({ type: "simple-enum", enum: WebhookType }) - type: WebhookType; + @Column() + type: number; @Column({ nullable: true }) name?: string; |