diff --git a/src/util/entities/Application.ts b/src/util/entities/Application.ts
index 962b2a8e..1ecd4475 100644
--- a/src/util/entities/Application.ts
+++ b/src/util/entities/Application.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -21,7 +21,7 @@ import { BaseClass } from "./BaseClass";
import { Team } from "./Team";
import { User } from "./User";
-@Entity("applications")
+@Entity({name: "applications", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Application extends BaseClass {
@Column()
name: string;
diff --git a/src/util/entities/Attachment.ts b/src/util/entities/Attachment.ts
index d60ac41c..68d8aa54 100644
--- a/src/util/entities/Attachment.ts
+++ b/src/util/entities/Attachment.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -28,7 +28,7 @@ import { URL } from "url";
import { deleteFile } from "../util/cdn";
import { BaseClass } from "./BaseClass";
-@Entity("attachments")
+@Entity({name: "attachments", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Attachment extends BaseClass {
@Column()
filename: string; // name of file attached
diff --git a/src/util/entities/AuditLog.ts b/src/util/entities/AuditLog.ts
index b375f771..6ac2802b 100644
--- a/src/util/entities/AuditLog.ts
+++ b/src/util/entities/AuditLog.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -111,7 +111,7 @@ export enum AuditLogEvents {
ROUTE_UPDATE = 226,
}
-@Entity("audit_logs")
+@Entity({name: "audit_logs", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class AuditLog extends BaseClass {
@JoinColumn({ name: "target_id" })
@ManyToOne(() => User)
diff --git a/src/util/entities/BackupCodes.ts b/src/util/entities/BackupCodes.ts
index 61e8f12a..638bcd04 100644
--- a/src/util/entities/BackupCodes.ts
+++ b/src/util/entities/BackupCodes.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -21,7 +21,7 @@ import { BaseClass } from "./BaseClass";
import { User } from "./User";
import crypto from "crypto";
-@Entity("backup_codes")
+@Entity({name: "backup_codes", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class BackupCode extends BaseClass {
@JoinColumn({ name: "user_id" })
@ManyToOne(() => User, { onDelete: "CASCADE" })
diff --git a/src/util/entities/Badge.ts b/src/util/entities/Badge.ts
index 9535e207..d403c655 100644
--- a/src/util/entities/Badge.ts
+++ b/src/util/entities/Badge.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity } from "typeorm";
import { BaseClassWithoutId } from "./BaseClass";
-@Entity("badges")
+@Entity({name: "badges", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Badge extends BaseClassWithoutId {
@Column({ primary: true })
id: string;
diff --git a/src/util/entities/Ban.ts b/src/util/entities/Ban.ts
index 1693cd40..2535f3e3 100644
--- a/src/util/entities/Ban.ts
+++ b/src/util/entities/Ban.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -21,7 +21,7 @@ import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild";
import { User } from "./User";
-@Entity("bans")
+@Entity({name: "bans", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Ban extends BaseClass {
@Column({ nullable: true })
@RelationId((ban: Ban) => ban.user)
diff --git a/src/util/entities/Categories.ts b/src/util/entities/Categories.ts
index 13d969de..d3eada5a 100644
--- a/src/util/entities/Categories.ts
+++ b/src/util/entities/Categories.ts
@@ -33,7 +33,7 @@ import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
// }]
// Also populate discord default categories
-@Entity("categories")
+@Entity({name: "categories", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Categories extends BaseClassWithoutId {
// Not using snowflake
diff --git a/src/util/entities/Channel.ts b/src/util/entities/Channel.ts
index 71ccf49e..e3856e8d 100644
--- a/src/util/entities/Channel.ts
+++ b/src/util/entities/Channel.ts
@@ -69,7 +69,7 @@ export enum ChannelType {
UNHANDLED = 255, // unhandled unowned pass-through channel type
}
-@Entity("channels")
+@Entity({name: "channels", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Channel extends BaseClass {
@Column()
created_at: Date;
diff --git a/src/util/entities/ClientRelease.ts b/src/util/entities/ClientRelease.ts
index cfbc3a9b..2282b1ff 100644
--- a/src/util/entities/ClientRelease.ts
+++ b/src/util/entities/ClientRelease.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity } from "typeorm";
import { BaseClass } from "./BaseClass";
-@Entity("client_release")
+@Entity({name: "client_release", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Release extends BaseClass {
@Column()
name: string;
diff --git a/src/util/entities/Config.ts b/src/util/entities/Config.ts
index 3c436ff0..efe8c563 100644
--- a/src/util/entities/Config.ts
+++ b/src/util/entities/Config.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity } from "typeorm";
import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
-@Entity("config")
+@Entity({name: "config", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class ConfigEntity extends BaseClassWithoutId {
@PrimaryIdColumn()
key: string;
diff --git a/src/util/entities/ConnectedAccount.ts b/src/util/entities/ConnectedAccount.ts
index 6e089de1..78dec432 100644
--- a/src/util/entities/ConnectedAccount.ts
+++ b/src/util/entities/ConnectedAccount.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -26,7 +26,7 @@ export type PublicConnectedAccount = Pick<
"name" | "type" | "verified"
>;
-@Entity("connected_accounts")
+@Entity({name: "connected_accounts", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class ConnectedAccount extends BaseClass {
@Column()
external_id: string;
diff --git a/src/util/entities/ConnectionConfigEntity.ts b/src/util/entities/ConnectionConfigEntity.ts
index e4b7cea8..0c367c1c 100644
--- a/src/util/entities/ConnectionConfigEntity.ts
+++ b/src/util/entities/ConnectionConfigEntity.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity } from "typeorm";
import { BaseClassWithoutId, PrimaryIdColumn } from "./BaseClass";
-@Entity("connection_config")
+@Entity({name: "connection_config", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class ConnectionConfigEntity extends BaseClassWithoutId {
@PrimaryIdColumn()
key: string;
diff --git a/src/util/entities/EmbedCache.ts b/src/util/entities/EmbedCache.ts
index 8ff2a457..f2dcd893 100644
--- a/src/util/entities/EmbedCache.ts
+++ b/src/util/entities/EmbedCache.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -20,7 +20,7 @@ import { BaseClass } from "./BaseClass";
import { Entity, Column } from "typeorm";
import { Embed } from "./Message";
-@Entity("embed_cache")
+@Entity({name: "embed_cache", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class EmbedCache extends BaseClass {
@Column()
url: string;
diff --git a/src/util/entities/Emoji.ts b/src/util/entities/Emoji.ts
index 4d851698..65d54d5e 100644
--- a/src/util/entities/Emoji.ts
+++ b/src/util/entities/Emoji.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -21,7 +21,7 @@ import { User } from ".";
import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild";
-@Entity("emojis")
+@Entity({name: "emojis", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Emoji extends BaseClass {
@Column()
animated: boolean;
diff --git a/src/util/entities/Encryption.ts b/src/util/entities/Encryption.ts
index 8325bdee..97f9052c 100644
--- a/src/util/entities/Encryption.ts
+++ b/src/util/entities/Encryption.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity } from "typeorm";
import { BaseClass } from "./BaseClass";
-@Entity("security_settings")
+@Entity({name: "security_settings", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class SecuritySettings extends BaseClass {
@Column({ nullable: true })
guild_id: string;
diff --git a/src/util/entities/Guild.ts b/src/util/entities/Guild.ts
index fcd6b729..7a918220 100644
--- a/src/util/entities/Guild.ts
+++ b/src/util/entities/Guild.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -66,7 +66,7 @@ export const PublicGuildRelations = [
// "members.user",
];
-@Entity("guilds")
+@Entity({name: "guilds", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Guild extends BaseClass {
@Column({ nullable: true })
@RelationId((guild: Guild) => guild.afk_channel)
diff --git a/src/util/entities/Invite.ts b/src/util/entities/Invite.ts
index f7e54fbe..a7b17a8a 100644
--- a/src/util/entities/Invite.ts
+++ b/src/util/entities/Invite.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -25,7 +25,7 @@ import { User } from "./User";
export const PublicInviteRelation = ["inviter", "guild", "channel"];
-@Entity("invites")
+@Entity({name: "invites", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Invite extends BaseClassWithoutId {
@PrimaryIdColumn()
code: string;
diff --git a/src/util/entities/Member.ts b/src/util/entities/Member.ts
index 3ef778ac..f43d5a92 100644
--- a/src/util/entities/Member.ts
+++ b/src/util/entities/Member.ts
@@ -65,7 +65,7 @@ export const MemberPrivateProjection: (keyof Member)[] = [
"user",
];
-@Entity("members")
+@Entity({name: "members", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
@Index(["id", "guild_id"], { unique: true })
export class Member extends BaseClassWithoutId {
@PrimaryGeneratedColumn()
diff --git a/src/util/entities/Message.ts b/src/util/entities/Message.ts
index 1dd89dc1..f340bbc0 100644
--- a/src/util/entities/Message.ts
+++ b/src/util/entities/Message.ts
@@ -68,7 +68,7 @@ export enum MessageType {
UNHANDLED = 255,
}
-@Entity("messages")
+@Entity({name: "messages", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
@Index(["channel_id", "id"], { unique: true })
export class Message extends BaseClass {
@Column({ nullable: true })
diff --git a/src/util/entities/Migration.ts b/src/util/entities/Migration.ts
index 5c4e951d..742e3621 100644
--- a/src/util/entities/Migration.ts
+++ b/src/util/entities/Migration.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -30,7 +30,7 @@ export const PrimaryIdAutoGenerated = process.env.DATABASE?.startsWith(
? ObjectIdColumn
: PrimaryGeneratedColumn;
-@Entity("migrations")
+@Entity({name: "migrations", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Migration extends BaseEntity {
@PrimaryIdAutoGenerated()
id: number;
diff --git a/src/util/entities/Note.ts b/src/util/entities/Note.ts
index 196f6861..d220367f 100644
--- a/src/util/entities/Note.ts
+++ b/src/util/entities/Note.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -20,7 +20,7 @@ import { Column, Entity, JoinColumn, ManyToOne, Unique } from "typeorm";
import { BaseClass } from "./BaseClass";
import { User } from "./User";
-@Entity("notes")
+@Entity({name: "notes", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
@Unique(["owner", "target"])
export class Note extends BaseClass {
@JoinColumn({ name: "owner_id" })
diff --git a/src/util/entities/RateLimit.ts b/src/util/entities/RateLimit.ts
index 8d00f59a..836a8af5 100644
--- a/src/util/entities/RateLimit.ts
+++ b/src/util/entities/RateLimit.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity } from "typeorm";
import { BaseClass } from "./BaseClass";
-@Entity("rate_limits")
+@Entity({name: "rate_limits", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class RateLimit extends BaseClass {
@Column() // no relation as it also
executor_id: string;
diff --git a/src/util/entities/ReadState.ts b/src/util/entities/ReadState.ts
index 1b280d12..7d367ecc 100644
--- a/src/util/entities/ReadState.ts
+++ b/src/util/entities/ReadState.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -32,7 +32,7 @@ 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
// public read receipt ≥ notification cursor ≥ private fully read marker
-@Entity("read_states")
+@Entity({name: "read_states", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
@Index(["channel_id", "user_id"], { unique: true })
export class ReadState extends BaseClass {
@Column()
diff --git a/src/util/entities/Recipient.ts b/src/util/entities/Recipient.ts
index 797349e5..5e2cd800 100644
--- a/src/util/entities/Recipient.ts
+++ b/src/util/entities/Recipient.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass";
-@Entity("recipients")
+@Entity({name: "recipients", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Recipient extends BaseClass {
@Column()
@RelationId((recipient: Recipient) => recipient.channel)
diff --git a/src/util/entities/Relationship.ts b/src/util/entities/Relationship.ts
index 740095c2..6472aaa1 100644
--- a/src/util/entities/Relationship.ts
+++ b/src/util/entities/Relationship.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -34,7 +34,7 @@ export enum RelationshipType {
friends = 1,
}
-@Entity("relationships")
+@Entity({name: "relationships", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
@Index(["from_id", "to_id"], { unique: true })
export class Relationship extends BaseClass {
@Column({})
diff --git a/src/util/entities/Role.ts b/src/util/entities/Role.ts
index 2783a279..8a752047 100644
--- a/src/util/entities/Role.ts
+++ b/src/util/entities/Role.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -21,7 +21,7 @@ import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild";
-@Entity("roles")
+@Entity({name: "roles", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Role extends BaseClass {
@Column()
@RelationId((role: Role) => role.guild)
diff --git a/src/util/entities/SecurityKey.ts b/src/util/entities/SecurityKey.ts
index fd7a4c5e..652bbb39 100644
--- a/src/util/entities/SecurityKey.ts
+++ b/src/util/entities/SecurityKey.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -20,7 +20,7 @@ import { Column, Entity, JoinColumn, ManyToOne, RelationId } from "typeorm";
import { BaseClass } from "./BaseClass";
import { User } from "./User";
-@Entity("security_keys")
+@Entity({name: "security_keys", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class SecurityKey extends BaseClass {
@Column({ nullable: true })
@RelationId((key: SecurityKey) => key.user)
diff --git a/src/util/entities/Session.ts b/src/util/entities/Session.ts
index 15f8faa2..1fbdd2bb 100644
--- a/src/util/entities/Session.ts
+++ b/src/util/entities/Session.ts
@@ -24,7 +24,7 @@ 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
-@Entity("sessions")
+@Entity({name: "sessions", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Session extends BaseClass {
@Column({ nullable: true })
@RelationId((session: Session) => session.user)
diff --git a/src/util/entities/Sticker.ts b/src/util/entities/Sticker.ts
index e9294f92..95eeb32a 100644
--- a/src/util/entities/Sticker.ts
+++ b/src/util/entities/Sticker.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -33,7 +33,7 @@ export enum StickerFormatType {
LOTTIE = 3,
}
-@Entity("stickers")
+@Entity({name: "stickers", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Sticker extends BaseClass {
@Column()
name: string;
diff --git a/src/util/entities/StickerPack.ts b/src/util/entities/StickerPack.ts
index 61ab1287..257fb6e4 100644
--- a/src/util/entities/StickerPack.ts
+++ b/src/util/entities/StickerPack.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -27,7 +27,7 @@ import {
import { Sticker } from ".";
import { BaseClass } from "./BaseClass";
-@Entity("sticker_packs")
+@Entity({name: "sticker_packs", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class StickerPack extends BaseClass {
@Column()
name: string;
diff --git a/src/util/entities/Team.ts b/src/util/entities/Team.ts
index 7bedc4af..e98344c8 100644
--- a/src/util/entities/Team.ts
+++ b/src/util/entities/Team.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -28,7 +28,7 @@ import { BaseClass } from "./BaseClass";
import { TeamMember } from "./TeamMember";
import { User } from "./User";
-@Entity("teams")
+@Entity({name: "teams", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Team extends BaseClass {
@Column({ nullable: true })
icon?: string;
diff --git a/src/util/entities/TeamMember.ts b/src/util/entities/TeamMember.ts
index 539da957..54c90a5a 100644
--- a/src/util/entities/TeamMember.ts
+++ b/src/util/entities/TeamMember.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -25,7 +25,7 @@ export enum TeamMemberState {
ACCEPTED = 2,
}
-@Entity("team_members")
+@Entity({name: "team_members", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class TeamMember extends BaseClass {
@Column({ type: "int" })
membership_state: TeamMemberState;
diff --git a/src/util/entities/Template.ts b/src/util/entities/Template.ts
index c417f1f0..4cf98651 100644
--- a/src/util/entities/Template.ts
+++ b/src/util/entities/Template.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -21,7 +21,7 @@ import { BaseClass } from "./BaseClass";
import { Guild } from "./Guild";
import { User } from "./User";
-@Entity("templates")
+@Entity({name: "templates", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Template extends BaseClass {
@Column({ unique: true })
code: string;
diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts
index b299bcfc..e2290d0b 100644
--- a/src/util/entities/User.ts
+++ b/src/util/entities/User.ts
@@ -86,7 +86,7 @@ export interface UserPrivate extends Pick {
locale: string;
}
-@Entity("users")
+@Entity({name: "users", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class User extends BaseClass {
@Column()
username: string; // username max length 32, min 2 (should be configurable)
diff --git a/src/util/entities/UserSettings.ts b/src/util/entities/UserSettings.ts
index d3efe79b..0df2ff86 100644
--- a/src/util/entities/UserSettings.ts
+++ b/src/util/entities/UserSettings.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -19,7 +19,7 @@
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";
import { BaseClassWithoutId } from "./BaseClass";
-@Entity("user_settings")
+@Entity({name: "user_settings", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class UserSettings extends BaseClassWithoutId {
@PrimaryGeneratedColumn()
index: string;
diff --git a/src/util/entities/ValidRegistrationTokens.ts b/src/util/entities/ValidRegistrationTokens.ts
index 94fd1542..77da100a 100644
--- a/src/util/entities/ValidRegistrationTokens.ts
+++ b/src/util/entities/ValidRegistrationTokens.ts
@@ -1,24 +1,24 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
import { BaseEntity, Column, Entity, PrimaryColumn } from "typeorm";
-@Entity("valid_registration_tokens")
+@Entity({name: "valid_registration_tokens", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class ValidRegistrationToken extends BaseEntity {
@PrimaryColumn()
token: string;
diff --git a/src/util/entities/VoiceState.ts b/src/util/entities/VoiceState.ts
index 84b0ca71..3678fa1a 100644
--- a/src/util/entities/VoiceState.ts
+++ b/src/util/entities/VoiceState.ts
@@ -1,17 +1,17 @@
/*
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
Copyright (C) 2023 Spacebar and Spacebar Contributors
-
+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
-
+
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
@@ -24,7 +24,7 @@ import { Member } from "./Member";
import { User } from "./User";
//https://gist.github.com/vassjozsef/e482c65df6ee1facaace8b3c9ff66145#file-voice_state-ex
-@Entity("voice_states")
+@Entity({name: "voice_states", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class VoiceState extends BaseClass {
@Column({ nullable: true })
@RelationId((voice_state: VoiceState) => voice_state.guild)
diff --git a/src/util/entities/Webhook.ts b/src/util/entities/Webhook.ts
index 9539d6e8..5d50333e 100644
--- a/src/util/entities/Webhook.ts
+++ b/src/util/entities/Webhook.ts
@@ -29,7 +29,7 @@ export enum WebhookType {
Application = 3,
}
-@Entity("webhooks")
+@Entity({name: "webhooks", engine: "InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci"})
export class Webhook extends BaseClass {
@Column({ type: "int" })
type: WebhookType;