Kaizen
Browse modulesBookingsbookings/serverInterfaces

Interface: ForeignKeyOption

Defined in: server/persistence/migrations.ts:18

Describes a set of foreign key constraints between columns in a taproot feature's tables and a table in the consumer's schema. Consumed by migrateTables so callers don't need a hand-written follow-up migration to attach referential integrity.

Properties

columns

columns: Record<string, string[]>;

Defined in: server/persistence/migrations.ts:39

Map of taproot table name → names of columns on that table that should reference this external table.


columnType

columnType: string;

Defined in: server/persistence/migrations.ts:29

PostgreSQL type to alter the taproot columns to before creating the FK (e.g. "UUID", "TEXT", "BIGINT"). Must be castable from the column's current type — if the columns already contain data, the values must cast cleanly.


onDelete

onDelete: ForeignKeyOnDelete;

Defined in: server/persistence/migrations.ts:34

ON DELETE behavior for the constraint. NOT NULL taproot columns require "CASCADE" or "RESTRICT" — "SET NULL" will fail on those columns.


referencedColumn

referencedColumn: string;

Defined in: server/persistence/migrations.ts:22

Column on the referenced table (e.g. "id").


schema

schema: string;

Defined in: server/persistence/migrations.ts:20

Schema of the referenced table (e.g. "public").

On this page