chkit 0.1.1 → 0.1.2-beta.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/dist/commands/migrate/command.d.ts.map +1 -1
- package/dist/commands/migrate/command.js +100 -98
- package/dist/commands/migrate/command.js.map +1 -1
- package/dist/commands/migrate/output.d.ts +52 -0
- package/dist/commands/migrate/output.d.ts.map +1 -0
- package/dist/commands/migrate/output.js +103 -0
- package/dist/commands/migrate/output.js.map +1 -0
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/command.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,gBAAgB,EAKtB,MAAM,kBAAkB,CAAA;AA4CzB,eAAO,MAAM,cAAc,EAAE,gBAK5B,CAAA"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import { mkdir
|
|
2
|
-
import {
|
|
3
|
-
import { defineFlags, typedFlags } from '../../plugins.js';
|
|
1
|
+
import { mkdir } from 'node:fs/promises';
|
|
2
|
+
import { defineFlags, typedFlags, } from '../../plugins.js';
|
|
4
3
|
import { resolveDirs } from '../../runtime/config.js';
|
|
4
|
+
import { debug } from '../../runtime/debug.js';
|
|
5
5
|
import { GLOBAL_FLAGS } from '../../runtime/global-flags.js';
|
|
6
|
-
import {
|
|
7
|
-
import { createJournalStore, resolveJournalTableName } from '../../runtime/journal-store.js';
|
|
8
|
-
import { extractMigrationMetadata } from '../../runtime/migration-metadata.js';
|
|
6
|
+
import { createJournalStore } from '../../runtime/journal-store.js';
|
|
9
7
|
import { findChecksumMismatches, listMigrations, readSnapshot, } from '../../runtime/migration-store.js';
|
|
10
|
-
import { resolveTableScope, tableKeysFromDefinitions
|
|
11
|
-
import { debug } from '../../runtime/debug.js';
|
|
8
|
+
import { resolveTableScope, tableKeysFromDefinitions } from '../../runtime/table-scope.js';
|
|
12
9
|
import { applyMigration } from './apply.js';
|
|
13
10
|
import { scanDestructive } from './destructive.js';
|
|
11
|
+
import { emitApplySummaryJson, emitChecksumMismatchJson, emitDestructiveBlockedJson, emitNoPending, emitNoScopeMatch, emitPlanJson, renderApplied, renderApplySummary, renderMigrationLog, renderPlanOnlyNotice, renderPlanText, } from './output.js';
|
|
14
12
|
import { confirmApply, confirmDestructiveExecution, isBackgroundOrCI, printDestructiveOperationDetails, } from './prompts.js';
|
|
15
13
|
import { filterPendingByScope } from './scope.js';
|
|
16
14
|
const MIGRATE_FLAGS = defineFlags([
|
|
@@ -25,6 +23,27 @@ export const migrateCommand = {
|
|
|
25
23
|
run: cmdMigrate,
|
|
26
24
|
};
|
|
27
25
|
async function cmdMigrate(runCtx) {
|
|
26
|
+
const ctx = await prepareMigration(runCtx);
|
|
27
|
+
const checksumExit = await runChecksumGate(ctx);
|
|
28
|
+
if (checksumExit !== undefined)
|
|
29
|
+
return checksumExit;
|
|
30
|
+
const scope = await resolvePendingScope(ctx);
|
|
31
|
+
if (scope.exit !== undefined)
|
|
32
|
+
return scope.exit;
|
|
33
|
+
const { pending, undeterminedScope } = scope;
|
|
34
|
+
const planExit = await renderPlan(ctx, pending, undeterminedScope);
|
|
35
|
+
if (planExit !== undefined)
|
|
36
|
+
return planExit;
|
|
37
|
+
const confirmExit = await runConfirmGate(ctx);
|
|
38
|
+
if (confirmExit !== undefined)
|
|
39
|
+
return confirmExit;
|
|
40
|
+
const destructiveExit = await runDestructiveGate(ctx, pending);
|
|
41
|
+
if (destructiveExit !== undefined)
|
|
42
|
+
return destructiveExit;
|
|
43
|
+
return applyPending(ctx, pending, undeterminedScope);
|
|
44
|
+
}
|
|
45
|
+
/** Parse flags, resolve deps, run onConfigLoaded, and load the pending set. */
|
|
46
|
+
async function prepareMigration(runCtx) {
|
|
28
47
|
const { flags, config, configPath, pluginRuntime, pluginContext } = runCtx;
|
|
29
48
|
const f = typedFlags(flags, [...GLOBAL_FLAGS, ...MIGRATE_FLAGS]);
|
|
30
49
|
const executeRequested = f['--apply'] === true || f['--execute'] === true;
|
|
@@ -54,34 +73,41 @@ async function cmdMigrate(runCtx) {
|
|
|
54
73
|
const appliedNames = new Set(journal.applied.map((entry) => entry.name));
|
|
55
74
|
const pendingAll = files.filter((file) => !appliedNames.has(file));
|
|
56
75
|
debug('migrate', `migrations: total=${files.length}, applied=${journal.applied.length}, pending=${pendingAll.length}`);
|
|
76
|
+
return {
|
|
77
|
+
jsonMode,
|
|
78
|
+
executeRequested,
|
|
79
|
+
allowDestructive,
|
|
80
|
+
mode,
|
|
81
|
+
migrationsDir,
|
|
82
|
+
db,
|
|
83
|
+
journalStore,
|
|
84
|
+
config,
|
|
85
|
+
flags,
|
|
86
|
+
pluginRuntime,
|
|
87
|
+
tableScope,
|
|
88
|
+
journal,
|
|
89
|
+
pendingAll,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Gate 1: block when applied migrations no longer match their recorded checksum. */
|
|
93
|
+
async function runChecksumGate(ctx) {
|
|
94
|
+
const { migrationsDir, journal, jsonMode, mode, tableScope } = ctx;
|
|
57
95
|
const checksumMismatches = await findChecksumMismatches(migrationsDir, journal);
|
|
58
|
-
if (checksumMismatches.length
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
error: 'Checksum mismatch detected on applied migrations',
|
|
65
|
-
checksumMismatches,
|
|
66
|
-
});
|
|
67
|
-
return 1;
|
|
68
|
-
}
|
|
69
|
-
throw new Error(`Checksum mismatch detected on applied migrations: ${checksumMismatches.map((item) => item.name).join(', ')}`);
|
|
96
|
+
if (checksumMismatches.length === 0)
|
|
97
|
+
return undefined;
|
|
98
|
+
debug('migrate', `checksum mismatches: ${checksumMismatches.map((m) => m.name).join(', ')}`);
|
|
99
|
+
if (jsonMode) {
|
|
100
|
+
emitChecksumMismatchJson({ mode, scope: tableScope, checksumMismatches });
|
|
101
|
+
return 1;
|
|
70
102
|
}
|
|
103
|
+
throw new Error(`Checksum mismatch detected on applied migrations: ${checksumMismatches.map((item) => item.name).join(', ')}`);
|
|
104
|
+
}
|
|
105
|
+
/** Resolve table scope, filter the pending set, and short-circuit empty runs. */
|
|
106
|
+
async function resolvePendingScope(ctx) {
|
|
107
|
+
const { tableScope, jsonMode, mode, migrationsDir, pendingAll } = ctx;
|
|
71
108
|
if (tableScope.enabled && tableScope.matchCount === 0) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
mode,
|
|
75
|
-
scope: tableScope,
|
|
76
|
-
pending: [],
|
|
77
|
-
applied: [],
|
|
78
|
-
warning: `No tables matched selector "${tableScope.selector ?? ''}".`,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
console.log(`No tables matched selector "${tableScope.selector ?? ''}". No migrations selected.`);
|
|
83
|
-
}
|
|
84
|
-
return 0;
|
|
109
|
+
emitNoScopeMatch({ jsonMode, mode, scope: tableScope });
|
|
110
|
+
return { exit: 0, pending: [], undeterminedScope: [] };
|
|
85
111
|
}
|
|
86
112
|
let pending = pendingAll;
|
|
87
113
|
let undeterminedScope = [];
|
|
@@ -91,69 +117,49 @@ async function cmdMigrate(runCtx) {
|
|
|
91
117
|
undeterminedScope = scoped.undetermined;
|
|
92
118
|
}
|
|
93
119
|
if (pending.length === 0) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
console.log('No pending migrations.');
|
|
99
|
-
}
|
|
100
|
-
return 0;
|
|
120
|
+
emitNoPending({ jsonMode, mode, scope: tableScope });
|
|
121
|
+
return { exit: 0, pending, undeterminedScope };
|
|
101
122
|
}
|
|
123
|
+
return { pending, undeterminedScope };
|
|
124
|
+
}
|
|
125
|
+
/** Render the pending plan (JSON early-return in plan mode, text otherwise). */
|
|
126
|
+
async function renderPlan(ctx, pending, undeterminedScope) {
|
|
127
|
+
const { jsonMode, executeRequested, mode, tableScope, migrationsDir } = ctx;
|
|
102
128
|
if (jsonMode && !executeRequested) {
|
|
103
|
-
|
|
104
|
-
mode,
|
|
105
|
-
scope: tableScope,
|
|
106
|
-
pending,
|
|
107
|
-
...(undeterminedScope.length > 0 ? { undeterminedMigrations: undeterminedScope } : {}),
|
|
108
|
-
});
|
|
129
|
+
emitPlanJson({ mode, scope: tableScope, pending, undeterminedScope });
|
|
109
130
|
return 0;
|
|
110
131
|
}
|
|
111
132
|
if (!jsonMode) {
|
|
112
|
-
|
|
113
|
-
console.log(`Table scope: ${tableScope.selector ?? ''} (${tableScope.matchCount} matched)`);
|
|
114
|
-
for (const table of tableScope.matchedTables)
|
|
115
|
-
console.log(`- ${table}`);
|
|
116
|
-
}
|
|
117
|
-
if (undeterminedScope.length > 0) {
|
|
118
|
-
console.log(`⚠ ${undeterminedScope.length} pending migration(s) have no table markers; ` +
|
|
119
|
-
"including them because their target tables can't be determined under --table:");
|
|
120
|
-
for (const file of undeterminedScope)
|
|
121
|
-
console.log(` - ${file}`);
|
|
122
|
-
}
|
|
123
|
-
console.log(`Pending migrations: ${pending.length}`);
|
|
124
|
-
for (const file of pending) {
|
|
125
|
-
console.log(`- ${file}`);
|
|
126
|
-
const sql = await readFile(join(migrationsDir, file), 'utf8');
|
|
127
|
-
const meta = extractMigrationMetadata(sql);
|
|
128
|
-
if (meta.log)
|
|
129
|
-
console.log(` ${meta.log}`);
|
|
130
|
-
}
|
|
133
|
+
await renderPlanText({ migrationsDir, scope: tableScope, undeterminedScope, pending });
|
|
131
134
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (!
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
/** Gate 2: in plan mode, stop unless the user confirms an interactive apply. */
|
|
138
|
+
async function runConfirmGate(ctx) {
|
|
139
|
+
const { executeRequested, jsonMode } = ctx;
|
|
140
|
+
if (executeRequested)
|
|
141
|
+
return undefined;
|
|
142
|
+
if (isBackgroundOrCI() || jsonMode) {
|
|
143
|
+
if (!jsonMode)
|
|
144
|
+
renderPlanOnlyNotice();
|
|
145
|
+
return 0;
|
|
144
146
|
}
|
|
147
|
+
const confirmed = await confirmApply();
|
|
148
|
+
if (!confirmed) {
|
|
149
|
+
console.log('Migration apply cancelled by user.');
|
|
150
|
+
return 0;
|
|
151
|
+
}
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
/** Gate 3: block destructive migrations unless allowed, confirmed, or forced. */
|
|
155
|
+
async function runDestructiveGate(ctx, pending) {
|
|
156
|
+
const { migrationsDir, allowDestructive, config, jsonMode, tableScope } = ctx;
|
|
145
157
|
const destructive = await scanDestructive(migrationsDir, pending);
|
|
146
158
|
let destructiveAllowed = allowDestructive || config.safety?.allowDestructive === true;
|
|
147
159
|
if (destructive.migrations.length > 0 && !destructiveAllowed) {
|
|
148
160
|
const error = 'Blocked destructive migration execution. Re-run with --allow-destructive or set safety.allowDestructive=true after review.';
|
|
149
161
|
if (jsonMode) {
|
|
150
|
-
|
|
151
|
-
mode: 'execute',
|
|
152
|
-
scope: tableScope,
|
|
153
|
-
error,
|
|
154
|
-
destructiveMigrations: destructive.migrations,
|
|
155
|
-
destructiveOperations: destructive.operations,
|
|
156
|
-
});
|
|
162
|
+
emitDestructiveBlockedJson({ scope: tableScope, error, destructive });
|
|
157
163
|
return 3;
|
|
158
164
|
}
|
|
159
165
|
if (isBackgroundOrCI()) {
|
|
@@ -170,14 +176,15 @@ async function cmdMigrate(runCtx) {
|
|
|
170
176
|
if (destructive.migrations.length > 0 && !destructiveAllowed) {
|
|
171
177
|
throw new Error('Blocked destructive migration execution.');
|
|
172
178
|
}
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
/** Apply each pending migration, journal it, and emit the final summary. */
|
|
182
|
+
async function applyPending(ctx, pending, undeterminedScope) {
|
|
183
|
+
const { jsonMode, migrationsDir, db, journalStore, pluginRuntime, config, tableScope, flags } = ctx;
|
|
173
184
|
const appliedNow = [];
|
|
174
185
|
for (const file of pending) {
|
|
175
|
-
if (!jsonMode)
|
|
176
|
-
|
|
177
|
-
const meta = extractMigrationMetadata(sql);
|
|
178
|
-
if (meta.log)
|
|
179
|
-
console.log(` ${meta.log}`);
|
|
180
|
-
}
|
|
186
|
+
if (!jsonMode)
|
|
187
|
+
await renderMigrationLog(migrationsDir, file);
|
|
181
188
|
const entry = await applyMigration({
|
|
182
189
|
db,
|
|
183
190
|
journalStore,
|
|
@@ -190,18 +197,13 @@ async function cmdMigrate(runCtx) {
|
|
|
190
197
|
});
|
|
191
198
|
appliedNow.push(entry);
|
|
192
199
|
if (!jsonMode)
|
|
193
|
-
|
|
200
|
+
renderApplied(file);
|
|
194
201
|
}
|
|
195
202
|
if (jsonMode) {
|
|
196
|
-
|
|
197
|
-
mode: 'execute',
|
|
198
|
-
scope: tableScope,
|
|
199
|
-
applied: appliedNow,
|
|
200
|
-
...(undeterminedScope.length > 0 ? { undeterminedMigrations: undeterminedScope } : {}),
|
|
201
|
-
});
|
|
203
|
+
emitApplySummaryJson({ scope: tableScope, applied: appliedNow, undeterminedScope });
|
|
202
204
|
return 0;
|
|
203
205
|
}
|
|
204
|
-
|
|
206
|
+
renderApplySummary();
|
|
205
207
|
return 0;
|
|
206
208
|
}
|
|
207
209
|
//# sourceMappingURL=command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/commands/migrate/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/commands/migrate/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAKxC,OAAO,EACL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,iBAA2B;IAE3B,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,GAAG,CAAA;IAEnG,MAAM,UAAU,GAA4B,EAAE,CAAA;IAC9C,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,QAAQ;YAAE,MAAM,kBAAkB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;QAC5D,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC;YACjC,EAAE;YACF,YAAY;YACZ,aAAa;YACb,MAAM;YACN,UAAU;YACV,KAAK;YACL,aAAa;YACb,IAAI;SACL,CAAC,CAAA;QACF,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtB,IAAI,CAAC,QAAQ;YAAE,aAAa,CAAC,IAAI,CAAC,CAAA;IACpC,CAAC;IAED,IAAI,QAAQ,EAAE,CAAC;QACb,oBAAoB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAA;QACnF,OAAO,CAAC,CAAA;IACV,CAAC;IAED,kBAAkB,EAAE,CAAA;IACpB,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { TableScope } from '../../plugins.js';
|
|
2
|
+
import type { MigrationJournalEntry } from '../../runtime/migration-store.js';
|
|
3
|
+
import type { DestructiveScan } from './destructive.js';
|
|
4
|
+
export type MigrateMode = 'plan' | 'execute';
|
|
5
|
+
interface ChecksumMismatch {
|
|
6
|
+
name: string;
|
|
7
|
+
expected: string;
|
|
8
|
+
actual: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function emitChecksumMismatchJson(input: {
|
|
11
|
+
mode: MigrateMode;
|
|
12
|
+
scope: TableScope;
|
|
13
|
+
checksumMismatches: ChecksumMismatch[];
|
|
14
|
+
}): void;
|
|
15
|
+
export declare function emitNoScopeMatch(input: {
|
|
16
|
+
jsonMode: boolean;
|
|
17
|
+
mode: MigrateMode;
|
|
18
|
+
scope: TableScope;
|
|
19
|
+
}): void;
|
|
20
|
+
export declare function emitNoPending(input: {
|
|
21
|
+
jsonMode: boolean;
|
|
22
|
+
mode: MigrateMode;
|
|
23
|
+
scope: TableScope;
|
|
24
|
+
}): void;
|
|
25
|
+
export declare function emitPlanJson(input: {
|
|
26
|
+
mode: MigrateMode;
|
|
27
|
+
scope: TableScope;
|
|
28
|
+
pending: string[];
|
|
29
|
+
undeterminedScope: string[];
|
|
30
|
+
}): void;
|
|
31
|
+
export declare function renderPlanText(input: {
|
|
32
|
+
migrationsDir: string;
|
|
33
|
+
scope: TableScope;
|
|
34
|
+
undeterminedScope: string[];
|
|
35
|
+
pending: string[];
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
export declare function renderPlanOnlyNotice(): void;
|
|
38
|
+
export declare function emitDestructiveBlockedJson(input: {
|
|
39
|
+
scope: TableScope;
|
|
40
|
+
error: string;
|
|
41
|
+
destructive: DestructiveScan;
|
|
42
|
+
}): void;
|
|
43
|
+
export declare function renderMigrationLog(migrationsDir: string, file: string): Promise<void>;
|
|
44
|
+
export declare function renderApplied(file: string): void;
|
|
45
|
+
export declare function emitApplySummaryJson(input: {
|
|
46
|
+
scope: TableScope;
|
|
47
|
+
applied: MigrationJournalEntry[];
|
|
48
|
+
undeterminedScope: string[];
|
|
49
|
+
}): void;
|
|
50
|
+
export declare function renderApplySummary(): void;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/output.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;A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jB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,eAAe,CAAA;CAC7B,GAAG,IAAI,CAQP;AAED,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3F;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,KAAK,EAAE,UAAU,CAAA;IACjB,OAAO,EAAE,qBAAqB,EAAE,CAAA;IAChC,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAC5B,GAAG,IAAI,CASP;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { emitJson } from '../../runtime/json-output.js';
|
|
4
|
+
import { resolveJournalTableName } from '../../runtime/journal-store.js';
|
|
5
|
+
import { extractMigrationMetadata } from '../../runtime/migration-metadata.js';
|
|
6
|
+
export function emitChecksumMismatchJson(input) {
|
|
7
|
+
emitJson('migrate', {
|
|
8
|
+
mode: input.mode,
|
|
9
|
+
scope: input.scope,
|
|
10
|
+
error: 'Checksum mismatch detected on applied migrations',
|
|
11
|
+
checksumMismatches: input.checksumMismatches,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function emitNoScopeMatch(input) {
|
|
15
|
+
const selector = input.scope.selector ?? '';
|
|
16
|
+
if (input.jsonMode) {
|
|
17
|
+
emitJson('migrate', {
|
|
18
|
+
mode: input.mode,
|
|
19
|
+
scope: input.scope,
|
|
20
|
+
pending: [],
|
|
21
|
+
applied: [],
|
|
22
|
+
warning: `No tables matched selector "${selector}".`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
console.log(`No tables matched selector "${selector}". No migrations selected.`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function emitNoPending(input) {
|
|
30
|
+
if (input.jsonMode) {
|
|
31
|
+
emitJson('migrate', { mode: input.mode, scope: input.scope, pending: [], applied: [] });
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
console.log('No pending migrations.');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export function emitPlanJson(input) {
|
|
38
|
+
emitJson('migrate', {
|
|
39
|
+
mode: input.mode,
|
|
40
|
+
scope: input.scope,
|
|
41
|
+
pending: input.pending,
|
|
42
|
+
...(input.undeterminedScope.length > 0
|
|
43
|
+
? { undeterminedMigrations: input.undeterminedScope }
|
|
44
|
+
: {}),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export async function renderPlanText(input) {
|
|
48
|
+
const { migrationsDir, scope, undeterminedScope, pending } = input;
|
|
49
|
+
if (scope.enabled) {
|
|
50
|
+
console.log(`Table scope: ${scope.selector ?? ''} (${scope.matchCount} matched)`);
|
|
51
|
+
for (const table of scope.matchedTables)
|
|
52
|
+
console.log(`- ${table}`);
|
|
53
|
+
}
|
|
54
|
+
if (undeterminedScope.length > 0) {
|
|
55
|
+
console.log(`⚠ ${undeterminedScope.length} pending migration(s) have no table markers; ` +
|
|
56
|
+
"including them because their target tables can't be determined under --table:");
|
|
57
|
+
for (const file of undeterminedScope)
|
|
58
|
+
console.log(` - ${file}`);
|
|
59
|
+
}
|
|
60
|
+
console.log(`Pending migrations: ${pending.length}`);
|
|
61
|
+
for (const file of pending) {
|
|
62
|
+
console.log(`- ${file}`);
|
|
63
|
+
const sql = await readFile(join(migrationsDir, file), 'utf8');
|
|
64
|
+
const meta = extractMigrationMetadata(sql);
|
|
65
|
+
if (meta.log)
|
|
66
|
+
console.log(` ${meta.log}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export function renderPlanOnlyNotice() {
|
|
70
|
+
console.log('\nPlan only. Re-run with --apply to apply and journal these migrations.');
|
|
71
|
+
}
|
|
72
|
+
export function emitDestructiveBlockedJson(input) {
|
|
73
|
+
emitJson('migrate', {
|
|
74
|
+
mode: 'execute',
|
|
75
|
+
scope: input.scope,
|
|
76
|
+
error: input.error,
|
|
77
|
+
destructiveMigrations: input.destructive.migrations,
|
|
78
|
+
destructiveOperations: input.destructive.operations,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export async function renderMigrationLog(migrationsDir, file) {
|
|
82
|
+
const sql = await readFile(join(migrationsDir, file), 'utf8');
|
|
83
|
+
const meta = extractMigrationMetadata(sql);
|
|
84
|
+
if (meta.log)
|
|
85
|
+
console.log(` ${meta.log}`);
|
|
86
|
+
}
|
|
87
|
+
export function renderApplied(file) {
|
|
88
|
+
console.log(`Applied: ${file}`);
|
|
89
|
+
}
|
|
90
|
+
export function emitApplySummaryJson(input) {
|
|
91
|
+
emitJson('migrate', {
|
|
92
|
+
mode: 'execute',
|
|
93
|
+
scope: input.scope,
|
|
94
|
+
applied: input.applied,
|
|
95
|
+
...(input.undeterminedScope.length > 0
|
|
96
|
+
? { undeterminedMigrations: input.undeterminedScope }
|
|
97
|
+
: {}),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export function renderApplySummary() {
|
|
101
|
+
console.log(`\nMigrations recorded in ClickHouse ${resolveJournalTableName()} table.`);
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/commands/migrate/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAA;AAY9E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E,CAAC;KACR,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,CAAC,GAAG,CAAC,uCAAuC,uBAAuB,EAAE,SAAS,CAAC,CAAA;AACxF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2-beta.0",
|
|
4
4
|
"description": "ClickHouse schema and migration CLI for TypeScript projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ObsessionDB",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"fast-glob": "^3.3.2",
|
|
43
|
-
"@chkit/clickhouse": "0.1.
|
|
44
|
-
"@chkit/codegen": "0.1.
|
|
45
|
-
"@chkit/core": "0.1.
|
|
43
|
+
"@chkit/clickhouse": "0.1.2-beta.0",
|
|
44
|
+
"@chkit/codegen": "0.1.2-beta.0",
|
|
45
|
+
"@chkit/core": "0.1.2-beta.0",
|
|
46
46
|
"@logtape/logtape": "^2.0.5"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
|
-
"@chkit/plugin-obsessiondb": "0.1.
|
|
49
|
+
"@chkit/plugin-obsessiondb": "0.1.2-beta.0"
|
|
50
50
|
}
|
|
51
51
|
}
|