diff --git a/src/Server.ts b/src/Server.ts
index 83120412..83e16fa6 100644
--- a/src/Server.ts
+++ b/src/Server.ts
@@ -35,6 +35,7 @@ process.on("SIGTERM", () => {
//this is what has been added for the /stop API route
async function main() {
+ server.listen(port);
await getOrInitialiseDatabase();
await Config.init();
@@ -51,10 +52,7 @@ async function main() {
app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());
}
-
- server.listen(port);
await Promise.all([api.start(), cdn.start(), gateway.start()]);
-
if (Config.get().sentry.enabled) {
app.use(Sentry.Handlers.errorHandler());
app.use(function onError(err: any, req: any, res: any, next: any) {
@@ -62,7 +60,6 @@ async function main() {
res.end(res.sentry + "\n");
});
}
-
console.log(`[Server] ${green(`listening on port ${bold(port)}`)}`);
// PluginLoader.loadPlugins();
}
diff --git a/src/api/routes/applications/#id/bot/index.ts b/src/api/routes/applications/#id/bot/index.ts
index 6d054c75..82f9ad2b 100644
--- a/src/api/routes/applications/#id/bot/index.ts
+++ b/src/api/routes/applications/#id/bot/index.ts
@@ -51,7 +51,6 @@ router.post("/", route({}), async (req: Request, res: Response) => {
settings: {},
extended_settings: {},
fingerprints: [],
- notes: {}
});
await user.save();
app.bot = user;
diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts
index 1237b676..77d4c37f 100644
--- a/src/util/entities/User.ts
+++ b/src/util/entities/User.ts
@@ -178,9 +178,6 @@ export class User extends BaseClass {
@Column({ type: "simple-json", select: false })
extended_settings: string = "{}";
- @Column({ type: "simple-json" })
- notes: { [key: string]: string } = {}; //key is ID of user
-
async save(): Promise<any> {
if (!this.settings) this.settings = new UserSettings();
this.settings.id = this.id;
diff --git a/src/util/migrations/mariadb/1662626234189-notes.ts b/src/util/migrations/mariadb/1662626234189-notes.ts
new file mode 100644
index 00000000..57aaecbd
--- /dev/null
+++ b/src/util/migrations/mariadb/1662626234189-notes.ts
@@ -0,0 +1,14 @@
+import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
+
+export class notes1662626234189 implements MigrationInterface {
+ name = 'notes1662626234189'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.dropColumn("users", "notes");
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.addColumn("users", new TableColumn({ name: "notes", type: "simple-json" }));
+ }
+
+}
diff --git a/src/util/migrations/postgres/1662626234189-notes.ts b/src/util/migrations/postgres/1662626234189-notes.ts
new file mode 100644
index 00000000..57aaecbd
--- /dev/null
+++ b/src/util/migrations/postgres/1662626234189-notes.ts
@@ -0,0 +1,14 @@
+import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
+
+export class notes1662626234189 implements MigrationInterface {
+ name = 'notes1662626234189'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.dropColumn("users", "notes");
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.addColumn("users", new TableColumn({ name: "notes", type: "simple-json" }));
+ }
+
+}
diff --git a/src/util/migrations/sqlite/1662626234189-notes.ts b/src/util/migrations/sqlite/1662626234189-notes.ts
new file mode 100644
index 00000000..57aaecbd
--- /dev/null
+++ b/src/util/migrations/sqlite/1662626234189-notes.ts
@@ -0,0 +1,14 @@
+import { MigrationInterface, QueryRunner, TableColumn } from "typeorm";
+
+export class notes1662626234189 implements MigrationInterface {
+ name = 'notes1662626234189'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.dropColumn("users", "notes");
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.addColumn("users", new TableColumn({ name: "notes", type: "simple-json" }));
+ }
+
+}
|