@prisma-next/target-postgres 0.4.0-dev.8 → 0.4.1
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/control.d.mts +1 -9
- package/dist/control.d.mts.map +1 -1
- package/dist/control.mjs +1693 -4798
- package/dist/control.mjs.map +1 -1
- package/dist/migration.d.mts +164 -0
- package/dist/migration.d.mts.map +1 -0
- package/dist/migration.mjs +446 -0
- package/dist/migration.mjs.map +1 -0
- package/dist/planner-target-details-MXb3oeul.d.mts +11 -0
- package/dist/planner-target-details-MXb3oeul.d.mts.map +1 -0
- package/dist/postgres-migration-BsHJHV9O.mjs +2793 -0
- package/dist/postgres-migration-BsHJHV9O.mjs.map +1 -0
- package/package.json +21 -19
- package/src/core/migrations/issue-planner.ts +832 -0
- package/src/core/migrations/op-factory-call.ts +862 -0
- package/src/core/migrations/operations/columns.ts +285 -0
- package/src/core/migrations/operations/constraints.ts +191 -0
- package/src/core/migrations/operations/data-transform.ts +113 -0
- package/src/core/migrations/operations/dependencies.ts +36 -0
- package/src/core/migrations/operations/enums.ts +113 -0
- package/src/core/migrations/operations/indexes.ts +61 -0
- package/src/core/migrations/operations/raw.ts +15 -0
- package/src/core/migrations/operations/shared.ts +67 -0
- package/src/core/migrations/operations/tables.ts +63 -0
- package/src/core/migrations/planner-produced-postgres-migration.ts +67 -0
- package/src/core/migrations/planner-strategies.ts +592 -151
- package/src/core/migrations/planner-target-details.ts +0 -6
- package/src/core/migrations/planner.ts +63 -781
- package/src/core/migrations/postgres-migration.ts +20 -0
- package/src/core/migrations/render-ops.ts +9 -0
- package/src/core/migrations/render-typescript.ts +95 -0
- package/src/exports/control.ts +9 -142
- package/src/exports/migration.ts +40 -0
- package/dist/migration-builders.d.mts +0 -88
- package/dist/migration-builders.d.mts.map +0 -1
- package/dist/migration-builders.mjs +0 -3
- package/dist/operation-descriptors-CxymFSgK.mjs +0 -52
- package/dist/operation-descriptors-CxymFSgK.mjs.map +0 -1
- package/src/core/migrations/descriptor-planner.ts +0 -464
- package/src/core/migrations/operation-descriptors.ts +0 -166
- package/src/core/migrations/operation-resolver.ts +0 -929
- package/src/core/migrations/planner-reconciliation.ts +0 -798
- package/src/core/migrations/scaffolding.ts +0 -140
- package/src/exports/migration-builders.ts +0 -56
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { escapeLiteral, qualifyName, quoteIdentifier } from '@prisma-next/adapter-postgres/control';
|
|
2
|
+
import { type Op, step, targetDetails } from './shared';
|
|
3
|
+
|
|
4
|
+
function enumTypeExistsCheck(schemaName: string, nativeType: string, exists = true): string {
|
|
5
|
+
const clause = exists ? 'EXISTS' : 'NOT EXISTS';
|
|
6
|
+
return `SELECT ${clause} (
|
|
7
|
+
SELECT 1
|
|
8
|
+
FROM pg_type t
|
|
9
|
+
JOIN pg_namespace n ON t.typnamespace = n.oid
|
|
10
|
+
WHERE n.nspname = '${escapeLiteral(schemaName)}'
|
|
11
|
+
AND t.typname = '${escapeLiteral(nativeType)}'
|
|
12
|
+
)`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createEnumType(
|
|
16
|
+
schemaName: string,
|
|
17
|
+
typeName: string,
|
|
18
|
+
values: readonly string[],
|
|
19
|
+
): Op {
|
|
20
|
+
const qualifiedType = qualifyName(schemaName, typeName);
|
|
21
|
+
const literalValues = values.map((v) => `'${escapeLiteral(v)}'`).join(', ');
|
|
22
|
+
return {
|
|
23
|
+
id: `type.${typeName}`,
|
|
24
|
+
label: `Create enum type "${typeName}"`,
|
|
25
|
+
operationClass: 'additive',
|
|
26
|
+
target: targetDetails('type', typeName, schemaName),
|
|
27
|
+
precheck: [
|
|
28
|
+
step(
|
|
29
|
+
`ensure type "${typeName}" does not exist`,
|
|
30
|
+
enumTypeExistsCheck(schemaName, typeName, false),
|
|
31
|
+
),
|
|
32
|
+
],
|
|
33
|
+
execute: [
|
|
34
|
+
step(
|
|
35
|
+
`create enum type "${typeName}"`,
|
|
36
|
+
`CREATE TYPE ${qualifiedType} AS ENUM (${literalValues})`,
|
|
37
|
+
),
|
|
38
|
+
],
|
|
39
|
+
postcheck: [
|
|
40
|
+
step(`verify type "${typeName}" exists`, enumTypeExistsCheck(schemaName, typeName)),
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* `typeName` is the contract-facing type name (used for id/label).
|
|
47
|
+
* `nativeType` is the Postgres type name to mutate (may differ for external types).
|
|
48
|
+
*/
|
|
49
|
+
export function addEnumValues(
|
|
50
|
+
schemaName: string,
|
|
51
|
+
typeName: string,
|
|
52
|
+
nativeType: string,
|
|
53
|
+
values: readonly string[],
|
|
54
|
+
): Op {
|
|
55
|
+
const qualifiedType = qualifyName(schemaName, nativeType);
|
|
56
|
+
return {
|
|
57
|
+
id: `type.${typeName}.addValues`,
|
|
58
|
+
label: `Add values to enum type "${typeName}": ${values.join(', ')}`,
|
|
59
|
+
operationClass: 'additive',
|
|
60
|
+
target: targetDetails('type', typeName, schemaName),
|
|
61
|
+
precheck: [
|
|
62
|
+
step(`ensure type "${nativeType}" exists`, enumTypeExistsCheck(schemaName, nativeType)),
|
|
63
|
+
],
|
|
64
|
+
execute: values.map((value) =>
|
|
65
|
+
step(
|
|
66
|
+
`add value '${value}' to enum "${nativeType}"`,
|
|
67
|
+
`ALTER TYPE ${qualifiedType} ADD VALUE '${escapeLiteral(value)}'`,
|
|
68
|
+
),
|
|
69
|
+
),
|
|
70
|
+
postcheck: [
|
|
71
|
+
step(`verify type "${nativeType}" exists`, enumTypeExistsCheck(schemaName, nativeType)),
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function dropEnumType(schemaName: string, typeName: string): Op {
|
|
77
|
+
const qualified = qualifyName(schemaName, typeName);
|
|
78
|
+
return {
|
|
79
|
+
id: `type.${typeName}.drop`,
|
|
80
|
+
label: `Drop enum type "${typeName}"`,
|
|
81
|
+
operationClass: 'destructive',
|
|
82
|
+
target: targetDetails('type', typeName, schemaName),
|
|
83
|
+
precheck: [step(`ensure type "${typeName}" exists`, enumTypeExistsCheck(schemaName, typeName))],
|
|
84
|
+
execute: [step(`drop enum type "${typeName}"`, `DROP TYPE ${qualified}`)],
|
|
85
|
+
postcheck: [
|
|
86
|
+
step(`verify type "${typeName}" removed`, enumTypeExistsCheck(schemaName, typeName, false)),
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function renameType(schemaName: string, fromName: string, toName: string): Op {
|
|
92
|
+
const qualifiedFrom = qualifyName(schemaName, fromName);
|
|
93
|
+
return {
|
|
94
|
+
id: `type.${fromName}.rename`,
|
|
95
|
+
label: `Rename type "${fromName}" to "${toName}"`,
|
|
96
|
+
operationClass: 'destructive',
|
|
97
|
+
target: targetDetails('type', fromName, schemaName),
|
|
98
|
+
precheck: [
|
|
99
|
+
step(`ensure type "${fromName}" exists`, enumTypeExistsCheck(schemaName, fromName)),
|
|
100
|
+
step(
|
|
101
|
+
`ensure type "${toName}" does not already exist`,
|
|
102
|
+
enumTypeExistsCheck(schemaName, toName, false),
|
|
103
|
+
),
|
|
104
|
+
],
|
|
105
|
+
execute: [
|
|
106
|
+
step(
|
|
107
|
+
`rename type "${fromName}" to "${toName}"`,
|
|
108
|
+
`ALTER TYPE ${qualifiedFrom} RENAME TO ${quoteIdentifier(toName)}`,
|
|
109
|
+
),
|
|
110
|
+
],
|
|
111
|
+
postcheck: [step(`verify type "${toName}" exists`, enumTypeExistsCheck(schemaName, toName))],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';
|
|
2
|
+
import { qualifyTableName, toRegclassLiteral } from '../planner-sql-checks';
|
|
3
|
+
import { type Op, step, targetDetails } from './shared';
|
|
4
|
+
|
|
5
|
+
export function createIndex(
|
|
6
|
+
schemaName: string,
|
|
7
|
+
tableName: string,
|
|
8
|
+
indexName: string,
|
|
9
|
+
columns: readonly string[],
|
|
10
|
+
): Op {
|
|
11
|
+
const qualified = qualifyTableName(schemaName, tableName);
|
|
12
|
+
const columnList = columns.map(quoteIdentifier).join(', ');
|
|
13
|
+
return {
|
|
14
|
+
id: `index.${tableName}.${indexName}`,
|
|
15
|
+
label: `Create index "${indexName}" on "${tableName}"`,
|
|
16
|
+
operationClass: 'additive',
|
|
17
|
+
target: targetDetails('index', indexName, schemaName, tableName),
|
|
18
|
+
precheck: [
|
|
19
|
+
step(
|
|
20
|
+
`ensure index "${indexName}" does not exist`,
|
|
21
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NULL`,
|
|
22
|
+
),
|
|
23
|
+
],
|
|
24
|
+
execute: [
|
|
25
|
+
step(
|
|
26
|
+
`create index "${indexName}"`,
|
|
27
|
+
`CREATE INDEX ${quoteIdentifier(indexName)} ON ${qualified} (${columnList})`,
|
|
28
|
+
),
|
|
29
|
+
],
|
|
30
|
+
postcheck: [
|
|
31
|
+
step(
|
|
32
|
+
`verify index "${indexName}" exists`,
|
|
33
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NOT NULL`,
|
|
34
|
+
),
|
|
35
|
+
],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function dropIndex(schemaName: string, tableName: string, indexName: string): Op {
|
|
40
|
+
return {
|
|
41
|
+
id: `dropIndex.${tableName}.${indexName}`,
|
|
42
|
+
label: `Drop index "${indexName}"`,
|
|
43
|
+
operationClass: 'destructive',
|
|
44
|
+
target: targetDetails('index', indexName, schemaName, tableName),
|
|
45
|
+
precheck: [
|
|
46
|
+
step(
|
|
47
|
+
`ensure index "${indexName}" exists`,
|
|
48
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NOT NULL`,
|
|
49
|
+
),
|
|
50
|
+
],
|
|
51
|
+
execute: [
|
|
52
|
+
step(`drop index "${indexName}"`, `DROP INDEX ${qualifyTableName(schemaName, indexName)}`),
|
|
53
|
+
],
|
|
54
|
+
postcheck: [
|
|
55
|
+
step(
|
|
56
|
+
`verify index "${indexName}" does not exist`,
|
|
57
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, indexName)}) IS NULL`,
|
|
58
|
+
),
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Op } from './shared';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Identity factory for an already-materialized `SqlMigrationPlanOperation`.
|
|
5
|
+
*
|
|
6
|
+
* The planner uses this via `liftOpToCall` to carry ops produced by SQL
|
|
7
|
+
* family methods, codec control hooks, and component database dependencies
|
|
8
|
+
* alongside migration IR without reverse-engineering them. Users writing
|
|
9
|
+
* raw migrations can pass a full op shape directly — typically built by
|
|
10
|
+
* composing SQL family helpers — to author a migration that bypasses the
|
|
11
|
+
* structured call classes.
|
|
12
|
+
*/
|
|
13
|
+
export function rawSql(op: Op): Op {
|
|
14
|
+
return op;
|
|
15
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';
|
|
2
|
+
import type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';
|
|
3
|
+
import type { ReferentialAction } from '@prisma-next/sql-contract/types';
|
|
4
|
+
import { ifDefined } from '@prisma-next/utils/defined';
|
|
5
|
+
import type { OperationClass, PostgresPlanTargetDetails } from '../planner-target-details';
|
|
6
|
+
|
|
7
|
+
export type Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Literal-args shape for a column definition consumed by `createTable` and
|
|
11
|
+
* `addColumn`. Fully materialized: codec expansion and default rendering have
|
|
12
|
+
* already happened in the wrapper.
|
|
13
|
+
*
|
|
14
|
+
* - `typeSql` is the column's DDL type string (e.g. `"integer"`, `"SERIAL"`,
|
|
15
|
+
* `"varchar(100)"`), already produced by `buildColumnTypeSql` in the
|
|
16
|
+
* call-factory wrapper.
|
|
17
|
+
* - `defaultSql` is the full `DEFAULT …` clause (e.g. `"DEFAULT 42"`) or an
|
|
18
|
+
* empty string when the column has no default, matching
|
|
19
|
+
* `buildColumnDefaultSql`'s output.
|
|
20
|
+
*/
|
|
21
|
+
export interface ColumnSpec {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly typeSql: string;
|
|
24
|
+
readonly defaultSql: string;
|
|
25
|
+
readonly nullable: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Literal-args shape for a foreign key definition. The referenced table is
|
|
30
|
+
* assumed to live in the same schema as the constrained table.
|
|
31
|
+
*/
|
|
32
|
+
export interface ForeignKeySpec {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly columns: readonly string[];
|
|
35
|
+
readonly references: {
|
|
36
|
+
readonly table: string;
|
|
37
|
+
readonly columns: readonly string[];
|
|
38
|
+
};
|
|
39
|
+
readonly onDelete?: ReferentialAction;
|
|
40
|
+
readonly onUpdate?: ReferentialAction;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function step(description: string, sql: string) {
|
|
44
|
+
return { description, sql };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function targetDetails(
|
|
48
|
+
objectType: OperationClass,
|
|
49
|
+
name: string,
|
|
50
|
+
schema: string,
|
|
51
|
+
table?: string,
|
|
52
|
+
): { readonly id: 'postgres'; readonly details: PostgresPlanTargetDetails } {
|
|
53
|
+
return {
|
|
54
|
+
id: 'postgres',
|
|
55
|
+
details: { schema, objectType, name, ...ifDefined('table', table) },
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function renderColumnDefinition(column: ColumnSpec): string {
|
|
60
|
+
const parts = [
|
|
61
|
+
quoteIdentifier(column.name),
|
|
62
|
+
column.typeSql,
|
|
63
|
+
column.defaultSql,
|
|
64
|
+
column.nullable ? '' : 'NOT NULL',
|
|
65
|
+
].filter(Boolean);
|
|
66
|
+
return parts.join(' ');
|
|
67
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { quoteIdentifier } from '@prisma-next/adapter-postgres/control';
|
|
2
|
+
import { qualifyTableName, toRegclassLiteral } from '../planner-sql-checks';
|
|
3
|
+
import { type ColumnSpec, type Op, renderColumnDefinition, step, targetDetails } from './shared';
|
|
4
|
+
|
|
5
|
+
export function createTable(
|
|
6
|
+
schemaName: string,
|
|
7
|
+
tableName: string,
|
|
8
|
+
columns: ReadonlyArray<ColumnSpec>,
|
|
9
|
+
primaryKey?: { readonly columns: readonly string[] },
|
|
10
|
+
): Op {
|
|
11
|
+
const qualified = qualifyTableName(schemaName, tableName);
|
|
12
|
+
const columnDefs = columns.map(renderColumnDefinition);
|
|
13
|
+
const constraintDefs: string[] = [];
|
|
14
|
+
if (primaryKey) {
|
|
15
|
+
constraintDefs.push(`PRIMARY KEY (${primaryKey.columns.map(quoteIdentifier).join(', ')})`);
|
|
16
|
+
}
|
|
17
|
+
const allDefs = [...columnDefs, ...constraintDefs];
|
|
18
|
+
const createSql = `CREATE TABLE ${qualified} (\n ${allDefs.join(',\n ')}\n)`;
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
id: `table.${tableName}`,
|
|
22
|
+
label: `Create table "${tableName}"`,
|
|
23
|
+
summary: `Creates table "${tableName}"`,
|
|
24
|
+
operationClass: 'additive',
|
|
25
|
+
target: targetDetails('table', tableName, schemaName),
|
|
26
|
+
precheck: [
|
|
27
|
+
step(
|
|
28
|
+
`ensure table "${tableName}" does not exist`,
|
|
29
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NULL`,
|
|
30
|
+
),
|
|
31
|
+
],
|
|
32
|
+
execute: [step(`create table "${tableName}"`, createSql)],
|
|
33
|
+
postcheck: [
|
|
34
|
+
step(
|
|
35
|
+
`verify table "${tableName}" exists`,
|
|
36
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NOT NULL`,
|
|
37
|
+
),
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function dropTable(schemaName: string, tableName: string): Op {
|
|
43
|
+
const qualified = qualifyTableName(schemaName, tableName);
|
|
44
|
+
return {
|
|
45
|
+
id: `dropTable.${tableName}`,
|
|
46
|
+
label: `Drop table "${tableName}"`,
|
|
47
|
+
operationClass: 'destructive',
|
|
48
|
+
target: targetDetails('table', tableName, schemaName),
|
|
49
|
+
precheck: [
|
|
50
|
+
step(
|
|
51
|
+
`ensure table "${tableName}" exists`,
|
|
52
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NOT NULL`,
|
|
53
|
+
),
|
|
54
|
+
],
|
|
55
|
+
execute: [step(`drop table "${tableName}"`, `DROP TABLE ${qualified}`)],
|
|
56
|
+
postcheck: [
|
|
57
|
+
step(
|
|
58
|
+
`verify table "${tableName}" does not exist`,
|
|
59
|
+
`SELECT to_regclass(${toRegclassLiteral(schemaName, tableName)}) IS NULL`,
|
|
60
|
+
),
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Planner-produced Postgres migration.
|
|
3
|
+
*
|
|
4
|
+
* Returned by `PostgresMigrationPlanner.plan(...)` and `emptyMigration(...)`.
|
|
5
|
+
* Holds the migration IR (`PostgresOpFactoryCall[]`) alongside
|
|
6
|
+
* `MigrationMeta` and exposes both the runtime-ops view (`get operations`)
|
|
7
|
+
* and the TypeScript authoring view (`renderTypeScript()`). Satisfies
|
|
8
|
+
* `MigrationPlanWithAuthoringSurface` so the CLI can uniformly serialize any
|
|
9
|
+
* planner result back to `migration.ts`.
|
|
10
|
+
*
|
|
11
|
+
* Extends the family-level `SqlMigration` alias rather than the target-local
|
|
12
|
+
* migration base directly — mirrors Mongo's `PlannerProducedMongoMigration`
|
|
13
|
+
* shape and keeps CLI wiring one step removed from target internals.
|
|
14
|
+
*
|
|
15
|
+
* Placeholder-bearing plans: `renderTypeScript()` always succeeds and embeds
|
|
16
|
+
* `() => placeholder("slot")` at each stub. `operations`, in contrast, is
|
|
17
|
+
* _not safe to enumerate_ on a stub-bearing plan — `DataTransformCall.toOp()`
|
|
18
|
+
* throws `PN-MIG-2001` because a planner-stubbed closure cannot be lowered
|
|
19
|
+
* to a runtime op. Callers that know a plan may carry stubs must render to
|
|
20
|
+
* `migration.ts`, let the user fill the slots, and re-load the edited
|
|
21
|
+
* migration before enumerating ops. The walk-schema planner does not emit
|
|
22
|
+
* `DataTransformCall`s today, so this asymmetry is invisible until the
|
|
23
|
+
* issue-planner integration lands in Phase 2.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import type { SqlMigrationPlanOperation } from '@prisma-next/family-sql/control';
|
|
27
|
+
import type { MigrationPlanWithAuthoringSurface } from '@prisma-next/framework-components/control';
|
|
28
|
+
import type { MigrationMeta } from '@prisma-next/migration-tools/migration';
|
|
29
|
+
import { ifDefined } from '@prisma-next/utils/defined';
|
|
30
|
+
import type { PostgresOpFactoryCall } from './op-factory-call';
|
|
31
|
+
import type { PostgresPlanTargetDetails } from './planner-target-details';
|
|
32
|
+
import { PostgresMigration } from './postgres-migration';
|
|
33
|
+
import { renderOps } from './render-ops';
|
|
34
|
+
import { renderCallsToTypeScript } from './render-typescript';
|
|
35
|
+
|
|
36
|
+
type Op = SqlMigrationPlanOperation<PostgresPlanTargetDetails>;
|
|
37
|
+
|
|
38
|
+
export class TypeScriptRenderablePostgresMigration
|
|
39
|
+
extends PostgresMigration
|
|
40
|
+
implements MigrationPlanWithAuthoringSurface
|
|
41
|
+
{
|
|
42
|
+
readonly #calls: readonly PostgresOpFactoryCall[];
|
|
43
|
+
readonly #meta: MigrationMeta;
|
|
44
|
+
|
|
45
|
+
constructor(calls: readonly PostgresOpFactoryCall[], meta: MigrationMeta) {
|
|
46
|
+
super();
|
|
47
|
+
this.#calls = calls;
|
|
48
|
+
this.#meta = meta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override get operations(): readonly Op[] {
|
|
52
|
+
return renderOps(this.#calls);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override describe(): MigrationMeta {
|
|
56
|
+
return this.#meta;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
renderTypeScript(): string {
|
|
60
|
+
return renderCallsToTypeScript(this.#calls, {
|
|
61
|
+
from: this.#meta.from,
|
|
62
|
+
to: this.#meta.to,
|
|
63
|
+
...ifDefined('kind', this.#meta.kind),
|
|
64
|
+
...ifDefined('labels', this.#meta.labels),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|