From 0c8bfe72af6d6987d9b66884ecdca29e8d7119b9 Mon Sep 17 00:00:00 2001 From: Toni Sharpe Date: Wed, 3 Jul 2024 22:37:13 +0200 Subject: [PATCH 1/4] fix 3169 remove with migration * not a direct edit. --- .../1720038601815-RemoveEntitiesDisplayName.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 db/migration/1720038601815-RemoveEntitiesDisplayName.ts diff --git a/db/migration/1720038601815-RemoveEntitiesDisplayName.ts b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts new file mode 100644 index 00000000000..d4e2dd38db0 --- /dev/null +++ b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts @@ -0,0 +1,12 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class RemoveEntitiesDisplayName1720038601815 implements MigrationInterface { + + public async up(queryRunner: QueryRunner): Promise { + "ALTER TABLE entites DROP COLUMN displayName" + } + + public async down(queryRunner: QueryRunner): Promise { + "ALTER TABLE entites ADD COLUMN displayName" + } +} From 8ae14c8745506daab5b06f70755d567f958eb0be Mon Sep 17 00:00:00 2001 From: Toni Sharpe Date: Thu, 4 Jul 2024 02:30:15 +0200 Subject: [PATCH 2/4] fix 3169 get the syntax right --- .../1720038601815-RemoveEntitiesDisplayName.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/db/migration/1720038601815-RemoveEntitiesDisplayName.ts b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts index d4e2dd38db0..8dd56c0ed02 100644 --- a/db/migration/1720038601815-RemoveEntitiesDisplayName.ts +++ b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts @@ -3,10 +3,18 @@ import { MigrationInterface, QueryRunner } from "typeorm"; export class RemoveEntitiesDisplayName1720038601815 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { - "ALTER TABLE entites DROP COLUMN displayName" + await queryRunner.query(` + ALTER TABLE entities + DROP COLUMN + displayName` + ) } public async down(queryRunner: QueryRunner): Promise { - "ALTER TABLE entites ADD COLUMN displayName" + await queryRunner.query(` + ALTER TABLE entities + ADD COLUMN + displayName` + ) } } From 5811acc362ba218ca9fd62fb7846f2661254cb7b Mon Sep 17 00:00:00 2001 From: Lars Yencken Date: Wed, 10 Jul 2024 09:12:39 +0100 Subject: [PATCH 3/4] :hammer: Fix down-migration by adding types --- db/migration/1720038601815-RemoveEntitiesDisplayName.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migration/1720038601815-RemoveEntitiesDisplayName.ts b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts index 8dd56c0ed02..bc120ccfa08 100644 --- a/db/migration/1720038601815-RemoveEntitiesDisplayName.ts +++ b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts @@ -14,7 +14,7 @@ export class RemoveEntitiesDisplayName1720038601815 implements MigrationInterfac await queryRunner.query(` ALTER TABLE entities ADD COLUMN - displayName` + displayName varchar(255) COLLATE utf8mb4_0900_as_cs NOT NULL` ) } } From 2e1c7c64c9c8eaa205ac180a499553daef77840a Mon Sep 17 00:00:00 2001 From: Lars Yencken Date: Wed, 10 Jul 2024 09:14:34 +0100 Subject: [PATCH 4/4] :lipstick: Autoformat with "make format" --- .../1720038601815-RemoveEntitiesDisplayName.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/db/migration/1720038601815-RemoveEntitiesDisplayName.ts b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts index bc120ccfa08..ecdda7b6b65 100644 --- a/db/migration/1720038601815-RemoveEntitiesDisplayName.ts +++ b/db/migration/1720038601815-RemoveEntitiesDisplayName.ts @@ -1,20 +1,19 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class RemoveEntitiesDisplayName1720038601815 implements MigrationInterface { +import { MigrationInterface, QueryRunner } from "typeorm" +export class RemoveEntitiesDisplayName1720038601815 + implements MigrationInterface +{ public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE entities - DROP COLUMN - displayName` - ) + DROP COLUMN displayName + `) } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE entities - ADD COLUMN - displayName varchar(255) COLLATE utf8mb4_0900_as_cs NOT NULL` - ) + ADD COLUMN displayName varchar(255) COLLATE utf8mb4_0900_as_cs NOT NULL + `) } }