import { t } from "@tailor-platform/sdk"; import { defineSchema } from "@tailor-platform/sdk/seed"; import { createTailorDBHook, createStandardSchema } from "@tailor-platform/sdk/test"; import { unit } from "../../src/modules-db"; const schemaType = t.object({ ...unit.pickFields(["id"], { optional: true }), ...unit.omitFields(["id"]), }); export const hook = createTailorDBHook(unit); export const schema = defineSchema( createStandardSchema(schemaType, hook, unit), { foreignKeys: [ {"column":"categoryId","references":{"table":"UoMCategory","column":"id"}}, ], indexes: [ {"name":"unit_symbol_unique_idx","columns":["symbol"],"unique":true}, ], } );