Run prettier for @Entity()

This commit is contained in:
TomatoCake 2024-08-17 14:54:17 +02:00
parent ff6df19869
commit 99c75d3ae4
38 changed files with 152 additions and 38 deletions

View File

@ -21,7 +21,10 @@ import { BaseClass } from "./BaseClass";
import { Team } from "./Team"; import { Team } from "./Team";
import { User } from "./User"; import { User } from "./User";
@Entity({name: "applications", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "applications",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Application extends BaseClass { export class Application extends BaseClass {
@Column() @Column()
name: string; name: string;

View File

@ -28,7 +28,10 @@ import { URL } from "url";
import { deleteFile } from "../util/cdn"; import { deleteFile } from "../util/cdn";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
@Entity({name: "attachments", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "attachments",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Attachment extends BaseClass { export class Attachment extends BaseClass {
@Column() @Column()
filename: string; // name of file attached filename: string; // name of file attached

View File

@ -111,7 +111,10 @@ export enum AuditLogEvents {
ROUTE_UPDATE = 226, ROUTE_UPDATE = 226,
} }
@Entity({name: "audit_logs", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "audit_logs",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class AuditLog extends BaseClass { export class AuditLog extends BaseClass {
@JoinColumn({ name: "target_id" }) @JoinColumn({ name: "target_id" })
@ManyToOne(() => User) @ManyToOne(() => User)

View File

@ -21,7 +21,10 @@ import { BaseClass } from "./BaseClass";
import { User } from "./User"; import { User } from "./User";
import crypto from "crypto"; import crypto from "crypto";
@Entity({name: "backup_codes", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "backup_codes",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class BackupCode extends BaseClass { export class BackupCode extends BaseClass {
@JoinColumn({ name: "user_id" }) @JoinColumn({ name: "user_id" })
@ManyToOne(() => User, { onDelete: "CASCADE" }) @ManyToOne(() => User, { onDelete: "CASCADE" })

View File

@ -19,7 +19,10 @@
import { Column, Entity } from "typeorm"; import { Column, Entity } from "typeorm";
import { BaseClassWithoutId } from "./BaseClass"; import { BaseClassWithoutId } from "./BaseClass";
@Entity({name: "badges", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "badges",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Badge extends BaseClassWithoutId { export class Badge extends BaseClassWithoutId {
@Column({ primary: true }) @Column({ primary: true })
id: string; id: string;

View File

@ -21,7 +21,10 @@ import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild"; import { Guild } from "./Guild";
import { User } from "./User"; import { User } from "./User";
@Entity({name: "bans", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "bans",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Ban extends BaseClass { export class Ban extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
@RelationId((ban: Ban) => ban.user) @RelationId((ban: Ban) => ban.user)

View File

@ -33,7 +33,10 @@ import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
// }] // }]
// Also populate discord default categories // Also populate discord default categories
@Entity({name: "categories", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "categories",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Categories extends BaseClassWithoutId { export class Categories extends BaseClassWithoutId {
// Not using snowflake // Not using snowflake

View File

@ -69,7 +69,10 @@ export enum ChannelType {
UNHANDLED = 255, // unhandled unowned pass-through channel type UNHANDLED = 255, // unhandled unowned pass-through channel type
} }
@Entity({name: "channels", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "channels",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Channel extends BaseClass { export class Channel extends BaseClass {
@Column() @Column()
created_at: Date; created_at: Date;

View File

@ -19,7 +19,10 @@
import { Column, Entity } from "typeorm"; import { Column, Entity } from "typeorm";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
@Entity({name: "client_release", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "client_release",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Release extends BaseClass { export class Release extends BaseClass {
@Column() @Column()
name: string; name: string;

View File

@ -19,7 +19,10 @@
import { Column, Entity } from "typeorm"; import { Column, Entity } from "typeorm";
import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass"; import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
@Entity({name: "config", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "config",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class ConfigEntity extends BaseClassWithoutId { export class ConfigEntity extends BaseClassWithoutId {
@PrimaryIdColumn() @PrimaryIdColumn()
key: string; key: string;

View File

@ -26,7 +26,10 @@ export type PublicConnectedAccount = Pick<
"name" | "type" | "verified" "name" | "type" | "verified"
>; >;
@Entity({name: "connected_accounts", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "connected_accounts",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class ConnectedAccount extends BaseClass { export class ConnectedAccount extends BaseClass {
@Column() @Column()
external_id: string; external_id: string;

View File

@ -19,7 +19,10 @@
import { Column, Entity } from "typeorm"; import { Column, Entity } from "typeorm";
import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass"; import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
@Entity({name: "connection_config", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "connection_config",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class ConnectionConfigEntity extends BaseClassWithoutId { export class ConnectionConfigEntity extends BaseClassWithoutId {
@PrimaryIdColumn() @PrimaryIdColumn()
key: string; key: string;

View File

@ -20,7 +20,10 @@ import { BaseClass } from "./BaseClass";
import { Entity, Column } from "typeorm"; import { Entity, Column } from "typeorm";
import { Embed } from "./Message"; import { Embed } from "./Message";
@Entity({name: "embed_cache", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "embed_cache",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class EmbedCache extends BaseClass { export class EmbedCache extends BaseClass {
@Column() @Column()
url: string; url: string;

View File

@ -21,7 +21,10 @@ import { User } from ".";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild"; import { Guild } from "./Guild";
@Entity({name: "emojis", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "emojis",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Emoji extends BaseClass { export class Emoji extends BaseClass {
@Column() @Column()
animated: boolean; animated: boolean;

View File

@ -19,7 +19,10 @@
import { Column, Entity } from "typeorm"; import { Column, Entity } from "typeorm";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
@Entity({name: "security_settings", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "security_settings",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class SecuritySettings extends BaseClass { export class SecuritySettings extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
guild_id: string; guild_id: string;

View File

@ -66,7 +66,10 @@ export const PublicGuildRelations = [
// "members.user", // "members.user",
]; ];
@Entity({name: "guilds", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "guilds",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Guild extends BaseClass { export class Guild extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
@RelationId((guild: Guild) => guild.afk_channel) @RelationId((guild: Guild) => guild.afk_channel)

View File

@ -25,7 +25,10 @@ import { User } from "./User";
export const PublicInviteRelation = ["inviter", "guild", "channel"]; export const PublicInviteRelation = ["inviter", "guild", "channel"];
@Entity({name: "invites", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "invites",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Invite extends BaseClassWithoutId { export class Invite extends BaseClassWithoutId {
@PrimaryIdColumn() @PrimaryIdColumn()
code: string; code: string;

View File

@ -65,7 +65,10 @@ export const MemberPrivateProjection: (keyof Member)[] = [
"user", "user",
]; ];
@Entity({name: "members", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "members",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
@Index(["id", "guild_id"], { unique: true }) @Index(["id", "guild_id"], { unique: true })
export class Member extends BaseClassWithoutId { export class Member extends BaseClassWithoutId {
@PrimaryGeneratedColumn() @PrimaryGeneratedColumn()

View File

@ -68,7 +68,10 @@ export enum MessageType {
UNHANDLED = 255, UNHANDLED = 255,
} }
@Entity({name: "messages", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "messages",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
@Index(["channel_id", "id"], { unique: true }) @Index(["channel_id", "id"], { unique: true })
export class Message extends BaseClass { export class Message extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })

View File

@ -30,7 +30,10 @@ export const PrimaryIdAutoGenerated = process.env.DATABASE?.startsWith(
? ObjectIdColumn ? ObjectIdColumn
: PrimaryGeneratedColumn; : PrimaryGeneratedColumn;
@Entity({name: "migrations", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "migrations",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Migration extends BaseEntity { export class Migration extends BaseEntity {
@PrimaryIdAutoGenerated() @PrimaryIdAutoGenerated()
id: number; id: number;

View File

@ -20,7 +20,10 @@ import { Column, Entity, JoinColumn, ManyToOne, Unique } from "typeorm";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
import { User } from "./User"; import { User } from "./User";
@Entity({name: "notes", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "notes",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
@Unique(["owner", "target"]) @Unique(["owner", "target"])
export class Note extends BaseClass { export class Note extends BaseClass {
@JoinColumn({ name: "owner_id" }) @JoinColumn({ name: "owner_id" })

View File

@ -19,7 +19,10 @@
import { Column, Entity } from "typeorm"; import { Column, Entity } from "typeorm";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
@Entity({name: "rate_limits", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "rate_limits",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class RateLimit extends BaseClass { export class RateLimit extends BaseClass {
@Column() // no relation as it also @Column() // no relation as it also
executor_id: string; executor_id: string;

View File

@ -32,7 +32,10 @@ import { User } from "./User";
// notification cursor and public read receipt need to be forwards-only (the former to prevent re-pinging when marked as unread, and the latter to be acceptable as a legal acknowledgement in criminal proceedings), and private read marker needs to be advance-rewind capable // notification cursor and public read receipt need to be forwards-only (the former to prevent re-pinging when marked as unread, and the latter to be acceptable as a legal acknowledgement in criminal proceedings), and private read marker needs to be advance-rewind capable
// public read receipt ≥ notification cursor ≥ private fully read marker // public read receipt ≥ notification cursor ≥ private fully read marker
@Entity({name: "read_states", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "read_states",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
@Index(["channel_id", "user_id"], { unique: true }) @Index(["channel_id", "user_id"], { unique: true })
export class ReadState extends BaseClass { export class ReadState extends BaseClass {
@Column() @Column()

View File

@ -19,7 +19,10 @@
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm"; import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
@Entity({name: "recipients", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "recipients",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Recipient extends BaseClass { export class Recipient extends BaseClass {
@Column() @Column()
@RelationId((recipient: Recipient) => recipient.channel) @RelationId((recipient: Recipient) => recipient.channel)

View File

@ -34,7 +34,10 @@ export enum RelationshipType {
friends = 1, friends = 1,
} }
@Entity({name: "relationships", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "relationships",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
@Index(["from_id", "to_id"], { unique: true }) @Index(["from_id", "to_id"], { unique: true })
export class Relationship extends BaseClass { export class Relationship extends BaseClass {
@Column({}) @Column({})

View File

@ -21,7 +21,10 @@ import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild"; import { Guild } from "./Guild";
@Entity({name: "roles", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "roles",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Role extends BaseClass { export class Role extends BaseClass {
@Column() @Column()
@RelationId((role: Role) => role.guild) @RelationId((role: Role) => role.guild)

View File

@ -20,7 +20,10 @@ import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
import { User } from "./User"; import { User } from "./User";
@Entity({name: "security_keys", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "security_keys",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class SecurityKey extends BaseClass { export class SecurityKey extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
@RelationId((key: SecurityKey) => key.user) @RelationId((key: SecurityKey) => key.user)

View File

@ -24,7 +24,10 @@ import { Activity } from "../interfaces/Activity";
//TODO we need to remove all sessions on server start because if the server crashes without closing websockets it won't delete them //TODO we need to remove all sessions on server start because if the server crashes without closing websockets it won't delete them
@Entity({name: "sessions", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "sessions",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Session extends BaseClass { export class Session extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
@RelationId((session: Session) => session.user) @RelationId((session: Session) => session.user)

View File

@ -33,7 +33,10 @@ export enum StickerFormatType {
LOTTIE = 3, LOTTIE = 3,
} }
@Entity({name: "stickers", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "stickers",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Sticker extends BaseClass { export class Sticker extends BaseClass {
@Column() @Column()
name: string; name: string;

View File

@ -27,7 +27,10 @@ import {
import { Sticker } from "."; import { Sticker } from ".";
import { BaseClass } from "./BaseClass"; import { BaseClass } from "./BaseClass";
@Entity({name: "sticker_packs", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "sticker_packs",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class StickerPack extends BaseClass { export class StickerPack extends BaseClass {
@Column() @Column()
name: string; name: string;

View File

@ -28,7 +28,10 @@ import { BaseClass } from "./BaseClass";
import { TeamMember } from "./TeamMember"; import { TeamMember } from "./TeamMember";
import { User } from "./User"; import { User } from "./User";
@Entity({name: "teams", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "teams",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Team extends BaseClass { export class Team extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
icon?: string; icon?: string;

View File

@ -25,7 +25,10 @@ export enum TeamMemberState {
ACCEPTED = 2, ACCEPTED = 2,
} }
@Entity({name: "team_members", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "team_members",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class TeamMember extends BaseClass { export class TeamMember extends BaseClass {
@Column({ type: "int" }) @Column({ type: "int" })
membership_state: TeamMemberState; membership_state: TeamMemberState;

View File

@ -21,7 +21,10 @@ import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild"; import { Guild } from "./Guild";
import { User } from "./User"; import { User } from "./User";
@Entity({name: "templates", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "templates",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Template extends BaseClass { export class Template extends BaseClass {
@Column({ unique: true }) @Column({ unique: true })
code: string; code: string;

View File

@ -86,7 +86,10 @@ export interface UserPrivate extends Pick<User, PrivateUserKeys> {
locale: string; locale: string;
} }
@Entity({name: "users", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "users",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class User extends BaseClass { export class User extends BaseClass {
@Column() @Column()
username: string; // username max length 32, min 2 (should be configurable) username: string; // username max length 32, min 2 (should be configurable)

View File

@ -19,7 +19,10 @@
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm"; import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
import { BaseClassWithoutId } from "./BaseClass"; import { BaseClassWithoutId } from "./BaseClass";
@Entity({name: "user_settings", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "user_settings",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class UserSettings extends BaseClassWithoutId { export class UserSettings extends BaseClassWithoutId {
@PrimaryGeneratedColumn() @PrimaryGeneratedColumn()
index: string; index: string;

View File

@ -18,7 +18,10 @@
import { BaseEntity, Column, Entity, PrimaryColumn } from "typeorm"; import { BaseEntity, Column, Entity, PrimaryColumn } from "typeorm";
@Entity({name: "valid_registration_tokens", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "valid_registration_tokens",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class ValidRegistrationToken extends BaseEntity { export class ValidRegistrationToken extends BaseEntity {
@PrimaryColumn() @PrimaryColumn()
token: string; token: string;

View File

@ -24,7 +24,10 @@ import { Member } from "./Member";
import { User } from "./User"; import { User } from "./User";
//https://gist.github.com/vassjozsef/e482c65df6ee1facaace8b3c9ff66145#file-voice_state-ex //https://gist.github.com/vassjozsef/e482c65df6ee1facaace8b3c9ff66145#file-voice_state-ex
@Entity({name: "voice_states", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "voice_states",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class VoiceState extends BaseClass { export class VoiceState extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
@RelationId((voice_state: VoiceState) => voice_state.guild) @RelationId((voice_state: VoiceState) => voice_state.guild)

View File

@ -29,7 +29,10 @@ export enum WebhookType {
Application = 3, Application = 3,
} }
@Entity({name: "webhooks", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"}) @Entity({
name: "webhooks",
engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci",
})
export class Webhook extends BaseClass { export class Webhook extends BaseClass {
@Column({ type: "int" }) @Column({ type: "int" })
type: WebhookType; type: WebhookType;