@vibeorm/migrate 2.0.0-alpha.8 → 2.0.0
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/README.md +2 -2
- package/dist/ddl/mysql.d.ts.map +1 -1
- package/dist/ddl/postgres.d.ts.map +1 -1
- package/dist/ddl/rls.d.ts +40 -0
- package/dist/ddl/rls.d.ts.map +1 -0
- package/dist/ddl/sqlite.d.ts +18 -1
- package/dist/ddl/sqlite.d.ts.map +1 -1
- package/dist/differ.d.ts +8 -0
- package/dist/differ.d.ts.map +1 -1
- package/dist/down.d.ts +2 -0
- package/dist/down.d.ts.map +1 -1
- package/dist/enum-values.d.ts +14 -1
- package/dist/enum-values.d.ts.map +1 -1
- package/dist/execute.d.ts +62 -4
- package/dist/execute.d.ts.map +1 -1
- package/dist/execution.d.ts +168 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3631 -1960
- package/dist/index.js.map +28 -22
- package/dist/introspect/mysql.d.ts.map +1 -1
- package/dist/introspect/postgres-rls.d.ts +41 -0
- package/dist/introspect/postgres-rls.d.ts.map +1 -0
- package/dist/introspect/postgres.d.ts +5 -0
- package/dist/introspect/postgres.d.ts.map +1 -1
- package/dist/introspect/sqlite.d.ts.map +1 -1
- package/dist/journal-table.d.ts +15 -0
- package/dist/journal-table.d.ts.map +1 -0
- package/dist/mysql-types.d.ts.map +1 -1
- package/dist/normalize.d.ts +24 -4
- package/dist/normalize.d.ts.map +1 -1
- package/dist/postgres-types.d.ts.map +1 -1
- package/dist/push.d.ts +6 -0
- package/dist/push.d.ts.map +1 -1
- package/dist/recovery.d.ts +41 -0
- package/dist/recovery.d.ts.map +1 -0
- package/dist/relations.d.ts +2 -2
- package/dist/relations.d.ts.map +1 -1
- package/dist/renames.d.ts +58 -0
- package/dist/renames.d.ts.map +1 -0
- package/dist/runner.d.ts +39 -4
- package/dist/runner.d.ts.map +1 -1
- package/dist/sqlite-types.d.ts.map +1 -1
- package/dist/types.d.ts +98 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../src/introspect/mysql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"mysql.d.ts","sourceRoot":"","sources":["../../src/introspect/mysql.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,KAAK,EAUV,QAAQ,EACT,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyH/C,uEAAuE;AACvE,wBAAsB,eAAe,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CA6M1F"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SchemaIR } from "@vibeorm/schema";
|
|
2
|
+
import type { SqlExecutor } from "../types.ts";
|
|
3
|
+
/** Catalog attributes are intentionally not represented as authored policy declarations. */
|
|
4
|
+
export type PostgresRlsPolicy = {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly command: string;
|
|
7
|
+
readonly permissive: boolean;
|
|
8
|
+
readonly roles: string;
|
|
9
|
+
readonly using: string | null;
|
|
10
|
+
readonly withCheck: string | null;
|
|
11
|
+
readonly comment: string | null;
|
|
12
|
+
};
|
|
13
|
+
/** Every public ordinary/partitioned table, including tables with flags but no policies. */
|
|
14
|
+
export type PostgresRlsTable = {
|
|
15
|
+
readonly table: string;
|
|
16
|
+
readonly enabled: boolean;
|
|
17
|
+
readonly force: boolean;
|
|
18
|
+
readonly policies: readonly PostgresRlsPolicy[];
|
|
19
|
+
};
|
|
20
|
+
/** Read both clauses and all structural attributes; callers pin search_path and transaction. */
|
|
21
|
+
export declare function readPostgresRls(params: {
|
|
22
|
+
executor: SqlExecutor;
|
|
23
|
+
}): Promise<PostgresRlsTable[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Compare against a trusted deployed declaration, not a policy name/comment/hash.
|
|
26
|
+
* An explicit previousSchema/status check requires every declared policy to exist.
|
|
27
|
+
* Push without a previous schema permits installing protection on an ordinary table.
|
|
28
|
+
* Must run inside the caller's transaction. Locks survive the rolled-back probe.
|
|
29
|
+
*/
|
|
30
|
+
export declare function verifyPostgresRls(params: {
|
|
31
|
+
executor: SqlExecutor;
|
|
32
|
+
schema?: SchemaIR;
|
|
33
|
+
requireInstalled?: boolean;
|
|
34
|
+
}): Promise<ReadonlySet<string>>;
|
|
35
|
+
/** Attach only verified declarations, mapped to the physical names introspection uses. No SQL parsing. */
|
|
36
|
+
export declare function projectPostgresRls(params: {
|
|
37
|
+
physical: SchemaIR;
|
|
38
|
+
declared?: SchemaIR;
|
|
39
|
+
matched: ReadonlySet<string>;
|
|
40
|
+
}): SchemaIR;
|
|
41
|
+
//# sourceMappingURL=postgres-rls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postgres-rls.d.ts","sourceRoot":"","sources":["../../src/introspect/postgres-rls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAwB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,4FAA4F;AAC5F,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,CAAC;AACF,4FAA4F;AAC5F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACjD,CAAC;AAeF,gGAAgG;AAChG,wBAAsB,eAAe,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAepG;AAUD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE;IAC9C,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAyD/B;AAED,0GAA0G;AAC1G,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,GAAG,QAAQ,CAsB9H"}
|
|
@@ -21,5 +21,10 @@ import type { SqlExecutor } from "../types.ts";
|
|
|
21
21
|
/** Introspect a live postgres/pglite database (public schema) into SchemaIR. */
|
|
22
22
|
export declare function introspectPostgres(params: {
|
|
23
23
|
executor: SqlExecutor;
|
|
24
|
+
/** Trusted policy declaration; missing this refuses lossy RLS introspection/export. */
|
|
25
|
+
rlsSchema?: SchemaIR;
|
|
26
|
+
/** The caller owns BEGIN/COMMIT, keeping probe locks through subsequent migration DDL. */
|
|
27
|
+
inTransaction?: boolean;
|
|
28
|
+
requireInstalledRls?: boolean;
|
|
24
29
|
}): Promise<SchemaIR>;
|
|
25
30
|
//# sourceMappingURL=postgres.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/introspect/postgres.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/introspect/postgres.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAQH,OAAO,KAAK,EASV,QAAQ,EACT,MAAM,iBAAiB,CAAC;AASzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA0L/C,gFAAgF;AAChF,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,QAAQ,EAAE,WAAW,CAAC;IACtB,uFAAuF;IACvF,SAAS,CAAC,EAAE,QAAQ,CAAC;IACrB,0FAA0F;IAC1F,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuBpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/introspect/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;
|
|
1
|
+
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/introspect/sqlite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,OAAO,KAAK,EAQV,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAUzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAyB/C,uDAAuD;AACvD,wBAAsB,gBAAgB,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,WAAW,CAAA;CAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuI3F;AAwGD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,EAAE,GAAG,IAAI,CAqD3C"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bookkeeping table's name, alone in a leaf module.
|
|
3
|
+
*
|
|
4
|
+
* It used to live in runner.ts, which the three introspectors import while
|
|
5
|
+
* runner.ts is itself importing THEM — a cycle whose outcome depended on which
|
|
6
|
+
* module the process happened to evaluate first, and which surfaced as
|
|
7
|
+
* "Cannot access 'MIGRATIONS_TABLE_NAME' before initialization" as soon as the
|
|
8
|
+
* import order shifted. A leaf module has no such ordering: it can be
|
|
9
|
+
* evaluated before anything that needs it.
|
|
10
|
+
*
|
|
11
|
+
* runner.ts re-exports the name, so the public surface is unchanged.
|
|
12
|
+
*/
|
|
13
|
+
/** Name of the migrations bookkeeping table (skipped by introspection). */
|
|
14
|
+
export declare const MIGRATIONS_TABLE_NAME: string;
|
|
15
|
+
//# sourceMappingURL=journal-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"journal-table.d.ts","sourceRoot":"","sources":["../src/journal-table.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,EAAE,MAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mysql-types.d.ts","sourceRoot":"","sources":["../src/mysql-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"mysql-types.d.ts","sourceRoot":"","sources":["../src/mysql-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,O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ect;
|
|
97
97
|
}): NormalizedSchema;
|
|
98
|
+
/** Refuse string storage that cannot preserve every enum label verbatim. */
|
|
99
|
+
export declare function assertStringEnumLabelsFit(params: {
|
|
100
|
+
field: FieldIR;
|
|
101
|
+
values: readonly string[];
|
|
102
|
+
dialect: Dialect;
|
|
103
|
+
table: string;
|
|
104
|
+
}): void;
|
|
98
105
|
/** Dialect-routed column type comparison key. */
|
|
99
106
|
export declare function columnTypeKeyFor(params: {
|
|
100
107
|
field: FieldIR;
|
|
@@ -107,10 +114,23 @@ export declare function defaultFingerprintFor(params: {
|
|
|
107
114
|
dialect: Dialect;
|
|
108
115
|
}): string | null;
|
|
109
116
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
117
|
+
* Comparison key for a partial-index predicate.
|
|
118
|
+
*
|
|
119
|
+
* The engines re-serialize these expressions on introspection (postgres adds
|
|
120
|
+
* parentheses around every operand, quotes identifiers and appends `::type`
|
|
121
|
+
* casts), so the key must absorb THAT and nothing else. Erasing quotes,
|
|
122
|
+
* parentheses and case wholesale (what this did before, F29) made
|
|
123
|
+
* `'ACTIVE'` equal to `'active'` and `(a OR b) AND c` equal to
|
|
124
|
+
* `a OR (b AND c)` — two different indexes comparing equal is a migration
|
|
125
|
+
* step that never gets generated.
|
|
126
|
+
*
|
|
127
|
+
* So: string literals keep their bytes; identifiers and keywords fold to lower
|
|
128
|
+
* case and lose their quoting; `::type` casts and REDUNDANT parentheses are
|
|
129
|
+
* dropped by parsing the boolean structure and re-emitting it with the minimum
|
|
130
|
+
* parenthesization, which keeps genuine grouping differences visible.
|
|
131
|
+
*
|
|
132
|
+
* A predicate this parser cannot read falls back to its token sequence — never
|
|
133
|
+
* to the old lossy key.
|
|
114
134
|
*/
|
|
115
135
|
export declare function normalizeWhere(params: {
|
|
116
136
|
where: string | undefined;
|
package/dist/normalize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,OAAO,EACP,MAAM,EACN,OAAO,EAEP,OAAO,EACP,QAAQ,EACT,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,OAAO,EACP,MAAM,EACN,OAAO,EAEP,OAAO,EACP,QAAQ,EACT,MAAM,iBAAiB,CAAC;AAYzB,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI5D,qCAAqC;AACrC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,sBAAsB;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MA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AG,MAAM,CAI5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-types.d.ts","sourceRoot":"","sources":["../src/postgres-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK1E,kDAAkD;AAClD,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAU7D,CAAC;AA+CF;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAMnE;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAmBhE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAMrF;AAID,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAsBhE;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAQpE;AAID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"postgres-types.d.ts","sourceRoot":"","sources":["../src/postgres-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAK1E,kDAAkD;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,CAMtE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE;IACtC,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,OAAO,CAAC;CACnB,GAAG,aAAa,CAGhB;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,aAAa,GAAG,SAAS,CAAA;CAAE,GAAG,aAAa,CAE9F;AAID,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAE/D"}
|
package/dist/push.d.ts
CHANGED
|
@@ -31,6 +31,12 @@ export declare function push(params: {
|
|
|
31
31
|
executor: SqlExecutor;
|
|
32
32
|
schema: SchemaIR;
|
|
33
33
|
acceptDataLoss?: boolean;
|
|
34
|
+
/** Separate authorization for removing or potentially widening native policies. */
|
|
35
|
+
acceptSecurityChanges?: boolean;
|
|
36
|
+
/** Deployed declaration when changing a policy or its referenced columns. */
|
|
37
|
+
previousSchema?: SchemaIR;
|
|
38
|
+
/** Return planned SQL and security changes without applying or requiring acknowledgements. */
|
|
39
|
+
dryRun?: boolean;
|
|
34
40
|
/** Configured extension instances — their artifacts apply with the diff. */
|
|
35
41
|
extensions?: readonly VibeExtension[];
|
|
36
42
|
}): Promise<PushResult>;
|
package/dist/push.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../src/push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAqB,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAuB3F,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CAAC,MAAM,EAAE;IACjC,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,EAAE,QAAQ,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mFAAmF;IACnF,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,6EAA6E;IAC7E,cAAc,CAAC,EAAE,QAAQ,CAAC;IAC1B,8FAA8F;IAC9F,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACvC,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBtB;AAiJD;;;GAGG;AACH,wBAAsB,IAAI,CAAC,MAAM,EAAE;IACjC,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAGpB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Establishing what actually happened, before a nontransactional migration
|
|
3
|
+
* re-runs anything.
|
|
4
|
+
*
|
|
5
|
+
* A migration that runs outside a transaction can die between a statement
|
|
6
|
+
* committing and the journal recording it. The only honest recovery is to ask
|
|
7
|
+
* the database what the world looks like now and compare it against the
|
|
8
|
+
* statement's DECLARED postcondition (execution.ts). Three answers exist:
|
|
9
|
+
*
|
|
10
|
+
* - `"satisfied"` — the live catalog already matches the declaration. Skip it.
|
|
11
|
+
* - `"runnable"` — the declaration is demonstrably not in effect, and running
|
|
12
|
+
* the statement is the way to get there.
|
|
13
|
+
* - a thrown `VibeError` — the state is neither, and no automatic action is
|
|
14
|
+
* safe. Nothing is dropped, nothing is re-run: the operator decides.
|
|
15
|
+
*
|
|
16
|
+
* There is deliberately NO fourth answer of the form "probably fine, re-run
|
|
17
|
+
* it". This module never claims exactly-once execution of arbitrary SQL; it
|
|
18
|
+
* only decides the cases a declared postcondition can actually settle.
|
|
19
|
+
*
|
|
20
|
+
* Comparison is conservative by design. Expressions must match verbatim apart
|
|
21
|
+
* from surrounding whitespace. Quotes and whitespace inside literals can change
|
|
22
|
+
* meaning; any difference is a CONFLICT — a false conflict costs an operator one
|
|
23
|
+
* look, a false match corrupts a schema.
|
|
24
|
+
*/
|
|
25
|
+
import type { Dialect } from "@vibeorm/schema";
|
|
26
|
+
import type { MigrationOperation } from "./execution.ts";
|
|
27
|
+
import type { SqlExecutor } from "./types.ts";
|
|
28
|
+
/** Whether a declared operation's postcondition already holds. */
|
|
29
|
+
export type OperationState = "satisfied" | "runnable";
|
|
30
|
+
/**
|
|
31
|
+
* Ask the database whether a declared operation is already in effect.
|
|
32
|
+
*
|
|
33
|
+
* PostgreSQL only: it is the one dialect with a nontransactional migration
|
|
34
|
+
* regime here, and every probe reads its catalogs.
|
|
35
|
+
*/
|
|
36
|
+
export declare function establishOperationState(params: {
|
|
37
|
+
executor: SqlExecutor;
|
|
38
|
+
dialect: Dialect;
|
|
39
|
+
operation: MigrationOperation;
|
|
40
|
+
}): Promise<OperationState>;
|
|
41
|
+
//# sourceMappingURL=recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.d.ts","sourceRoot":"","sources":["../src/recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAS/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC;AA6BtD;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,MAAM,EAAE;IACpD,QAAQ,EAAE,WAAW,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,kBAAkB,CAAC;CAC/B,GAAG,OAAO,CAAC,cAAc,CAAC,CAkG1B"}
|
package/dist/relations.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Implicit many-to-many detection on Schema IR.
|
|
3
3
|
*
|
|
4
|
-
* ONE structural rule,
|
|
5
|
-
*
|
|
4
|
+
* ONE structural rule in @vibeorm/schema, also used by RLS validation and
|
|
5
|
+
* matching the parser's ambiguity rule (see LEARNINGS): two fields form an
|
|
6
6
|
* implicit M:N **iff** both are lists that declare no FK columns, they are
|
|
7
7
|
* distinct fields (self-exclusion — a 1:N self-relation must never pair with
|
|
8
8
|
* itself), their relation names match symmetrically (both unnamed, or both
|
package/dist/relations.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../src/relations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"relations.d.ts","sourceRoot":"","sources":["../src/relations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GAAG,eAAe,EAAE,CA4BtF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXPLICIT physical renames.
|
|
3
|
+
*
|
|
4
|
+
* The differ deliberately has no rename detection: two schemas that differ by
|
|
5
|
+
* a name are indistinguishable from a drop plus a create, and guessing between
|
|
6
|
+
* them from "similar shapes" is how a migration tool silently destroys a
|
|
7
|
+
* column. A rename therefore only ever happens because someone WROTE one down,
|
|
8
|
+
* as an old physical name and a new physical name, and it is validated against
|
|
9
|
+
* both schemas before a single statement is rendered.
|
|
10
|
+
*
|
|
11
|
+
* `@map` / `@@map` remains the no-DDL option: mapping a model or field to the
|
|
12
|
+
* name the database already uses changes generated code only. Use a rename
|
|
13
|
+
* intent when the DATABASE object must actually move.
|
|
14
|
+
*
|
|
15
|
+
* What a physical rename preserves, on every dialect that supports it: the
|
|
16
|
+
* rows, the column defaults, the indexes and constraints attached to the
|
|
17
|
+
* object, and inbound foreign keys — the object keeps its identity, only its
|
|
18
|
+
* name changes. PostgreSQL policy expressions follow the rename too, because
|
|
19
|
+
* they are stored parsed and reference the object by identity, not by text.
|
|
20
|
+
*
|
|
21
|
+
* What refuses instead of guessing: renaming a table and one of its columns in
|
|
22
|
+
* the same plan (the second intent's table name is then ambiguous), an intent
|
|
23
|
+
* whose endpoints do not both check out against the two schemas, and two
|
|
24
|
+
* intents pointing at the same object.
|
|
25
|
+
*/
|
|
26
|
+
import type { Dialect, SchemaIR } from "@vibeorm/schema";
|
|
27
|
+
import type { MigrationStep } from "./types.ts";
|
|
28
|
+
/** One deliberately written rename, in PHYSICAL (database) names. */
|
|
29
|
+
export type RenameIntent = {
|
|
30
|
+
readonly kind: "table";
|
|
31
|
+
readonly from: string;
|
|
32
|
+
readonly to: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: "column";
|
|
35
|
+
readonly table: string;
|
|
36
|
+
readonly from: string;
|
|
37
|
+
readonly to: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Validate rename intents against the two schemas and turn them into steps,
|
|
41
|
+
* returning the SOURCE schema rewritten as if the renames had happened.
|
|
42
|
+
*
|
|
43
|
+
* The rewrite is what keeps the rest of the diff honest: once the source model
|
|
44
|
+
* carries the new physical name, the ordinary differ sees one table on both
|
|
45
|
+
* sides and emits no drop/create pair for it. Only `dbName` moves — the
|
|
46
|
+
* logical IR graph (relations, index field lists) is untouched, so nothing
|
|
47
|
+
* downstream has to know a rename happened.
|
|
48
|
+
*/
|
|
49
|
+
export declare function planRenames(params: {
|
|
50
|
+
from: SchemaIR;
|
|
51
|
+
to: SchemaIR;
|
|
52
|
+
renames: readonly RenameIntent[];
|
|
53
|
+
dialect: Dialect;
|
|
54
|
+
}): {
|
|
55
|
+
readonly steps: readonly MigrationStep[];
|
|
56
|
+
readonly from: SchemaIR;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=renames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renames.d.ts","sourceRoot":"","sources":["../src/renames.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAW,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,qEAAqE;AACrE,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAuBpG;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,QAAQ,CAAC;IACb,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAkGxE"}
|
package/dist/runner.d.ts
CHANGED
|
@@ -54,17 +54,27 @@
|
|
|
54
54
|
* a silent divergence.
|
|
55
55
|
*/
|
|
56
56
|
import type { Dialect, SchemaIR, VibeExtension } from "@vibeorm/schema";
|
|
57
|
-
import type {
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
import type { MigrationExecution } from "./execution.ts";
|
|
58
|
+
import type { RenameIntent } from "./renames.ts";
|
|
59
|
+
import type { AppliedResult, MigrationFile, MigrationStatus, RecordedMigration, SqlExecutor } from "./types.ts";
|
|
60
|
+
export { MIGRATIONS_TABLE_NAME } from "./journal-table.ts";
|
|
60
61
|
/** Create the bookkeeping table when missing. */
|
|
61
62
|
export declare function ensureMigrationsTable(params: {
|
|
62
63
|
executor: SqlExecutor;
|
|
63
64
|
dialect?: Dialect;
|
|
64
65
|
}): Promise<void>;
|
|
65
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* sha256 hex over the migration's statements — its identity across runs.
|
|
68
|
+
*
|
|
69
|
+
* A NON-default execution block (execution.ts) folds a canonical description
|
|
70
|
+
* of itself in, so changing how a migration executes after it was applied is
|
|
71
|
+
* caught by the same checksum refusal that catches changing its SQL. A default
|
|
72
|
+
* or absent block contributes NOTHING, which is what keeps every migration
|
|
73
|
+
* written before this feature — and every journal row recording one — valid.
|
|
74
|
+
*/
|
|
66
75
|
export declare function migrationChecksum(params: {
|
|
67
76
|
sql: readonly string[];
|
|
77
|
+
execution?: MigrationExecution;
|
|
68
78
|
}): string;
|
|
69
79
|
/**
|
|
70
80
|
* Diff two IRs and render a named migration for a dialect (postgres if
|
|
@@ -79,6 +89,10 @@ export declare function generateMigration(params: {
|
|
|
79
89
|
dialect?: Dialect;
|
|
80
90
|
/** Configured extension instances — their artifacts land in the migration. */
|
|
81
91
|
extensions?: readonly VibeExtension[];
|
|
92
|
+
/** Explicit physical renames (renames.ts); never inferred from the diff. */
|
|
93
|
+
renames?: readonly RenameIntent[];
|
|
94
|
+
/** Explicit execution semantics for the generated file. */
|
|
95
|
+
execution?: MigrationExecution;
|
|
82
96
|
}): MigrationFile;
|
|
83
97
|
/**
|
|
84
98
|
* Apply migrations in order under an advisory lock (see module doc).
|
|
@@ -92,6 +106,7 @@ export declare function generateMigration(params: {
|
|
|
92
106
|
export declare function applyMigrations(params: {
|
|
93
107
|
executor: SqlExecutor;
|
|
94
108
|
migrations: readonly MigrationFile[];
|
|
109
|
+
acceptSecurityChanges?: boolean;
|
|
95
110
|
/** Execution dialect; postgres if omitted. */
|
|
96
111
|
dialect?: Dialect;
|
|
97
112
|
}): Promise<AppliedResult>;
|
|
@@ -101,7 +116,26 @@ export declare function migrationStatus(params: {
|
|
|
101
116
|
migrations: readonly MigrationFile[];
|
|
102
117
|
/** Bookkeeping dialect; postgres if omitted. */
|
|
103
118
|
dialect?: Dialect;
|
|
119
|
+
/** Trusted current deployment; policy state is verified independently of migration records. */
|
|
120
|
+
schema?: SchemaIR;
|
|
104
121
|
}): Promise<MigrationStatus>;
|
|
122
|
+
/**
|
|
123
|
+
* The bookkeeping journal itself, in the order rows were written — i.e. the
|
|
124
|
+
* order migrations were actually applied, which is what a rollback must walk
|
|
125
|
+
* backwards. Every row is returned and classified, including the ones
|
|
126
|
+
* `migrationStatus` folds away: a mismatched record, a partially applied one
|
|
127
|
+
* and a record whose file is gone all still occupy a position in history, and
|
|
128
|
+
* a caller that skips them rolls back the WRONG migration (F28).
|
|
129
|
+
*
|
|
130
|
+
* Takes no lock, exactly like `migrationStatus`.
|
|
131
|
+
*/
|
|
132
|
+
export declare function recordedMigrations(params: {
|
|
133
|
+
executor: SqlExecutor;
|
|
134
|
+
/** Known migration files — classification needs their SQL. */
|
|
135
|
+
migrations: readonly MigrationFile[];
|
|
136
|
+
/** Bookkeeping dialect; postgres if omitted. */
|
|
137
|
+
dialect?: Dialect;
|
|
138
|
+
}): Promise<RecordedMigration[]>;
|
|
105
139
|
/**
|
|
106
140
|
* Repair the bookkeeping table without running SQL: mark a migration as
|
|
107
141
|
* `"applied"` (upsert its record; pass `checksum` to also pin its content —
|
|
@@ -140,6 +174,7 @@ export declare function resolveMigration(params: {
|
|
|
140
174
|
export declare function rollbackMigration(params: {
|
|
141
175
|
executor: SqlExecutor;
|
|
142
176
|
migration: MigrationFile;
|
|
177
|
+
acceptSecurityChanges?: boolean;
|
|
143
178
|
/** Execution dialect; postgres if omitted. */
|
|
144
179
|
dialect?: Dialect;
|
|
145
180
|
}): Promise<void>;
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAIH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAUxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAqBjD,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,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.ts), so every
|
|
7
7
|
* SQL-text decision stays reviewable in one place (constitution rule 3/4).
|
|
8
8
|
*/
|
|
9
|
-
import type { CascadeAction, CheckIR, EnumIR, FieldIR } from "@vibeorm/schema";
|
|
9
|
+
import type { CascadeAction, CheckIR, EnumIR, FieldIR, SchemaIR } from "@vibeorm/schema";
|
|
10
|
+
import type { MigrationExecution } from "./execution.ts";
|
|
10
11
|
/**
|
|
11
12
|
* Minimal SQL execution contract the migrate engine runs on. Structurally
|
|
12
13
|
* identical to @vibeorm/runtime's `SqlExecutor` (its `toSqlExecutor` bridges a
|
|
@@ -55,7 +56,17 @@ export type JoinTableEnd = {
|
|
|
55
56
|
* dropEnum / narrowing type changes) — `push` refuses them without
|
|
56
57
|
* `acceptDataLoss`, and `generateMigration` surfaces the flag.
|
|
57
58
|
*/
|
|
58
|
-
export type MigrationStep = {
|
|
59
|
+
export type MigrationStep = ({
|
|
60
|
+
readonly kind: "enableRls" | "forceRls" | "disableRls" | "noForceRls" | "dropPolicy";
|
|
61
|
+
readonly table: string;
|
|
62
|
+
readonly destructive: false;
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: "createPolicy";
|
|
65
|
+
readonly table: string;
|
|
66
|
+
readonly schema: SchemaIR;
|
|
67
|
+
readonly model: string;
|
|
68
|
+
readonly destructive: false;
|
|
69
|
+
} | {
|
|
59
70
|
readonly kind: "createEnum";
|
|
60
71
|
readonly enumDef: EnumIR;
|
|
61
72
|
readonly destructive: false;
|
|
@@ -145,6 +156,53 @@ export type MigrationStep = {
|
|
|
145
156
|
readonly onDelete: CascadeAction;
|
|
146
157
|
readonly onUpdate: CascadeAction;
|
|
147
158
|
readonly destructive: false;
|
|
159
|
+
} | {
|
|
160
|
+
/**
|
|
161
|
+
* Stage a foreign key without validating existing rows (postgres
|
|
162
|
+
* `NOT VALID`). Skips the scan, NOT the brief ACCESS EXCLUSIVE lock;
|
|
163
|
+
* `validateConstraint` finishes the job under a weaker lock. sqlite and
|
|
164
|
+
* mysql have no such split and refuse this step.
|
|
165
|
+
*/
|
|
166
|
+
readonly kind: "addForeignKeyNotValid";
|
|
167
|
+
readonly table: string;
|
|
168
|
+
readonly constraintName: string;
|
|
169
|
+
readonly columns: readonly string[];
|
|
170
|
+
readonly refTable: string;
|
|
171
|
+
readonly refColumns: readonly string[];
|
|
172
|
+
readonly onDelete: CascadeAction;
|
|
173
|
+
readonly onUpdate: CascadeAction;
|
|
174
|
+
readonly destructive: false;
|
|
175
|
+
} | {
|
|
176
|
+
/** Stage a CHECK without validating existing rows (postgres `NOT VALID`). */
|
|
177
|
+
readonly kind: "addCheckNotValid";
|
|
178
|
+
readonly table: string;
|
|
179
|
+
readonly name: string;
|
|
180
|
+
/** Raw SQL expression, rendered verbatim. */
|
|
181
|
+
readonly expression: string;
|
|
182
|
+
readonly destructive: false;
|
|
183
|
+
} | {
|
|
184
|
+
/** Validate a previously staged NOT VALID constraint (postgres only). */
|
|
185
|
+
readonly kind: "validateConstraint";
|
|
186
|
+
readonly table: string;
|
|
187
|
+
readonly name: string;
|
|
188
|
+
readonly destructive: false;
|
|
189
|
+
} | {
|
|
190
|
+
/**
|
|
191
|
+
* Rename a physical table, preserving its rows, defaults, indexes and
|
|
192
|
+
* inbound foreign keys. Only ever produced from an EXPLICIT rename
|
|
193
|
+
* intent (renames.ts) — never inferred from a drop/create pair.
|
|
194
|
+
*/
|
|
195
|
+
readonly kind: "renameTable";
|
|
196
|
+
readonly from: string;
|
|
197
|
+
readonly to: string;
|
|
198
|
+
readonly destructive: false;
|
|
199
|
+
} | {
|
|
200
|
+
/** Rename a physical column, preserving its data, default and indexes. */
|
|
201
|
+
readonly kind: "renameColumn";
|
|
202
|
+
readonly table: string;
|
|
203
|
+
readonly from: string;
|
|
204
|
+
readonly to: string;
|
|
205
|
+
readonly destructive: false;
|
|
148
206
|
} | {
|
|
149
207
|
readonly kind: "dropForeignKey";
|
|
150
208
|
readonly table: string;
|
|
@@ -181,6 +239,9 @@ export type MigrationStep = {
|
|
|
181
239
|
/** View db name. */
|
|
182
240
|
readonly table: string;
|
|
183
241
|
readonly destructive: true;
|
|
242
|
+
}) & {
|
|
243
|
+
/** Separate from data loss: a removal or potentially widening policy replacement. */
|
|
244
|
+
readonly securityChange?: string;
|
|
184
245
|
};
|
|
185
246
|
/** One-line human description of a step (refusal messages, CLI output). */
|
|
186
247
|
export declare function describeStep(params: {
|
|
@@ -199,6 +260,23 @@ export type MigrationFile = {
|
|
|
199
260
|
* `rollbackMigration` refuses those with a clear error.
|
|
200
261
|
*/
|
|
201
262
|
readonly downSql?: readonly string[];
|
|
263
|
+
/** Security changes are not authorized by an ordinary data-loss acknowledgement. */
|
|
264
|
+
readonly securityChanges?: readonly string[];
|
|
265
|
+
readonly downSecurityChanges?: readonly string[];
|
|
266
|
+
/** Trusted source declarations used for drift preflight on generated migrations. */
|
|
267
|
+
readonly rls?: {
|
|
268
|
+
readonly from: SchemaIR;
|
|
269
|
+
readonly to: SchemaIR;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Explicit execution semantics (transaction mode, migration-owned session
|
|
273
|
+
* limits, declared per-statement operations). ABSENT means the dialect's
|
|
274
|
+
* existing behaviour, and hashes exactly as it always did — see
|
|
275
|
+
* execution.ts's checksum-compatibility rule.
|
|
276
|
+
*/
|
|
277
|
+
readonly execution?: MigrationExecution;
|
|
278
|
+
/** Execution semantics of `downSql`; absent means the dialect's existing behaviour. */
|
|
279
|
+
readonly downExecution?: MigrationExecution;
|
|
202
280
|
};
|
|
203
281
|
/** Result of `applyMigrations`. */
|
|
204
282
|
export type AppliedResult = {
|
|
@@ -223,11 +301,29 @@ export type MigrationStatus = {
|
|
|
223
301
|
*/
|
|
224
302
|
readonly rollingBack: readonly string[];
|
|
225
303
|
};
|
|
304
|
+
/**
|
|
305
|
+
* How one bookkeeping row stands against the migration file of the same name.
|
|
306
|
+
* `unknown-file` is a recorded migration whose file is missing from the
|
|
307
|
+
* migrations directory — history the tool cannot reverse.
|
|
308
|
+
*/
|
|
309
|
+
export type RecordedMigrationState = "applied" | "partial" | "mismatched" | "rolling-back" | "unknown-file";
|
|
310
|
+
/** One row of the `_vibe_migrations` journal, in the order it was written. */
|
|
311
|
+
export type RecordedMigration = {
|
|
312
|
+
readonly name: string;
|
|
313
|
+
/** Recorded checksum; empty for a `resolveMigration` repair record. */
|
|
314
|
+
readonly checksum: string;
|
|
315
|
+
/** Statements completed; NEGATIVE (-(k+1)) marks an unfinished rollback. */
|
|
316
|
+
readonly statementIndex: number;
|
|
317
|
+
readonly state: RecordedMigrationState;
|
|
318
|
+
};
|
|
226
319
|
/** Result of `push`. */
|
|
227
320
|
export type PushResult = {
|
|
228
321
|
/** The diff that was applied (empty = database already matched). */
|
|
229
322
|
readonly steps: readonly MigrationStep[];
|
|
230
323
|
/** The SQL statements that were executed, in order. */
|
|
231
324
|
readonly applied: readonly string[];
|
|
325
|
+
/** Dry-run statements, never executed. */
|
|
326
|
+
readonly planned?: readonly string[];
|
|
327
|
+
readonly securityChanges?: readonly string[];
|
|
232
328
|
};
|
|
233
329
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIzD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,MA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AC;CACxC,CAAC;AAEF,wBAAwB;AACxB,MAAM,MAAM,UAAU,GAAG;IACvB,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibeorm/migrate",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Migration engine for VibeORM v2 — IR differ, per-dialect DDL, migration runner, introspection",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orm",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"bun": ">=1.2.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@vibeorm/schema": "2.0.0
|
|
48
|
-
"@vibeorm/sql": "2.0.0
|
|
47
|
+
"@vibeorm/schema": "2.0.0",
|
|
48
|
+
"@vibeorm/sql": "2.0.0"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|