@prisma-next/target-postgres 0.12.0-dev.62 → 0.12.0-dev.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract-free.d.mts +7 -2
- package/dist/contract-free.d.mts.map +1 -1
- package/dist/contract-free.mjs +2 -24
- package/dist/contract-free.mjs.map +1 -1
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +5 -5
- package/dist/control.mjs.map +1 -1
- package/dist/ddl-77SyXgFt.mjs +30 -0
- package/dist/ddl-77SyXgFt.mjs.map +1 -0
- package/dist/ddl.d.mts +1 -1
- package/dist/ddl.mjs +1 -1
- package/dist/{issue-planner-hxJaxYHv.mjs → issue-planner-Wd6zcYtT.mjs} +15 -5
- package/dist/issue-planner-Wd6zcYtT.mjs.map +1 -0
- package/dist/issue-planner.d.mts +1 -1
- package/dist/issue-planner.d.mts.map +1 -1
- package/dist/issue-planner.mjs +1 -1
- package/dist/migration.d.mts +4 -7
- package/dist/migration.d.mts.map +1 -1
- package/dist/migration.mjs +4 -3
- package/dist/migration.mjs.map +1 -1
- package/dist/{nodes-Dq0ALHOk.d.mts → nodes-779hmCfL.d.mts} +4 -2
- package/dist/nodes-779hmCfL.d.mts.map +1 -0
- package/dist/{nodes-Dm1XR7UL.mjs → nodes-DZk2JZG3.mjs} +6 -1
- package/dist/nodes-DZk2JZG3.mjs.map +1 -0
- package/dist/{op-factory-call-D47zfLOp.d.mts → op-factory-call-Bj1jPDpD.d.mts} +12 -11
- package/dist/op-factory-call-Bj1jPDpD.d.mts.map +1 -0
- package/dist/op-factory-call-q9Tpw6wc.mjs +1217 -0
- package/dist/op-factory-call-q9Tpw6wc.mjs.map +1 -0
- package/dist/op-factory-call.d.mts +1 -1
- package/dist/op-factory-call.mjs +1 -1
- package/dist/{planner-C5tapy2_.mjs → planner-BI6l-3ft.mjs} +11 -7
- package/dist/planner-BI6l-3ft.mjs.map +1 -0
- package/dist/planner-ddl-builders-DDyptTt5.mjs.map +1 -1
- package/dist/planner-ddl-builders.d.mts +3 -3
- package/dist/planner-ddl-builders.d.mts.map +1 -1
- package/dist/{planner-produced-postgres-migration-BCy50btZ.mjs → planner-produced-postgres-migration-7aaRoTZN.mjs} +8 -6
- package/dist/planner-produced-postgres-migration-7aaRoTZN.mjs.map +1 -0
- package/dist/{planner-produced-postgres-migration-CpsGhewL.d.mts → planner-produced-postgres-migration-B11fjNTx.d.mts} +4 -3
- package/dist/planner-produced-postgres-migration-B11fjNTx.d.mts.map +1 -0
- package/dist/planner-produced-postgres-migration.d.mts +1 -1
- package/dist/planner-produced-postgres-migration.mjs +1 -1
- package/dist/planner.d.mts +5 -2
- package/dist/planner.d.mts.map +1 -1
- package/dist/planner.mjs +1 -1
- package/dist/{postgres-migration--iqDr7rB.d.mts → postgres-migration-B6rKNT4N.d.mts} +23 -1
- package/dist/postgres-migration-B6rKNT4N.d.mts.map +1 -0
- package/dist/{postgres-migration-DcymFlMG.mjs → postgres-migration-C_wPoWz_.mjs} +21 -1
- package/dist/postgres-migration-C_wPoWz_.mjs.map +1 -0
- package/dist/{render-ops-Wb6SCGmj.mjs → render-ops-BpjstrKQ.mjs} +4 -3
- package/dist/{render-ops-Wb6SCGmj.mjs.map → render-ops-BpjstrKQ.mjs.map} +1 -1
- package/dist/render-ops.d.mts +2 -1
- package/dist/render-ops.d.mts.map +1 -1
- package/dist/render-ops.mjs +1 -1
- package/dist/{render-typescript-BShM6uyS.mjs → render-typescript-KMgosran.mjs} +5 -2
- package/dist/render-typescript-KMgosran.mjs.map +1 -0
- package/dist/render-typescript.mjs +1 -1
- package/dist/{shared-C3gXQyxj.d.mts → shared-C6QxSU0W.d.mts} +4 -4
- package/dist/{shared-C3gXQyxj.d.mts.map → shared-C6QxSU0W.d.mts.map} +1 -1
- package/package.json +17 -17
- package/src/contract-free/ddl.ts +6 -1
- package/src/core/ddl/nodes.ts +14 -1
- package/src/core/migrations/issue-planner.ts +27 -10
- package/src/core/migrations/op-factory-call.ts +197 -42
- package/src/core/migrations/operations/constraints.ts +1 -9
- package/src/core/migrations/operations/dependencies.ts +0 -17
- package/src/core/migrations/operations/shared.ts +3 -3
- package/src/core/migrations/operations/tables.ts +1 -39
- package/src/core/migrations/planner-ddl-builders.ts +4 -4
- package/src/core/migrations/planner-produced-postgres-migration.ts +11 -6
- package/src/core/migrations/planner-strategies.ts +1 -0
- package/src/core/migrations/planner.ts +11 -2
- package/src/core/migrations/postgres-migration.ts +41 -0
- package/src/core/migrations/render-ops.ts +7 -2
- package/src/core/migrations/render-typescript.ts +5 -1
- package/src/exports/control.ts +6 -8
- package/src/exports/migration.ts +9 -2
- package/dist/issue-planner-hxJaxYHv.mjs.map +0 -1
- package/dist/nodes-Dm1XR7UL.mjs.map +0 -1
- package/dist/nodes-Dq0ALHOk.d.mts.map +0 -1
- package/dist/op-factory-call-D47zfLOp.d.mts.map +0 -1
- package/dist/op-factory-call-G9G02kxC.mjs +0 -625
- package/dist/op-factory-call-G9G02kxC.mjs.map +0 -1
- package/dist/planner-C5tapy2_.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-BCy50btZ.mjs.map +0 -1
- package/dist/planner-produced-postgres-migration-CpsGhewL.d.mts.map +0 -1
- package/dist/postgres-migration--iqDr7rB.d.mts.map +0 -1
- package/dist/postgres-migration-DcymFlMG.mjs.map +0 -1
- package/dist/render-typescript-BShM6uyS.mjs.map +0 -1
- package/dist/tables-OLIoVjxf.mjs +0 -516
- package/dist/tables-OLIoVjxf.mjs.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as PostgresPlanTargetDetails } from "./planner-target-details-DyUHJ7MY.mjs";
|
|
2
2
|
import { n as DataTransformOptions } from "./data-transform-lq3NGdIt.mjs";
|
|
3
|
+
import { DdlColumn, DdlTableConstraint } from "@prisma-next/sql-relational-core/ast";
|
|
3
4
|
import { SqlMigrationPlanOperation } from "@prisma-next/family-sql/control";
|
|
4
5
|
import { SqlStorage } from "@prisma-next/sql-contract/types";
|
|
5
6
|
import { Migration } from "@prisma-next/family-sql/migration";
|
|
@@ -44,7 +45,28 @@ declare abstract class PostgresMigration extends Migration<PostgresPlanTargetDet
|
|
|
44
45
|
* `get operations()`; the adapter argument is hidden from the call site.
|
|
45
46
|
*/
|
|
46
47
|
protected dataTransform<TContract extends Contract<SqlStorage>>(contract: TContract, name: string, options: DataTransformOptions): SqlMigrationPlanOperation<PostgresPlanTargetDetails>;
|
|
48
|
+
/**
|
|
49
|
+
* Emit a `CREATE TABLE` migration operation. Builds a typed DDL node from
|
|
50
|
+
* the supplied options and lowers it through the stored control adapter.
|
|
51
|
+
* Throws if no adapter is present (i.e. migration instantiated without a stack).
|
|
52
|
+
*/
|
|
53
|
+
protected createTable(options: {
|
|
54
|
+
readonly schema?: string;
|
|
55
|
+
readonly table: string;
|
|
56
|
+
readonly ifNotExists?: boolean;
|
|
57
|
+
readonly columns: readonly DdlColumn[];
|
|
58
|
+
readonly constraints?: readonly DdlTableConstraint[];
|
|
59
|
+
}): SqlMigrationPlanOperation<PostgresPlanTargetDetails>;
|
|
60
|
+
/**
|
|
61
|
+
* Emit a `CREATE SCHEMA` migration operation. Builds a typed DDL node from
|
|
62
|
+
* the supplied options and lowers it through the stored control adapter.
|
|
63
|
+
* Throws if no adapter is present (i.e. migration instantiated without a stack).
|
|
64
|
+
*/
|
|
65
|
+
protected createSchema(options: {
|
|
66
|
+
readonly schema: string;
|
|
67
|
+
readonly ifNotExists?: boolean;
|
|
68
|
+
}): SqlMigrationPlanOperation<PostgresPlanTargetDetails>;
|
|
47
69
|
}
|
|
48
70
|
//#endregion
|
|
49
71
|
export { PostgresMigration as t };
|
|
50
|
-
//# sourceMappingURL=postgres-migration
|
|
72
|
+
//# sourceMappingURL=postgres-migration-B6rKNT4N.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-migration-B6rKNT4N.d.mts","names":[],"sources":["../src/core/migrations/postgres-migration.ts"],"mappings":";;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;;;;uBAAsB,iBAAA,SAA0B,SAAA,CAC9C,yBAAA;EAAA,SAGS,QAAA;EAJiD;;;;;;EAAA,mBAYvC,cAAA,EAAgB,iBAAA;cAEvB,KAAA,GAAQ,YAAA;EAAR;;;;;EAAA,UAeF,aAAA,mBAAgC,QAAA,CAAS,UAAA,GACjD,QAAA,EAAU,SAAA,EACV,IAAA,UACA,OAAA,EAAS,oBAAA,GACR,yBAAA,CAA0B,yBAAA;EAH3B;;;;;EAAA,UAeQ,WAAA,CAAY,OAAA;IAAA,SACX,MAAA;IAAA,SACA,KAAA;IAAA,SACA,WAAA;IAAA,SACA,OAAA,WAAkB,SAAA;IAAA,SAClB,WAAA,YAAuB,kBAAA;EAAA,IAC9B,yBAAA,CAA0B,yBAAA;EADnB;;;;;EAAA,UAkBD,YAAA,CAAa,OAAA;IAAA,SACZ,MAAA;IAAA,SACA,WAAA;EAAA,IACP,yBAAA,CAA0B,yBAAA;AAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { d as CreateTableCall, u as CreateSchemaCall } from "./op-factory-call-q9Tpw6wc.mjs";
|
|
1
2
|
import { t as errorPostgresMigrationStackMissing } from "./errors-CUk87ByX.mjs";
|
|
2
3
|
import { t as dataTransform } from "./data-transform-D25tLeYU.mjs";
|
|
4
|
+
import { UNBOUND_NAMESPACE_ID } from "@prisma-next/framework-components/ir";
|
|
3
5
|
import { Migration } from "@prisma-next/family-sql/migration";
|
|
4
6
|
//#region src/core/migrations/postgres-migration.ts
|
|
5
7
|
/**
|
|
@@ -44,8 +46,26 @@ var PostgresMigration = class extends Migration {
|
|
|
44
46
|
if (!this.controlAdapter) throw errorPostgresMigrationStackMissing();
|
|
45
47
|
return dataTransform(contract, name, options, this.controlAdapter);
|
|
46
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Emit a `CREATE TABLE` migration operation. Builds a typed DDL node from
|
|
51
|
+
* the supplied options and lowers it through the stored control adapter.
|
|
52
|
+
* Throws if no adapter is present (i.e. migration instantiated without a stack).
|
|
53
|
+
*/
|
|
54
|
+
createTable(options) {
|
|
55
|
+
if (!this.controlAdapter) throw errorPostgresMigrationStackMissing();
|
|
56
|
+
return new CreateTableCall(options.schema ?? UNBOUND_NAMESPACE_ID, options.table, options.columns, options.constraints).toOp(this.controlAdapter);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Emit a `CREATE SCHEMA` migration operation. Builds a typed DDL node from
|
|
60
|
+
* the supplied options and lowers it through the stored control adapter.
|
|
61
|
+
* Throws if no adapter is present (i.e. migration instantiated without a stack).
|
|
62
|
+
*/
|
|
63
|
+
createSchema(options) {
|
|
64
|
+
if (!this.controlAdapter) throw errorPostgresMigrationStackMissing();
|
|
65
|
+
return new CreateSchemaCall(options.schema).toOp(this.controlAdapter);
|
|
66
|
+
}
|
|
47
67
|
};
|
|
48
68
|
//#endregion
|
|
49
69
|
export { PostgresMigration as t };
|
|
50
70
|
|
|
51
|
-
//# sourceMappingURL=postgres-migration-
|
|
71
|
+
//# sourceMappingURL=postgres-migration-C_wPoWz_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-migration-C_wPoWz_.mjs","names":["SqlMigration"],"sources":["../src/core/migrations/postgres-migration.ts"],"sourcesContent":["import type { Contract } from '@prisma-next/contract/types';\nimport type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { SqlControlAdapter } from '@prisma-next/family-sql/control-adapter';\nimport { Migration as SqlMigration } from '@prisma-next/family-sql/migration';\nimport type { ControlStack } from '@prisma-next/framework-components/control';\nimport { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport type { DdlColumn, DdlTableConstraint } from '@prisma-next/sql-relational-core/ast';\nimport { errorPostgresMigrationStackMissing } from '../errors';\nimport { CreateSchemaCall, CreateTableCall } from './op-factory-call';\nimport { type DataTransformOptions, dataTransform } from './operations/data-transform';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\n/**\n * Target-owned base class for Postgres migrations.\n *\n * Fixes the `SqlMigration` generic to `PostgresPlanTargetDetails` and the\n * abstract `targetId` to the Postgres target-id string literal, so both\n * user-authored migrations and renderer-generated scaffolds (the output of\n * `renderCallsToTypeScript`) can extend `PostgresMigration` directly without\n * redeclaring target-local identity.\n *\n * Mirrors `MongoMigration` in `@prisma-next/family-mongo`: the renderer\n * emits `extends Migration` against a facade re-export of this class\n * from `@prisma-next/postgres/migration`, keeping the authoring surface\n * target-scoped rather than family-scoped.\n *\n * The constructor materializes a single Postgres `SqlControlAdapter` from\n * `stack.adapter.create(stack)` and stores it; the protected `dataTransform`\n * instance method forwards to the free `dataTransform` factory with that\n * stored adapter, so user migrations can write `this.dataTransform(...)`\n * without threading the adapter through every call.\n */\nexport abstract class PostgresMigration extends SqlMigration<\n PostgresPlanTargetDetails,\n 'postgres'\n> {\n readonly targetId = 'postgres' as const;\n\n /**\n * Materialized Postgres control adapter, created once per migration\n * instance from the injected stack. `undefined` only when the migration\n * was instantiated without a stack (test fixtures); `dataTransform`\n * throws in that case to surface the misuse.\n */\n protected readonly controlAdapter: SqlControlAdapter<'postgres'> | undefined;\n\n constructor(stack?: ControlStack<'sql', 'postgres'>) {\n super(stack);\n // The descriptor `create()` is typed as the wider `ControlAdapterInstance`;\n // the Postgres descriptor concretely returns a `SqlControlAdapter<'postgres'>`,\n // so the cast holds for any Postgres-target stack assembled at runtime.\n this.controlAdapter = stack?.adapter\n ? (stack.adapter.create(stack) as SqlControlAdapter<'postgres'>)\n : undefined;\n }\n\n /**\n * Instance-method wrapper around the free `dataTransform` factory that\n * supplies the stored control adapter. Authors call this from inside\n * `get operations()`; the adapter argument is hidden from the call site.\n */\n protected dataTransform<TContract extends Contract<SqlStorage>>(\n contract: TContract,\n name: string,\n options: DataTransformOptions,\n ): SqlMigrationPlanOperation<PostgresPlanTargetDetails> {\n if (!this.controlAdapter) {\n throw errorPostgresMigrationStackMissing();\n }\n return dataTransform(contract, name, options, this.controlAdapter);\n }\n\n /**\n * Emit a `CREATE TABLE` migration operation. Builds a typed DDL node from\n * the supplied options and lowers it through the stored control adapter.\n * Throws if no adapter is present (i.e. migration instantiated without a stack).\n */\n protected createTable(options: {\n readonly schema?: string;\n readonly table: string;\n readonly ifNotExists?: boolean;\n readonly columns: readonly DdlColumn[];\n readonly constraints?: readonly DdlTableConstraint[];\n }): SqlMigrationPlanOperation<PostgresPlanTargetDetails> {\n if (!this.controlAdapter) {\n throw errorPostgresMigrationStackMissing();\n }\n return new CreateTableCall(\n options.schema ?? UNBOUND_NAMESPACE_ID,\n options.table,\n options.columns,\n options.constraints,\n ).toOp(this.controlAdapter);\n }\n\n /**\n * Emit a `CREATE SCHEMA` migration operation. Builds a typed DDL node from\n * the supplied options and lowers it through the stored control adapter.\n * Throws if no adapter is present (i.e. migration instantiated without a stack).\n */\n protected createSchema(options: {\n readonly schema: string;\n readonly ifNotExists?: boolean;\n }): SqlMigrationPlanOperation<PostgresPlanTargetDetails> {\n if (!this.controlAdapter) {\n throw errorPostgresMigrationStackMissing();\n }\n return new CreateSchemaCall(options.schema).toOp(this.controlAdapter);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAsB,oBAAtB,cAAgDA,UAG9C;CACA,WAAoB;;;;;;;CAQpB;CAEA,YAAY,OAAyC;EACnD,MAAM,KAAK;EAIX,KAAK,iBAAiB,OAAO,UACxB,MAAM,QAAQ,OAAO,KAAK,IAC3B,KAAA;CACN;;;;;;CAOA,cACE,UACA,MACA,SACsD;EACtD,IAAI,CAAC,KAAK,gBACR,MAAM,mCAAmC;EAE3C,OAAO,cAAc,UAAU,MAAM,SAAS,KAAK,cAAc;CACnE;;;;;;CAOA,YAAsB,SAMmC;EACvD,IAAI,CAAC,KAAK,gBACR,MAAM,mCAAmC;EAE3C,OAAO,IAAI,gBACT,QAAQ,UAAU,sBAClB,QAAQ,OACR,QAAQ,SACR,QAAQ,WACV,CAAC,CAAC,KAAK,KAAK,cAAc;CAC5B;;;;;;CAOA,aAAuB,SAGkC;EACvD,IAAI,CAAC,KAAK,gBACR,MAAM,mCAAmC;EAE3C,OAAO,IAAI,iBAAiB,QAAQ,MAAM,CAAC,CAAC,KAAK,KAAK,cAAc;CACtE;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { blindCast } from "@prisma-next/utils/casts";
|
|
1
2
|
//#region src/core/migrations/render-ops.ts
|
|
2
3
|
/**
|
|
3
4
|
* Asserts an op materialised by an `OpFactoryCall` targets postgres. The
|
|
@@ -10,9 +11,9 @@ function assertPostgresOp(op, callFactoryName) {
|
|
|
10
11
|
const targetId = op.target?.id;
|
|
11
12
|
if (targetId !== "postgres") throw new Error(`renderOps: expected postgres op but got target.id="${String(targetId)}" for op.id="${op.id}" (factoryName="${callFactoryName}"). An OpFactoryCall produced an op for a different target on the postgres planner path; check the call's target binding.`);
|
|
12
13
|
}
|
|
13
|
-
function renderOps(calls) {
|
|
14
|
+
function renderOps(calls, lowerer) {
|
|
14
15
|
return calls.map((c) => {
|
|
15
|
-
const op = c.toOp();
|
|
16
|
+
const op = blindCast(c).toOp(lowerer);
|
|
16
17
|
assertPostgresOp(op, c.factoryName);
|
|
17
18
|
return op;
|
|
18
19
|
});
|
|
@@ -20,4 +21,4 @@ function renderOps(calls) {
|
|
|
20
21
|
//#endregion
|
|
21
22
|
export { renderOps as t };
|
|
22
23
|
|
|
23
|
-
//# sourceMappingURL=render-ops-
|
|
24
|
+
//# sourceMappingURL=render-ops-BpjstrKQ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops-
|
|
1
|
+
{"version":3,"file":"render-ops-BpjstrKQ.mjs","names":[],"sources":["../src/core/migrations/render-ops.ts"],"sourcesContent":["import type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';\nimport type { Lowerer } from '@prisma-next/family-sql/control-adapter';\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport { blindCast } from '@prisma-next/utils/casts';\nimport type { PostgresPlanTargetDetails } from './planner-target-details';\n\ntype Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;\n\n/**\n * Asserts an op materialised by an `OpFactoryCall` targets postgres. The\n * extension surface lets any contributor emit calls, so this is the\n * integration boundary where a stray non-postgres op would otherwise\n * silently flow through to postgres-shaped renderers — exactly the\n * place to fail loudly with op metadata (`id` + `target.id`).\n */\nfunction assertPostgresOp(\n op: ReturnType<OpFactoryCall['toOp']>,\n callFactoryName: string,\n): asserts op is Op {\n const targetId = (op as Partial<Op>).target?.id;\n if (targetId !== 'postgres') {\n throw new Error(\n `renderOps: expected postgres op but got target.id=\"${String(targetId)}\" for op.id=\"${op.id}\" (factoryName=\"${callFactoryName}\"). An OpFactoryCall produced an op for a different target on the postgres planner path; check the call's target binding.`,\n );\n }\n}\n\nexport function renderOps(calls: readonly OpFactoryCall[], lowerer?: Lowerer): Op[] {\n return calls.map((c) => {\n const op = blindCast<\n { toOp(lowerer?: Lowerer): ReturnType<OpFactoryCall['toOp']> },\n 'PG OpFactoryCall.toOp accepts an optional Lowerer; the framework interface omits it because not all targets need a lowerer — the PG target overrides with this extended signature'\n >(c).toOp(lowerer);\n assertPostgresOp(op, c.factoryName);\n return op;\n });\n}\n"],"mappings":";;;;;;;;;AAeA,SAAS,iBACP,IACA,iBACkB;CAClB,MAAM,WAAY,GAAmB,QAAQ;CAC7C,IAAI,aAAa,YACf,MAAM,IAAI,MACR,sDAAsD,OAAO,QAAQ,EAAE,eAAe,GAAG,GAAG,kBAAkB,gBAAgB,0HAChI;AAEJ;AAEA,SAAgB,UAAU,OAAiC,SAAyB;CAClF,OAAO,MAAM,KAAK,MAAM;EACtB,MAAM,KAAK,UAGT,CAAC,CAAC,CAAC,KAAK,OAAO;EACjB,iBAAiB,IAAI,EAAE,WAAW;EAClC,OAAO;CACT,CAAC;AACH"}
|
package/dist/render-ops.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { t as PostgresPlanTargetDetails } from "./planner-target-details-DyUHJ7MY.mjs";
|
|
2
2
|
import { SqlMigrationPlanOperation } from "@prisma-next/family-sql/control";
|
|
3
3
|
import { OpFactoryCall } from "@prisma-next/framework-components/control";
|
|
4
|
+
import { Lowerer } from "@prisma-next/family-sql/control-adapter";
|
|
4
5
|
|
|
5
6
|
//#region src/core/migrations/render-ops.d.ts
|
|
6
7
|
type Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;
|
|
7
|
-
declare function renderOps(calls: readonly OpFactoryCall[]): Op[];
|
|
8
|
+
declare function renderOps(calls: readonly OpFactoryCall[], lowerer?: Lowerer): Op[];
|
|
8
9
|
//#endregion
|
|
9
10
|
export { renderOps };
|
|
10
11
|
//# sourceMappingURL=render-ops.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-ops.d.mts","names":[],"sources":["../src/core/migrations/render-ops.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"render-ops.d.mts","names":[],"sources":["../src/core/migrations/render-ops.ts"],"mappings":";;;;;;KAMK,EAAA,GAAK,yBAAyB,CAAC,yBAAA;AAAA,iBAqBpB,SAAA,CAAU,KAAA,WAAgB,aAAA,IAAiB,OAAA,GAAU,OAAA,GAAU,EAAA"}
|
package/dist/render-ops.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as renderOps } from "./render-ops-
|
|
1
|
+
import { t as renderOps } from "./render-ops-BpjstrKQ.mjs";
|
|
2
2
|
export { renderOps };
|
|
@@ -28,7 +28,7 @@ const BASE_IMPORTS = [{
|
|
|
28
28
|
}];
|
|
29
29
|
function renderCallsToTypeScript(calls, meta) {
|
|
30
30
|
const imports = buildImports(calls);
|
|
31
|
-
const operationsBody = calls.map((c) => c
|
|
31
|
+
const operationsBody = calls.map((c) => renderCall(c)).join(",\n");
|
|
32
32
|
return [
|
|
33
33
|
shebangLineFor(detectScaffoldRuntime()),
|
|
34
34
|
imports,
|
|
@@ -46,6 +46,9 @@ function renderCallsToTypeScript(calls, meta) {
|
|
|
46
46
|
""
|
|
47
47
|
].join("\n");
|
|
48
48
|
}
|
|
49
|
+
function renderCall(call) {
|
|
50
|
+
return call.renderTypeScript();
|
|
51
|
+
}
|
|
49
52
|
function buildImports(calls) {
|
|
50
53
|
const requirements = [...BASE_IMPORTS];
|
|
51
54
|
for (const call of calls) for (const req of call.importRequirements()) requirements.push(req);
|
|
@@ -69,4 +72,4 @@ function indent(text, spaces) {
|
|
|
69
72
|
//#endregion
|
|
70
73
|
export { renderCallsToTypeScript as t };
|
|
71
74
|
|
|
72
|
-
//# sourceMappingURL=render-typescript-
|
|
75
|
+
//# sourceMappingURL=render-typescript-KMgosran.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-typescript-KMgosran.mjs","names":[],"sources":["../src/core/migrations/render-typescript.ts"],"sourcesContent":["/**\n * Polymorphic TypeScript emitter for the Postgres migration IR.\n *\n * Each `OpFactoryCall` renders itself via `renderTypeScript()` and\n * declares its own `importRequirements()`; this file just composes the module\n * source around those contributions. The design mirrors the Mongo target's\n * `render-typescript.ts` deliberately — byte-for-byte alignment isn't required\n * (different factory module specifiers, different base-class name) but the\n * shape is, so future consolidation to a framework-level helper is mechanical.\n */\n\nimport type { OpFactoryCall } from '@prisma-next/framework-components/control';\nimport { detectScaffoldRuntime, shebangLineFor } from '@prisma-next/migration-tools/migration-ts';\nimport { type ImportRequirement, renderImports } from '@prisma-next/ts-render';\n\nexport interface RenderMigrationMeta {\n readonly from: string | null;\n readonly to: string;\n}\n\n/**\n * Always-present base imports for the rendered scaffold. Both come from\n * `@prisma-next/postgres/migration` so an authored Postgres\n * `migration.ts` only needs a single dependency for its base class and\n * its CLI entrypoint:\n *\n * - `Migration` — the facade re-export fixes the `SqlMigration`\n * generic to `PostgresPlanTargetDetails` and the abstract `targetId`\n * to `'postgres'`, so user-authored migrations don't need to thread\n * target-details or redeclare `targetId`.\n * - `MigrationCLI` — the migration-file CLI entrypoint, re-exported from\n * `@prisma-next/cli/migration-cli`. Loads `prisma-next.config.ts`,\n * assembles a `ControlStack`, and instantiates the migration class.\n * The migration file owns this dependency directly: pulling CLI\n * machinery in at script run time is acceptable because the script's\n * whole purpose is to be invoked from the project that owns the\n * config.\n */\nconst BASE_IMPORTS: readonly ImportRequirement[] = [\n { moduleSpecifier: '@prisma-next/postgres/migration', symbol: 'Migration' },\n { moduleSpecifier: '@prisma-next/postgres/migration', symbol: 'MigrationCLI' },\n];\n\nexport function renderCallsToTypeScript(\n calls: ReadonlyArray<OpFactoryCall>,\n meta: RenderMigrationMeta,\n): string {\n const imports = buildImports(calls);\n const operationsBody = calls.map((c) => renderCall(c)).join(',\\n');\n\n return [\n shebangLineFor(detectScaffoldRuntime()),\n imports,\n '',\n 'export default class M extends Migration {',\n buildDescribeMethod(meta),\n ' override get operations() {',\n ' return [',\n indent(operationsBody, 6),\n ' ];',\n ' }',\n '}',\n '',\n 'MigrationCLI.run(import.meta.url, M);',\n '',\n ].join('\\n');\n}\n\nfunction renderCall(call: OpFactoryCall): string {\n return call.renderTypeScript();\n}\n\nfunction buildImports(calls: ReadonlyArray<OpFactoryCall>): string {\n const requirements: ImportRequirement[] = [...BASE_IMPORTS];\n for (const call of calls) {\n for (const req of call.importRequirements()) {\n requirements.push(req);\n }\n }\n return renderImports(requirements);\n}\n\nfunction buildDescribeMethod(meta: RenderMigrationMeta): string {\n const lines: string[] = [];\n lines.push(' override describe() {');\n lines.push(' return {');\n lines.push(` from: ${JSON.stringify(meta.from)},`);\n lines.push(` to: ${JSON.stringify(meta.to)},`);\n lines.push(' };');\n lines.push(' }');\n lines.push('');\n return lines.join('\\n');\n}\n\nfunction indent(text: string, spaces: number): string {\n const pad = ' '.repeat(spaces);\n return text\n .split('\\n')\n .map((line) => (line.trim() ? `${pad}${line}` : line))\n .join('\\n');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,MAAM,eAA6C,CACjD;CAAE,iBAAiB;CAAmC,QAAQ;AAAY,GAC1E;CAAE,iBAAiB;CAAmC,QAAQ;AAAe,CAC/E;AAEA,SAAgB,wBACd,OACA,MACQ;CACR,MAAM,UAAU,aAAa,KAAK;CAClC,MAAM,iBAAiB,MAAM,KAAK,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK;CAEjE,OAAO;EACL,eAAe,sBAAsB,CAAC;EACtC;EACA;EACA;EACA,oBAAoB,IAAI;EACxB;EACA;EACA,OAAO,gBAAgB,CAAC;EACxB;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI;AACb;AAEA,SAAS,WAAW,MAA6B;CAC/C,OAAO,KAAK,iBAAiB;AAC/B;AAEA,SAAS,aAAa,OAA6C;CACjE,MAAM,eAAoC,CAAC,GAAG,YAAY;CAC1D,KAAK,MAAM,QAAQ,OACjB,KAAK,MAAM,OAAO,KAAK,mBAAmB,GACxC,aAAa,KAAK,GAAG;CAGzB,OAAO,cAAc,YAAY;AACnC;AAEA,SAAS,oBAAoB,MAAmC;CAC9D,MAAM,QAAkB,CAAC;CACzB,MAAM,KAAK,yBAAyB;CACpC,MAAM,KAAK,cAAc;CACzB,MAAM,KAAK,eAAe,KAAK,UAAU,KAAK,IAAI,EAAE,EAAE;CACtD,MAAM,KAAK,aAAa,KAAK,UAAU,KAAK,EAAE,EAAE,EAAE;CAClD,MAAM,KAAK,QAAQ;CACnB,MAAM,KAAK,KAAK;CAChB,MAAM,KAAK,EAAE;CACb,OAAO,MAAM,KAAK,IAAI;AACxB;AAEA,SAAS,OAAO,MAAc,QAAwB;CACpD,MAAM,MAAM,IAAI,OAAO,MAAM;CAC7B,OAAO,KACJ,MAAM,IAAI,CAAC,CACX,KAAK,SAAU,KAAK,KAAK,IAAI,GAAG,MAAM,SAAS,IAAK,CAAC,CACrD,KAAK,IAAI;AACd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as renderCallsToTypeScript } from "./render-typescript-
|
|
1
|
+
import { t as renderCallsToTypeScript } from "./render-typescript-KMgosran.mjs";
|
|
2
2
|
export { renderCallsToTypeScript };
|
|
@@ -5,9 +5,9 @@ import { ReferentialAction } from "@prisma-next/sql-contract/types";
|
|
|
5
5
|
//#region src/core/migrations/operations/shared.d.ts
|
|
6
6
|
type Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;
|
|
7
7
|
/**
|
|
8
|
-
* Literal-args shape for a column definition consumed by `
|
|
9
|
-
*
|
|
10
|
-
* already happened in the wrapper.
|
|
8
|
+
* Literal-args shape for a column definition consumed by `addColumn` and
|
|
9
|
+
* similar operations. Fully materialized: codec expansion and default
|
|
10
|
+
* rendering have already happened in the wrapper.
|
|
11
11
|
*
|
|
12
12
|
* - `typeSql` is the column's DDL type string (e.g. `"integer"`, `"SERIAL"`,
|
|
13
13
|
* `"varchar(100)"`), already produced by `buildColumnTypeSql` in the
|
|
@@ -40,4 +40,4 @@ interface ForeignKeySpec {
|
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
export { ForeignKeySpec as n, Op as r, ColumnSpec as t };
|
|
43
|
-
//# sourceMappingURL=shared-
|
|
43
|
+
//# sourceMappingURL=shared-C6QxSU0W.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-
|
|
1
|
+
{"version":3,"file":"shared-C6QxSU0W.d.mts","names":[],"sources":["../src/core/migrations/operations/shared.ts"],"mappings":";;;;;KAMY,EAAA,GAAK,yBAAyB,CAAC,yBAAA;;AAA3C;;;;AAAoE;AAcpE;;;;;;UAAiB,UAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA;EAAA,SACA,QAAA;AAAA;;;;;;UAQM,cAAA;EAAA,SACN,IAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA;IAAA,SACE,MAAA;IAAA,SACA,KAAA;IAAA,SACA,OAAA;EAAA;EAAA,SAEF,QAAA,GAAW,iBAAA;EAAA,SACX,QAAA,GAAW,iBAAiB;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/target-postgres",
|
|
3
|
-
"version": "0.12.0-dev.
|
|
3
|
+
"version": "0.12.0-dev.64",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"description": "Postgres target pack for Prisma Next",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@prisma-next/cli": "0.12.0-dev.
|
|
10
|
-
"@prisma-next/contract": "0.12.0-dev.
|
|
11
|
-
"@prisma-next/errors": "0.12.0-dev.
|
|
12
|
-
"@prisma-next/family-sql": "0.12.0-dev.
|
|
13
|
-
"@prisma-next/framework-components": "0.12.0-dev.
|
|
14
|
-
"@prisma-next/migration-tools": "0.12.0-dev.
|
|
15
|
-
"@prisma-next/ts-render": "0.12.0-dev.
|
|
16
|
-
"@prisma-next/sql-contract": "0.12.0-dev.
|
|
17
|
-
"@prisma-next/sql-errors": "0.12.0-dev.
|
|
18
|
-
"@prisma-next/sql-operations": "0.12.0-dev.
|
|
19
|
-
"@prisma-next/sql-relational-core": "0.12.0-dev.
|
|
20
|
-
"@prisma-next/sql-schema-ir": "0.12.0-dev.
|
|
21
|
-
"@prisma-next/utils": "0.12.0-dev.
|
|
9
|
+
"@prisma-next/cli": "0.12.0-dev.64",
|
|
10
|
+
"@prisma-next/contract": "0.12.0-dev.64",
|
|
11
|
+
"@prisma-next/errors": "0.12.0-dev.64",
|
|
12
|
+
"@prisma-next/family-sql": "0.12.0-dev.64",
|
|
13
|
+
"@prisma-next/framework-components": "0.12.0-dev.64",
|
|
14
|
+
"@prisma-next/migration-tools": "0.12.0-dev.64",
|
|
15
|
+
"@prisma-next/ts-render": "0.12.0-dev.64",
|
|
16
|
+
"@prisma-next/sql-contract": "0.12.0-dev.64",
|
|
17
|
+
"@prisma-next/sql-errors": "0.12.0-dev.64",
|
|
18
|
+
"@prisma-next/sql-operations": "0.12.0-dev.64",
|
|
19
|
+
"@prisma-next/sql-relational-core": "0.12.0-dev.64",
|
|
20
|
+
"@prisma-next/sql-schema-ir": "0.12.0-dev.64",
|
|
21
|
+
"@prisma-next/utils": "0.12.0-dev.64",
|
|
22
22
|
"@standard-schema/spec": "^1.1.0",
|
|
23
23
|
"arktype": "^2.2.0",
|
|
24
24
|
"pathe": "^2.0.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@prisma-next/test-utils": "0.12.0-dev.
|
|
28
|
-
"@prisma-next/tsconfig": "0.12.0-dev.
|
|
29
|
-
"@prisma-next/tsdown": "0.12.0-dev.
|
|
27
|
+
"@prisma-next/test-utils": "0.12.0-dev.64",
|
|
28
|
+
"@prisma-next/tsconfig": "0.12.0-dev.64",
|
|
29
|
+
"@prisma-next/tsdown": "0.12.0-dev.64",
|
|
30
30
|
"tsdown": "0.22.1",
|
|
31
31
|
"typescript": "5.9.3",
|
|
32
32
|
"vitest": "4.1.7"
|
package/src/contract-free/ddl.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type { DdlColumn } from '@prisma-next/sql-relational-core/ast';
|
|
1
|
+
import type { DdlColumn, DdlTableConstraint } from '@prisma-next/sql-relational-core/ast';
|
|
2
2
|
import { PostgresCreateSchema, PostgresCreateTable } from '../core/ddl/nodes';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Build a Postgres `CREATE TABLE` query node.
|
|
6
6
|
*
|
|
7
|
+
* Pass `constraints` for table-level composite primary keys, foreign keys, and
|
|
8
|
+
* unique constraints — use the {@link PrimaryKeyConstraint}, {@link ForeignKeyConstraint},
|
|
9
|
+
* and {@link UniqueConstraint} classes from `@prisma-next/sql-relational-core/ast`.
|
|
10
|
+
*
|
|
7
11
|
* Precondition: identifiers (`table`, `schema`, column names/types) are
|
|
8
12
|
* emitted to SQL verbatim — they are not quoted or escaped, so callers must
|
|
9
13
|
* pass pre-trusted values (e.g. fixed control-plane identifiers). String-literal
|
|
@@ -16,6 +20,7 @@ export function createTable(options: {
|
|
|
16
20
|
readonly schema?: string;
|
|
17
21
|
readonly ifNotExists?: boolean;
|
|
18
22
|
readonly columns: readonly DdlColumn[];
|
|
23
|
+
readonly constraints?: readonly DdlTableConstraint[];
|
|
19
24
|
}): PostgresCreateTable {
|
|
20
25
|
return new PostgresCreateTable(options);
|
|
21
26
|
}
|
package/src/core/ddl/nodes.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type DdlColumn,
|
|
3
|
+
DdlNode,
|
|
4
|
+
type DdlTableConstraint,
|
|
5
|
+
} from '@prisma-next/sql-relational-core/ast';
|
|
2
6
|
|
|
3
7
|
export interface PostgresDdlVisitor<R> {
|
|
4
8
|
createTable(node: PostgresCreateTable): R;
|
|
@@ -13,24 +17,33 @@ function freezeDdlColumns(columns: readonly DdlColumn[]): ReadonlyArray<DdlColum
|
|
|
13
17
|
return Object.freeze([...columns]);
|
|
14
18
|
}
|
|
15
19
|
|
|
20
|
+
function freezeConstraints(
|
|
21
|
+
constraints: readonly DdlTableConstraint[] | undefined,
|
|
22
|
+
): ReadonlyArray<DdlTableConstraint> | undefined {
|
|
23
|
+
return constraints ? Object.freeze([...constraints]) : undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
16
26
|
export class PostgresCreateTable extends PostgresDdlNode {
|
|
17
27
|
readonly kind = 'create-table' as const;
|
|
18
28
|
readonly table: string;
|
|
19
29
|
readonly schema: string | undefined;
|
|
20
30
|
readonly ifNotExists: boolean | undefined;
|
|
21
31
|
readonly columns: ReadonlyArray<DdlColumn>;
|
|
32
|
+
readonly constraints: ReadonlyArray<DdlTableConstraint> | undefined;
|
|
22
33
|
|
|
23
34
|
constructor(options: {
|
|
24
35
|
readonly table: string;
|
|
25
36
|
readonly schema?: string;
|
|
26
37
|
readonly ifNotExists?: boolean;
|
|
27
38
|
readonly columns: readonly DdlColumn[];
|
|
39
|
+
readonly constraints?: readonly DdlTableConstraint[];
|
|
28
40
|
}) {
|
|
29
41
|
super();
|
|
30
42
|
this.table = options.table;
|
|
31
43
|
this.schema = options.schema;
|
|
32
44
|
this.ifNotExists = options.ifNotExists;
|
|
33
45
|
this.columns = freezeDdlColumns(options.columns);
|
|
46
|
+
this.constraints = freezeConstraints(options.constraints);
|
|
34
47
|
this.freeze();
|
|
35
48
|
}
|
|
36
49
|
|
|
@@ -25,6 +25,8 @@ import type {
|
|
|
25
25
|
StorageTable,
|
|
26
26
|
StorageTypeInstance,
|
|
27
27
|
} from '@prisma-next/sql-contract/types';
|
|
28
|
+
import type { DdlColumn, DdlTableConstraint } from '@prisma-next/sql-relational-core/ast';
|
|
29
|
+
import * as contractFree from '@prisma-next/sql-relational-core/contract-free';
|
|
28
30
|
import type { SqlSchemaIR } from '@prisma-next/sql-schema-ir/types';
|
|
29
31
|
import type { Result } from '@prisma-next/utils/result';
|
|
30
32
|
import { notOk, ok } from '@prisma-next/utils/result';
|
|
@@ -47,6 +49,7 @@ import {
|
|
|
47
49
|
DropNotNullCall,
|
|
48
50
|
DropTableCall,
|
|
49
51
|
type PostgresOpFactoryCall,
|
|
52
|
+
postgresDefaultToDdlColumnDefault,
|
|
50
53
|
SetDefaultCall,
|
|
51
54
|
SetNotNullCall,
|
|
52
55
|
} from './op-factory-call';
|
|
@@ -191,16 +194,26 @@ function toColumnSpec(
|
|
|
191
194
|
): ColumnSpec {
|
|
192
195
|
return {
|
|
193
196
|
name,
|
|
194
|
-
typeSql: buildColumnTypeSql(
|
|
195
|
-
column,
|
|
196
|
-
codecHooks as Map<string, CodecControlHooks>,
|
|
197
|
-
storageTypes as Record<string, StorageTypeInstance | PostgresEnumStorageEntry>,
|
|
198
|
-
),
|
|
197
|
+
typeSql: buildColumnTypeSql(column, codecHooks, storageTypes),
|
|
199
198
|
defaultSql: buildColumnDefaultSql(column.default, column),
|
|
200
199
|
nullable: column.nullable,
|
|
201
200
|
};
|
|
202
201
|
}
|
|
203
202
|
|
|
203
|
+
function toDdlColumn(
|
|
204
|
+
name: string,
|
|
205
|
+
column: StorageColumn,
|
|
206
|
+
codecHooks: ReadonlyMap<string, CodecControlHooks>,
|
|
207
|
+
storageTypes: Readonly<Record<string, StorageTypeInstance | PostgresEnumStorageEntry>>,
|
|
208
|
+
): DdlColumn {
|
|
209
|
+
const typeSql = buildColumnTypeSql(column, codecHooks, storageTypes);
|
|
210
|
+
const ddlDefault = postgresDefaultToDdlColumnDefault(column.default);
|
|
211
|
+
return contractFree.col(name, typeSql, {
|
|
212
|
+
...(!column.nullable ? { notNull: true } : {}),
|
|
213
|
+
...(ddlDefault ? { default: ddlDefault } : {}),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
204
217
|
function mapIssueToCall(
|
|
205
218
|
issue: SchemaIssue,
|
|
206
219
|
ctx: StrategyContext,
|
|
@@ -245,14 +258,18 @@ function mapIssueToCall(
|
|
|
245
258
|
);
|
|
246
259
|
}
|
|
247
260
|
const schemaForTable = tableSchema(issue);
|
|
248
|
-
const
|
|
249
|
-
|
|
261
|
+
const ddlColumns: DdlColumn[] = Object.entries(contractTable.columns).map(([name, column]) =>
|
|
262
|
+
toDdlColumn(name, column, codecHooks, storageTypes),
|
|
250
263
|
);
|
|
251
|
-
const
|
|
252
|
-
?
|
|
264
|
+
const ddlConstraints: DdlTableConstraint[] | undefined = contractTable.primaryKey
|
|
265
|
+
? [
|
|
266
|
+
contractFree.primaryKey(contractTable.primaryKey.columns, {
|
|
267
|
+
...(contractTable.primaryKey.name ? { name: contractTable.primaryKey.name } : {}),
|
|
268
|
+
}),
|
|
269
|
+
]
|
|
253
270
|
: undefined;
|
|
254
271
|
const calls: PostgresOpFactoryCall[] = [
|
|
255
|
-
new CreateTableCall(schemaForTable, issue.table,
|
|
272
|
+
new CreateTableCall(schemaForTable, issue.table, ddlColumns, ddlConstraints),
|
|
256
273
|
];
|
|
257
274
|
for (const index of contractTable.indexes) {
|
|
258
275
|
const indexName = index.name ?? `${issue.table}_${index.columns.join('_')}_idx`;
|