diff options
Diffstat (limited to 'util/src/migrations')
-rw-r--r-- | util/src/migrations/1633864260873-EmojiRoles.ts | 13 | ||||
-rw-r--r-- | util/src/migrations/1633864669243-EmojiUser.ts | 23 | ||||
-rw-r--r-- | util/src/migrations/1633881705509-VanityInvite.ts | 19 | ||||
-rw-r--r-- | util/src/migrations/1634308884591-Stickers.ts | 66 | ||||
-rw-r--r-- | util/src/migrations/1634424361103-Presence.ts | 11 | ||||
-rw-r--r-- | util/src/migrations/1634426540271-MigrationTimestamp.ts | 15 | ||||
-rw-r--r-- | util/src/migrations/1648643945733-ReleaseTypo.ts | 16 |
7 files changed, 0 insertions, 163 deletions
diff --git a/util/src/migrations/1633864260873-EmojiRoles.ts b/util/src/migrations/1633864260873-EmojiRoles.ts deleted file mode 100644 index f0d709f2..00000000 --- a/util/src/migrations/1633864260873-EmojiRoles.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class EmojiRoles1633864260873 implements MigrationInterface { - name = "EmojiRoles1633864260873"; - - public async up(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(`ALTER TABLE "emojis" ADD "roles" text NOT NULL DEFAULT ''`); - } - - public async down(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(`ALTER TABLE "emojis" DROP COLUMN column_name "roles"`); - } -} diff --git a/util/src/migrations/1633864669243-EmojiUser.ts b/util/src/migrations/1633864669243-EmojiUser.ts deleted file mode 100644 index 982405d7..00000000 --- a/util/src/migrations/1633864669243-EmojiUser.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class EmojiUser1633864669243 implements MigrationInterface { - name = "EmojiUser1633864669243"; - - public async up(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(`ALTER TABLE "emojis" ADD "user_id" varchar`); - try { - await queryRunner.query( - `ALTER TABLE "emojis" ADD CONSTRAINT FK_fa7ddd5f9a214e28ce596548421 FOREIGN KEY (user_id) REFERENCES users(id)` - ); - } catch (error) { - console.error( - "sqlite doesn't support altering foreign keys: https://stackoverflow.com/questions/1884818/how-do-i-add-a-foreign-key-to-an-existing-sqlite-table" - ); - } - } - - public async down(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(`ALTER TABLE "emojis" DROP COLUMN column_name "user_id"`); - await queryRunner.query(`ALTER TABLE "emojis" DROP CONSTRAINT FK_fa7ddd5f9a214e28ce596548421`); - } -} diff --git a/util/src/migrations/1633881705509-VanityInvite.ts b/util/src/migrations/1633881705509-VanityInvite.ts deleted file mode 100644 index 45485310..00000000 --- a/util/src/migrations/1633881705509-VanityInvite.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class VanityInvite1633881705509 implements MigrationInterface { - name = "VanityInvite1633881705509"; - - public async up(queryRunner: QueryRunner): Promise<void> { - try { - await queryRunner.query(`ALTER TABLE "emojis" DROP COLUMN vanity_url_code`); - await queryRunner.query(`ALTER TABLE "emojis" DROP CONSTRAINT FK_c2c1809d79eb120ea0cb8d342ad`); - } catch (error) {} - } - - public async down(queryRunner: QueryRunner): Promise<void> { - await queryRunner.query(`ALTER TABLE "emojis" ADD vanity_url_code varchar`); - await queryRunner.query( - `ALTER TABLE "emojis" ADD CONSTRAINT FK_c2c1809d79eb120ea0cb8d342ad FOREIGN KEY ("vanity_url_code") REFERENCES "invites"("code") ON DELETE NO ACTION ON UPDATE NO ACTION` - ); - } -} diff --git a/util/src/migrations/1634308884591-Stickers.ts b/util/src/migrations/1634308884591-Stickers.ts deleted file mode 100644 index fbc4649f..00000000 --- a/util/src/migrations/1634308884591-Stickers.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { MigrationInterface, QueryRunner, Table, TableColumn, TableForeignKey } from "typeorm"; - -export class Stickers1634308884591 implements MigrationInterface { - name = "Stickers1634308884591"; - - public async up(queryRunner: QueryRunner): Promise<void> { - await queryRunner.dropForeignKey("read_states", "FK_6f255d873cfbfd7a93849b7ff74"); - await queryRunner.changeColumn( - "stickers", - "tags", - new TableColumn({ name: "tags", type: "varchar", isNullable: true }) - ); - await queryRunner.changeColumn( - "stickers", - "pack_id", - new TableColumn({ name: "pack_id", type: "varchar", isNullable: true }) - ); - await queryRunner.changeColumn("stickers", "type", new TableColumn({ name: "type", type: "integer" })); - await queryRunner.changeColumn( - "stickers", - "format_type", - new TableColumn({ name: "format_type", type: "integer" }) - ); - await queryRunner.changeColumn( - "stickers", - "available", - new TableColumn({ name: "available", type: "boolean", isNullable: true }) - ); - await queryRunner.changeColumn( - "stickers", - "user_id", - new TableColumn({ name: "user_id", type: "boolean", isNullable: true }) - ); - await queryRunner.createForeignKey( - "stickers", - new TableForeignKey({ - name: "FK_8f4ee73f2bb2325ff980502e158", - columnNames: ["user_id"], - referencedColumnNames: ["id"], - referencedTableName: "users", - onDelete: "CASCADE", - }) - ); - await queryRunner.createTable( - new Table({ - name: "sticker_packs", - columns: [ - new TableColumn({ name: "id", type: "varchar", isPrimary: true }), - new TableColumn({ name: "name", type: "varchar" }), - new TableColumn({ name: "description", type: "varchar", isNullable: true }), - new TableColumn({ name: "banner_asset_id", type: "varchar", isNullable: true }), - new TableColumn({ name: "cover_sticker_id", type: "varchar", isNullable: true }), - ], - foreignKeys: [ - new TableForeignKey({ - columnNames: ["cover_sticker_id"], - referencedColumnNames: ["id"], - referencedTableName: "stickers", - }), - ], - }) - ); - } - - public async down(queryRunner: QueryRunner): Promise<void> {} -} diff --git a/util/src/migrations/1634424361103-Presence.ts b/util/src/migrations/1634424361103-Presence.ts deleted file mode 100644 index 729955b8..00000000 --- a/util/src/migrations/1634424361103-Presence.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; - -export class Presence1634424361103 implements MigrationInterface { - name = "Presence1634424361103"; - - public async up(queryRunner: QueryRunner): Promise<void> { - queryRunner.addColumn("sessions", new TableColumn({ name: "activites", type: "text" })); - } - - public async down(queryRunner: QueryRunner): Promise<void> {} -} diff --git a/util/src/migrations/1634426540271-MigrationTimestamp.ts b/util/src/migrations/1634426540271-MigrationTimestamp.ts deleted file mode 100644 index 3208b25b..00000000 --- a/util/src/migrations/1634426540271-MigrationTimestamp.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { MigrationInterface, QueryRunner, TableColumn } from "typeorm"; - -export class MigrationTimestamp1634426540271 implements MigrationInterface { - name = "MigrationTimestamp1634426540271"; - - public async up(queryRunner: QueryRunner): Promise<void> { - await queryRunner.changeColumn( - "migrations", - "timestamp", - new TableColumn({ name: "timestampe", type: "bigint", isNullable: false }) - ); - } - - public async down(queryRunner: QueryRunner): Promise<void> {} -} diff --git a/util/src/migrations/1648643945733-ReleaseTypo.ts b/util/src/migrations/1648643945733-ReleaseTypo.ts deleted file mode 100644 index 944b9dd9..00000000 --- a/util/src/migrations/1648643945733-ReleaseTypo.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class ReleaseTypo1648643945733 implements MigrationInterface { - name = "ReleaseTypo1648643945733"; - - public async up(queryRunner: QueryRunner): Promise<void> { - //drop table first because typeorm creates it before migrations run - await queryRunner.dropTable("client_release", true); - await queryRunner.renameTable("client_relase", "client_release"); - } - - public async down(queryRunner: QueryRunner): Promise<void> { - await queryRunner.dropTable("client_relase", true); - await queryRunner.renameTable("client_release", "client_relase"); - } -} |