1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

Merge pull request #435 from TheArcaneBrony/change-enums-to-number

Change enums to numbers
This commit is contained in:
Flam3rboy 2021-10-11 15:06:00 +02:00 committed by GitHub
commit 237137bd6e
7 changed files with 8 additions and 11 deletions

View File

@ -55,10 +55,7 @@ export class AuditLog extends BaseClass {
@ManyToOne(() => User, (user: User) => user.id) @ManyToOne(() => User, (user: User) => user.id)
user: User; user: User;
@Column({ @Column({ type: "int" })
type: "simple-enum",
enum: AuditLogEvents,
})
action_type: AuditLogEvents; action_type: AuditLogEvents;
@Column({ type: "simple-json", nullable: true }) @Column({ type: "simple-json", nullable: true })

View File

@ -39,7 +39,7 @@ export class Channel extends BaseClass {
@Column({ type: "text", nullable: true }) @Column({ type: "text", nullable: true })
icon?: string | null; icon?: string | null;
@Column({ type: "simple-enum", enum: ChannelType }) @Column({ type: "int" })
type: ChannelType; type: ChannelType;
@OneToMany(() => Recipient, (recipient: Recipient) => recipient.channel, { @OneToMany(() => Recipient, (recipient: Recipient) => recipient.channel, {

View File

@ -148,7 +148,7 @@ export class Message extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
pinned?: boolean; pinned?: boolean;
@Column({ type: "simple-enum", enum: MessageType }) @Column({ type: "int" })
type: MessageType; type: MessageType;
@Column({ type: "simple-json", nullable: true }) @Column({ type: "simple-json", nullable: true })

View File

@ -35,7 +35,7 @@ export class Relationship extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
nickname?: string; nickname?: string;
@Column({ type: "simple-enum", enum: RelationshipType }) @Column({ type: "int" })
type: RelationshipType; type: RelationshipType;
toPublicRelationship() { toPublicRelationship() {

View File

@ -36,9 +36,9 @@ export class Sticker extends BaseClass {
}) })
guild?: Guild; guild?: Guild;
@Column({ type: "simple-enum", enum: StickerType }) @Column({ type: "int" })
type: StickerType; type: StickerType;
@Column({ type: "simple-enum", enum: StickerFormatType }) @Column({ type: "int" })
format_type: StickerFormatType; format_type: StickerFormatType;
} }

View File

@ -9,7 +9,7 @@ export enum TeamMemberState {
@Entity("team_members") @Entity("team_members")
export class TeamMember extends BaseClass { export class TeamMember extends BaseClass {
@Column({ type: "simple-enum", enum: TeamMemberState }) @Column({ type: "int" })
membership_state: TeamMemberState; membership_state: TeamMemberState;
@Column({ type: "simple-array" }) @Column({ type: "simple-array" })

View File

@ -12,7 +12,7 @@ export enum WebhookType {
@Entity("webhooks") @Entity("webhooks")
export class Webhook extends BaseClass { export class Webhook extends BaseClass {
@Column({ type: "simple-enum", enum: WebhookType }) @Column({ type: "int" })
type: WebhookType; type: WebhookType;
@Column({ nullable: true }) @Column({ nullable: true })