summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-08 21:18:44 +1000
committerGitHub <noreply@github.com>2022-09-08 21:18:44 +1000
commit70e7b2b77a023e5e6cd9f23a1e00f5dd052a4322 (patch)
treeaa351fe6320262e770ef786bdafbe10f217042d8 /src/util
parentMerge pull request #881 from fosscord/fix/notes_pr_broke_somehow (diff)
parentremove notes table from bot (diff)
downloadserver-70e7b2b77a023e5e6cd9f23a1e00f5dd052a4322.tar.xz
Merge pull request #886 from fosscord/dev/Maddy/fix/notes_migration
Migrations for #881
Diffstat (limited to 'src/util')
-rw-r--r--src/util/migrations/mariadb/1662626234189-notes.ts14
-rw-r--r--src/util/migrations/postgres/1662626234189-notes.ts14
-rw-r--r--src/util/migrations/sqlite/1662626234189-notes.ts14
3 files changed, 42 insertions, 0 deletions
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" }));
+    }
+
+}