Pārlūkot izejas kodu

fix(syncing-server): update unknown content type on items migration

Karol Sójko 1 gadu atpakaļ
vecāks
revīzija
6aad7cd207

+ 11 - 0
packages/syncing-server/migrations/mysql/1690975361562-update_unknown_content.ts

@@ -0,0 +1,11 @@
+import { MigrationInterface, QueryRunner } from 'typeorm'
+
+export class UpdateUnknownContent1690975361562 implements MigrationInterface {
+  public async up(queryRunner: QueryRunner): Promise<void> {
+    await queryRunner.manager.query('UPDATE items SET content_type = "Note" WHERE content_type = "Unknown"')
+  }
+
+  public async down(): Promise<void> {
+    return
+  }
+}

+ 11 - 0
packages/syncing-server/migrations/sqlite/1690975207883-update_unknown_content.ts

@@ -0,0 +1,11 @@
+import { MigrationInterface, QueryRunner } from 'typeorm'
+
+export class UpdateUnknownContent1690975207883 implements MigrationInterface {
+  public async up(queryRunner: QueryRunner): Promise<void> {
+    await queryRunner.manager.query('UPDATE items SET content_type = "Note" WHERE content_type = "Unknown"')
+  }
+
+  public async down(): Promise<void> {
+    return
+  }
+}