Updating migration test case.
This commit is contained in:
parent
3394e974d3
commit
6b4852bf3e
|
@ -15,6 +15,7 @@ import {
|
||||||
import { processMigrations } from "../../migrationsProcessor"
|
import { processMigrations } from "../../migrationsProcessor"
|
||||||
import migration from "../20240604153647_initial_sqs"
|
import migration from "../20240604153647_initial_sqs"
|
||||||
import { AppMigration } from "src/appMigrations"
|
import { AppMigration } from "src/appMigrations"
|
||||||
|
import sdk from "../../../sdk"
|
||||||
|
|
||||||
const MIGRATIONS: AppMigration[] = [
|
const MIGRATIONS: AppMigration[] = [
|
||||||
{
|
{
|
||||||
|
@ -27,6 +28,8 @@ const MIGRATIONS: AppMigration[] = [
|
||||||
const config = setup.getConfig()
|
const config = setup.getConfig()
|
||||||
let tableId: string
|
let tableId: string
|
||||||
|
|
||||||
|
const prefix = sdk.tables.sqs.mapToUserColumn
|
||||||
|
|
||||||
function oldLinkDocInfo() {
|
function oldLinkDocInfo() {
|
||||||
const tableId1 = `${DocumentType.TABLE}_a`,
|
const tableId1 = `${DocumentType.TABLE}_a`,
|
||||||
tableId2 = `${DocumentType.TABLE}_b`
|
tableId2 = `${DocumentType.TABLE}_b`
|
||||||
|
@ -102,8 +105,14 @@ describe("SQS migration", () => {
|
||||||
expect(designDoc.sql.tables).toBeDefined()
|
expect(designDoc.sql.tables).toBeDefined()
|
||||||
const mainTableDef = designDoc.sql.tables[tableId]
|
const mainTableDef = designDoc.sql.tables[tableId]
|
||||||
expect(mainTableDef).toBeDefined()
|
expect(mainTableDef).toBeDefined()
|
||||||
expect(mainTableDef.fields.name).toEqual(SQLiteType.TEXT)
|
expect(mainTableDef.fields[prefix("name")]).toEqual({
|
||||||
expect(mainTableDef.fields.description).toEqual(SQLiteType.TEXT)
|
field: "name",
|
||||||
|
type: SQLiteType.TEXT,
|
||||||
|
})
|
||||||
|
expect(mainTableDef.fields[prefix("description")]).toEqual({
|
||||||
|
field: "description",
|
||||||
|
type: SQLiteType.TEXT,
|
||||||
|
})
|
||||||
|
|
||||||
const { tableId1, tableId2, rowId1, rowId2 } = oldLinkDocInfo()
|
const { tableId1, tableId2, rowId1, rowId2 } = oldLinkDocInfo()
|
||||||
const linkDoc = await db.get<LinkDocument>(oldLinkDocID())
|
const linkDoc = await db.get<LinkDocument>(oldLinkDocID())
|
||||||
|
|
Loading…
Reference in New Issue