1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-20 17:51:35 +02: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)
user: User;
@Column({
type: "simple-enum",
enum: AuditLogEvents,
})
@Column({ type: "int" })
action_type: AuditLogEvents;
@Column({ type: "simple-json", nullable: true })

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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