From 6b4852bf3e93e0b22e9442cd9ef6663bd66d0f2b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 27 Jun 2024 18:30:22 +0100 Subject: [PATCH] Updating migration test case. --- .../tests/20240604153647_initial_sqs.spec.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts b/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts index 86e50a5812..572e694855 100644 --- a/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts +++ b/packages/server/src/appMigrations/migrations/tests/20240604153647_initial_sqs.spec.ts @@ -15,6 +15,7 @@ import { import { processMigrations } from "../../migrationsProcessor" import migration from "../20240604153647_initial_sqs" import { AppMigration } from "src/appMigrations" +import sdk from "../../../sdk" const MIGRATIONS: AppMigration[] = [ { @@ -27,6 +28,8 @@ const MIGRATIONS: AppMigration[] = [ const config = setup.getConfig() let tableId: string +const prefix = sdk.tables.sqs.mapToUserColumn + function oldLinkDocInfo() { const tableId1 = `${DocumentType.TABLE}_a`, tableId2 = `${DocumentType.TABLE}_b` @@ -102,8 +105,14 @@ describe("SQS migration", () => { expect(designDoc.sql.tables).toBeDefined() const mainTableDef = designDoc.sql.tables[tableId] expect(mainTableDef).toBeDefined() - expect(mainTableDef.fields.name).toEqual(SQLiteType.TEXT) - expect(mainTableDef.fields.description).toEqual(SQLiteType.TEXT) + expect(mainTableDef.fields[prefix("name")]).toEqual({ + field: "name", + type: SQLiteType.TEXT, + }) + expect(mainTableDef.fields[prefix("description")]).toEqual({ + field: "description", + type: SQLiteType.TEXT, + }) const { tableId1, tableId2, rowId1, rowId2 } = oldLinkDocInfo() const linkDoc = await db.get(oldLinkDocID())