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

Change enums to numbers

This commit is contained in:
The Arcane Brony 2021-10-10 20:34:45 +02:00
parent d38953439c
commit d7fa45771d
8 changed files with 17 additions and 20 deletions

View File

@ -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?: {

View File

@ -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,

View File

@ -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?: {

View File

@ -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 {

View File

@ -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;

View File

@ -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;
}

View File

@ -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[];

View File

@ -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;