@memberjunction/cli 6.1.6 → 6.1.8

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.
@@ -11,18 +11,36 @@ export default class Migrate extends Command {
11
11
  };
12
12
  run(): Promise<void>;
13
13
  /**
14
- * Reads the database's current migration version, logs it, then fetches the minimal
15
- * slice to reach `ref`: versioned migrations after the current version for an existing
16
- * database, or baseline + tail for a fresh one.
14
+ * Reads what the database has applied, logs it, then fetches the minimal slice to reach
15
+ * `ref`: the versioned migrations not yet applied (above the baseline floor) for an
16
+ * existing database, or baseline + tail for a fresh one.
17
17
  */
18
18
  private fetchSliceForRef;
19
19
  /**
20
- * Connects to read the highest migration version already applied (from Skyway's
21
- * history table). Returns null for a fresh database (no history table yet).
20
+ * Connects to read the applied versions and baseline floor from Skyway's history table.
21
+ * Returns null for a fresh database (no history table yet).
22
22
  */
23
- private readInstalledVersion;
23
+ private readAppliedState;
24
24
  /** Surfaces the detected installed version so the user sees what's being upgraded from. */
25
25
  private logInstalledVersion;
26
+ /**
27
+ * Turns on `outOfOrder` for this run when the core schema has pending migrations older
28
+ * than its highest applied version and the config file does not set `outOfOrder`. That
29
+ * is the normal state of a database upgraded from a release line, where backported
30
+ * migrations were applied ahead of older files that only exist on the newer line.
31
+ * Each such file is logged. An explicit `outOfOrder` in config is honoured as written.
32
+ *
33
+ * SIDE EFFECTS: reads the history table through a separate provider; mutates
34
+ * `skywayConfig.Migrations.OutOfOrder`.
35
+ */
36
+ private applyOutOfOrderPolicy;
37
+ /**
38
+ * Asks Skyway which versioned files it would refuse as out of order (State IGNORED).
39
+ * Returns null when the probe fails; the run then proceeds with the configured setting
40
+ * and Skyway reports any problem itself.
41
+ */
42
+ private probeOutOfOrderPending;
43
+ private logOutOfOrderFiles;
26
44
  /**
27
45
  * Verify the database is reachable with the configured TLS/auth settings before
28
46
  * running migrations. On failure, prints a classified message (and an actionable
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAa7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAA0M;IAE5N,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAgC1B;;;;OAIG;YACW,gBAAgB;IAW9B;;;OAGG;YACW,oBAAoB;IAMlC,2FAA2F;IAC3F,OAAO,CAAC,mBAAmB;IAQ3B;;;;OAIG;YACW,mBAAmB;IAWjC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,eAAe;IASvB,uEAAuE;YACzD,gBAAgB;IAiG9B;;;;;;;OAOG;YACW,kCAAkC;IA+BhD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,mBAAmB;IA+C3B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CA+B5B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAc7C,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAC1C,MAAM,CAAC,WAAW,SAA0M;IAE5N,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAiC1B;;;;OAIG;YACW,gBAAgB;IAW9B;;;OAGG;YACW,gBAAgB;IAM9B,2FAA2F;IAC3F,OAAO,CAAC,mBAAmB;IAW3B;;;;;;;;;OASG;YACW,qBAAqB;IAsBnC;;;;OAIG;YACW,sBAAsB;IAepC,OAAO,CAAC,kBAAkB;IAM1B;;;;OAIG;YACW,mBAAmB;IAWjC;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,eAAe;IASvB,uEAAuE;YACzD,gBAAgB;IAiG9B;;;;;;;OAOG;YACW,kCAAkC;IA+BhD;;;;;;;;;;OAUG;IACH,OAAO,CAAC,mBAAmB;IA+C3B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;CA+B5B"}
@@ -2,10 +2,11 @@ import path from 'node:path';
2
2
  import { Command, Flags } from '@oclif/core';
3
3
  import { Skyway } from '@memberjunction/skyway-core';
4
4
  import ora from 'ora-classic';
5
- import { getValidatedConfig, getSkywayConfig } from '../../config.js';
5
+ import { getValidatedConfig, getSkywayConfig, getRawConfig } from '../../config.js';
6
6
  import { fetchMigrationSlice, resolveGitRef } from '../../lib/migration-fetch.js';
7
7
  import { verifyDatabaseConnection } from '../../lib/db-preflight.js';
8
- import { readCurrentDbVersion } from '../../lib/db-version.js';
8
+ import { ReadAppliedMigrationState } from '../../lib/db-version.js';
9
+ import { DecideOutOfOrder, FindOutOfOrderPending, ReadExplicitOutOfOrder, ShouldProbeOutOfOrder } from '../../lib/out-of-order.js';
9
10
  import { executeOpenAppMetadataRefresh, isOpenAppSchema } from '@memberjunction/open-app-engine';
10
11
  /** Skyway's default history table — matches `@memberjunction/skyway-core`'s config default. */
11
12
  const HISTORY_TABLE = 'flyway_schema_history';
@@ -37,10 +38,10 @@ export default class Migrate extends Command {
37
38
  await this.preflightConnection(config, flags['check-connection']);
38
39
  if (flags['check-connection'])
39
40
  return;
40
- // For a remote ref we read the DB's current migration version, then fetch only the
41
- // slice needed to reach the target — versioned migrations after the current version
42
- // for an existing DB, or baseline + tail for a fresh one — into a temp dir handed to
43
- // Skyway. cleanup() runs on every exit path.
41
+ // For a remote ref we read what the DB has applied, then fetch only the slice needed
42
+ // to reach the target — the versioned migrations it has not applied (above its baseline
43
+ // floor) for an existing DB, or baseline + tail for a fresh one — into a temp dir handed
44
+ // to Skyway. cleanup() runs on every exit path.
44
45
  //
45
46
  // Explicit --tag wins; otherwise the install-pinned version (mjRepoVersion) drives
46
47
  // the fetch so migrate stays consistent with the installed code. An explicit --dir
@@ -52,6 +53,7 @@ export default class Migrate extends Command {
52
53
  const sourceDir = this.resolveSourceDir(fetched, flags.dir);
53
54
  const skywayConfig = await getSkywayConfig(config, undefined, flags.schema, sourceDir);
54
55
  this.logFetchSummary(flags.verbose, fetched);
56
+ await this.applyOutOfOrderPolicy(config, skywayConfig, flags.schema, sourceDir);
55
57
  await this.executeMigration(config, flags, skywayConfig);
56
58
  }
57
59
  finally {
@@ -60,36 +62,92 @@ export default class Migrate extends Command {
60
62
  }
61
63
  }
62
64
  /**
63
- * Reads the database's current migration version, logs it, then fetches the minimal
64
- * slice to reach `ref`: versioned migrations after the current version for an existing
65
- * database, or baseline + tail for a fresh one.
65
+ * Reads what the database has applied, logs it, then fetches the minimal slice to reach
66
+ * `ref`: the versioned migrations not yet applied (above the baseline floor) for an
67
+ * existing database, or baseline + tail for a fresh one.
66
68
  */
67
69
  async fetchSliceForRef(config, ref, schema) {
68
- const currentVersion = await this.readInstalledVersion(config, schema);
69
- this.logInstalledVersion(currentVersion);
70
+ const applied = await this.readAppliedState(config, schema);
71
+ this.logInstalledVersion(applied);
70
72
  return fetchMigrationSlice({
71
73
  repoUrl: config.mjRepoUrl,
72
74
  ref: resolveGitRef(ref),
73
75
  dialect: config.dbPlatform,
74
- currentVersion,
76
+ applied,
75
77
  });
76
78
  }
77
79
  /**
78
- * Connects to read the highest migration version already applied (from Skyway's
79
- * history table). Returns null for a fresh database (no history table yet).
80
+ * Connects to read the applied versions and baseline floor from Skyway's history table.
81
+ * Returns null for a fresh database (no history table yet).
80
82
  */
81
- async readInstalledVersion(config, schema) {
83
+ async readAppliedState(config, schema) {
82
84
  // A throwaway config just to obtain a provider — the migration location is irrelevant here.
83
85
  const probe = await getSkywayConfig(config, undefined, schema, undefined);
84
- return readCurrentDbVersion(probe.Provider, probe.Migrations.DefaultSchema, HISTORY_TABLE);
86
+ return ReadAppliedMigrationState(probe.Provider, probe.Migrations.DefaultSchema, HISTORY_TABLE);
85
87
  }
86
88
  /** Surfaces the detected installed version so the user sees what's being upgraded from. */
87
- logInstalledVersion(currentVersion) {
88
- if (currentVersion === null) {
89
+ logInstalledVersion(applied) {
90
+ if (applied === null) {
89
91
  this.log('No prior migration history detected — treating as a fresh install (baseline + later migrations).');
92
+ return;
90
93
  }
91
- else {
92
- this.log(`Detected installed migration version: ${currentVersion} — fetching only migrations newer than it.`);
94
+ const floor = applied.BaselineFloor ? ` (baseline floor ${applied.BaselineFloor})` : '';
95
+ this.log(`Detected installed migration version: ${applied.HighestVersion ?? '(none)'}${floor} — fetching every migration not yet applied.`);
96
+ }
97
+ /**
98
+ * Turns on `outOfOrder` for this run when the core schema has pending migrations older
99
+ * than its highest applied version and the config file does not set `outOfOrder`. That
100
+ * is the normal state of a database upgraded from a release line, where backported
101
+ * migrations were applied ahead of older files that only exist on the newer line.
102
+ * Each such file is logged. An explicit `outOfOrder` in config is honoured as written.
103
+ *
104
+ * SIDE EFFECTS: reads the history table through a separate provider; mutates
105
+ * `skywayConfig.Migrations.OutOfOrder`.
106
+ */
107
+ async applyOutOfOrderPolicy(config, skywayConfig, schema, sourceDir) {
108
+ const explicitSetting = ReadExplicitOutOfOrder(getRawConfig().config);
109
+ const isCoreSchema = !isOpenAppSchema(skywayConfig.Migrations.DefaultSchema, config.coreSchema ?? '__mj');
110
+ if (!ShouldProbeOutOfOrder(explicitSetting, isCoreSchema))
111
+ return;
112
+ const outOfOrderPending = await this.probeOutOfOrderPending(config, schema, sourceDir);
113
+ if (outOfOrderPending === null)
114
+ return;
115
+ const decision = DecideOutOfOrder({ ExplicitSetting: explicitSetting, IsCoreSchema: isCoreSchema, OutOfOrderPending: outOfOrderPending });
116
+ if (decision.EnabledAutomatically) {
117
+ skywayConfig.Migrations.OutOfOrder = true;
118
+ this.log(`Applying ${outOfOrderPending.length} migration(s) older than the database's newest applied migration (outOfOrder enabled for this run):`);
119
+ this.logOutOfOrderFiles(outOfOrderPending);
120
+ }
121
+ else if (decision.BlockedByExplicitSetting) {
122
+ this.warn(`${outOfOrderPending.length} pending migration(s) are older than the database's newest applied migration, ` +
123
+ 'and the config file sets outOfOrder: false, so Skyway will refuse them. Remove the setting or set it to true to apply them:');
124
+ this.logOutOfOrderFiles(outOfOrderPending);
125
+ }
126
+ }
127
+ /**
128
+ * Asks Skyway which versioned files it would refuse as out of order (State IGNORED).
129
+ * Returns null when the probe fails; the run then proceeds with the configured setting
130
+ * and Skyway reports any problem itself.
131
+ */
132
+ async probeOutOfOrderPending(config, schema, sourceDir) {
133
+ const probeConfig = await getSkywayConfig(config, undefined, schema, sourceDir);
134
+ probeConfig.Migrations.OutOfOrder = false;
135
+ const probe = new Skyway(probeConfig);
136
+ try {
137
+ return FindOutOfOrderPending(await probe.Info());
138
+ }
139
+ catch (err) {
140
+ const message = err instanceof Error ? err.message : String(err);
141
+ this.warn(`Could not check for out-of-order migrations: ${message}`);
142
+ return null;
143
+ }
144
+ finally {
145
+ await probe.Close();
146
+ }
147
+ }
148
+ logOutOfOrderFiles(files) {
149
+ for (const file of files) {
150
+ this.log(` ${file.Version} — ${file.Script}`);
93
151
  }
94
152
  }
95
153
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/migrate/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,GAAG,MAAM,aAAa,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAiB,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAA6B,MAAM,2BAA2B,CAAC;AAC1G,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MA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C,WAAW,CAAC,EAAE,CAAC,CAAC;YACrB,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YAClC,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;gBAC/B,IAAI,CAAC,WAAW,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC"}
@@ -1,16 +1,17 @@
1
1
  /**
2
- * Reads the highest migration version already applied to the target database from
3
- * Skyway's history table.
2
+ * Reads what is already applied to the target database from Skyway's history table.
4
3
  *
5
4
  * Returns `null` when there is no history (a fresh database) — which tells the fetch
6
- * layer to use `baseline + tail`. A non-null version means "existing database, upgrade
7
- * from here", so the fetch returns only the versioned migrations after it (no baseline,
8
- * which Skyway never applies to a database that already has history).
5
+ * layer to use `baseline + tail`. Otherwise it returns the set of applied versions and
6
+ * the baseline floor, so the fetch can select every versioned migration that is not yet
7
+ * applied and lies above the floor. Selecting by "newer than the highest applied version"
8
+ * is wrong once release lines exist: a database upgraded from a patch line has applied
9
+ * migrations that are newer than files it has never run.
9
10
  *
10
11
  * @module lib/db-version
11
12
  */
12
13
  /** Minimal shape of a Skyway history record we read (the real record carries more fields). */
13
- interface HistoryRecordLike {
14
+ export interface HistoryRecordLike {
14
15
  Version: string | null;
15
16
  Type: string;
16
17
  Success?: boolean;
@@ -24,6 +25,33 @@ export interface MigrationHistoryProvider {
24
25
  GetAllRecords(schema: string, tableName: string): Promise<readonly HistoryRecordLike[]>;
25
26
  };
26
27
  }
28
+ /** What the history table says is already applied to an existing database. */
29
+ export interface AppliedMigrationState {
30
+ /** Every successfully applied versioned or baseline version (Skyway's `<timestamp>` key). */
31
+ AppliedVersions: ReadonlySet<string>;
32
+ /** Highest successfully applied version, or null when only markers exist. */
33
+ HighestVersion: string | null;
34
+ /**
35
+ * Highest successful baseline row (`SQL_BASELINE` from a `B` file, or a `BASELINE` marker).
36
+ * Skyway treats every versioned file at or below it as subsumed and never runs it, even
37
+ * with `outOfOrder`, so the fetch must not select those files either.
38
+ */
39
+ BaselineFloor: string | null;
40
+ }
41
+ /**
42
+ * SIDE EFFECTS: connects to the database to read the history table, then disconnects
43
+ * (on every exit path).
44
+ *
45
+ * @returns the applied versions and baseline floor, or `null` if the history table does
46
+ * not exist yet (fresh database).
47
+ */
48
+ export declare function ReadAppliedMigrationState(provider: MigrationHistoryProvider, schema: string, historyTable: string): Promise<AppliedMigrationState | null>;
49
+ /**
50
+ * Pure: reduces history records to the applied set, highest version and baseline floor.
51
+ * Failed rows are left out, so their files are still fetched (Skyway reports them as
52
+ * FAILED rather than re-running them, and a later repair needs the file present).
53
+ */
54
+ export declare function BuildAppliedMigrationState(records: readonly HistoryRecordLike[]): AppliedMigrationState;
27
55
  /**
28
56
  * SIDE EFFECTS: connects to the database to read the history table, then disconnects
29
57
  * (on every exit path).
@@ -32,5 +60,4 @@ export interface MigrationHistoryProvider {
32
60
  * history table does not exist yet (fresh database).
33
61
  */
34
62
  export declare function readCurrentDbVersion(provider: MigrationHistoryProvider, schema: string, historyTable: string): Promise<string | null>;
35
- export {};
36
63
  //# sourceMappingURL=db-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"db-version.d.ts","sourceRoot":"","sources":["../../src/lib/db-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8FAA8F;AAC9F,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,+GAA+G;AAC/G,MAAM,WAAW,wBAAwB;IACvC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,OAAO,EAAE;QACP,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAC5D,aAAa,CAAC,MA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AAY,EAAE,MAAM,GACnB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAWvC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,GAAG,qBAAqB,CAcvG;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAG3I"}
@@ -1,11 +1,12 @@
1
1
  /**
2
- * Reads the highest migration version already applied to the target database from
3
- * Skyway's history table.
2
+ * Reads what is already applied to the target database from Skyway's history table.
4
3
  *
5
4
  * Returns `null` when there is no history (a fresh database) — which tells the fetch
6
- * layer to use `baseline + tail`. A non-null version means "existing database, upgrade
7
- * from here", so the fetch returns only the versioned migrations after it (no baseline,
8
- * which Skyway never applies to a database that already has history).
5
+ * layer to use `baseline + tail`. Otherwise it returns the set of applied versions and
6
+ * the baseline floor, so the fetch can select every versioned migration that is not yet
7
+ * applied and lies above the floor. Selecting by "newer than the highest applied version"
8
+ * is wrong once release lines exist: a database upgraded from a patch line has applied
9
+ * migrations that are newer than files it has never run.
9
10
  *
10
11
  * @module lib/db-version
11
12
  */
@@ -13,31 +14,58 @@
13
14
  * SIDE EFFECTS: connects to the database to read the history table, then disconnects
14
15
  * (on every exit path).
15
16
  *
16
- * @returns the highest applied version (Skyway's `<timestamp>` key), or `null` if the
17
- * history table does not exist yet (fresh database).
17
+ * @returns the applied versions and baseline floor, or `null` if the history table does
18
+ * not exist yet (fresh database).
18
19
  */
19
- export async function readCurrentDbVersion(provider, schema, historyTable) {
20
+ export async function ReadAppliedMigrationState(provider, schema, historyTable) {
20
21
  await provider.Connect();
21
22
  try {
22
23
  if (!(await provider.History.Exists(schema, historyTable))) {
23
24
  return null;
24
25
  }
25
26
  const records = await provider.History.GetAllRecords(schema, historyTable);
26
- return highestAppliedVersion(records);
27
+ return BuildAppliedMigrationState(records);
27
28
  }
28
29
  finally {
29
30
  await provider.Disconnect();
30
31
  }
31
32
  }
32
- /** Highest successful, non-schema-marker version among history records (mirrors Skyway's own rule). */
33
- function highestAppliedVersion(records) {
34
- let highest = null;
33
+ /**
34
+ * Pure: reduces history records to the applied set, highest version and baseline floor.
35
+ * Failed rows are left out, so their files are still fetched (Skyway reports them as
36
+ * FAILED rather than re-running them, and a later repair needs the file present).
37
+ */
38
+ export function BuildAppliedMigrationState(records) {
39
+ const applied = new Set();
40
+ let floor = null;
35
41
  for (const record of records) {
36
- if (record.Version === null || record.Type === 'SCHEMA' || record.Success === false) {
42
+ const version = record.Version;
43
+ if (version === null || record.Type === 'SCHEMA' || record.Success === false) {
37
44
  continue;
38
45
  }
39
- if (highest === null || record.Version > highest) {
40
- highest = record.Version;
46
+ applied.add(version);
47
+ if ((record.Type === 'SQL_BASELINE' || record.Type === 'BASELINE') && (floor === null || version > floor)) {
48
+ floor = version;
49
+ }
50
+ }
51
+ return { AppliedVersions: applied, HighestVersion: highestOf(applied), BaselineFloor: floor };
52
+ }
53
+ /**
54
+ * SIDE EFFECTS: connects to the database to read the history table, then disconnects
55
+ * (on every exit path).
56
+ *
57
+ * @returns the highest applied version (Skyway's `<timestamp>` key), or `null` if the
58
+ * history table does not exist yet (fresh database).
59
+ */
60
+ export async function readCurrentDbVersion(provider, schema, historyTable) {
61
+ const state = await ReadAppliedMigrationState(provider, schema, historyTable);
62
+ return state?.HighestVersion ?? null;
63
+ }
64
+ function highestOf(versions) {
65
+ let highest = null;
66
+ for (const version of versions) {
67
+ if (highest === null || version > highest) {
68
+ highest = version;
41
69
  }
42
70
  }
43
71
  return highest;
@@ -1 +1 @@
1
- {"version":3,"file":"db-version.js","sourceRoot":"","sources":["../../src/lib/db-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAmBH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,QAAkC,EAAE,MA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E,MAAM,EAAE,YAAY,CAAC,CAAC;IAC9E,OAAO,KAAK,EAAE,cAAc,IAAI,IAAI,CAAC;AACvC,CAAC;AAED,SAAS,SAAS,CAAC,QAA6B;IAC9C,IAAI,OAAO,GAAkB,IAAI,CAAC;IAClC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,GAAG,OAAO,EAAE,CAAC;YAC1C,OAAO,GAAG,OAAO,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { AppliedMigrationState } from './db-version.js';
1
2
  export type MigrationDialect = 'sqlserver' | 'postgresql';
2
3
  export interface MigrationFetchResult {
3
4
  /** Temp clone root to hand to Skyway as the migration location. */
@@ -19,21 +20,23 @@ export declare function resolveGitRef(tagOrBranch: string): string;
19
20
  * Pure selector: given the repo-relative migration paths present at a ref, return
20
21
  * the minimal slice Skyway needs. Repeatable migrations are always included.
21
22
  *
22
- * Two modes, keyed on `currentVersion` (the highest migration already applied to the
23
- * target database, or `null` for a fresh one):
23
+ * Two modes, keyed on `applied` (what the target database's history says, or `null`
24
+ * for a fresh database):
24
25
  *
25
- * - **Fresh install** (`currentVersion == null`): `baseline + tail` — the highest `B`
26
+ * - **Fresh install** (`applied` null, or a history table with nothing successfully
27
+ * applied yet — Skyway still baselines that database): `baseline + tail` — the highest `B`
26
28
  * baseline plus every `V` after it. Skyway applies the baseline (consolidated schema)
27
29
  * then the tail. This is the bandwidth-optimal path for a brand-new database.
28
- * - **Existing-DB upgrade** (`currentVersion` set): every `V` strictly after the current
29
- * version, with **no baseline**. Skyway never applies a `B` file to a database that
30
- * already has history, and the baseline floor would wrongly skip the intermediate
31
- * versioned migrations the DB still needs (e.g. a v5.36 file below a v5.37 baseline
32
- * when upgrading a v5.35 database).
30
+ * - **Existing-DB upgrade** (`applied` set): every `V` whose version is not in
31
+ * `applied.AppliedVersions` and is strictly above `applied.BaselineFloor`, with **no
32
+ * baseline**. Skyway never applies a `B` file to a database that already has history.
33
+ * Files older than the highest applied version are still selected when they were never
34
+ * run (a database coming from a release line); the caller decides whether Skyway may
35
+ * apply them out of order.
33
36
  *
34
37
  * With no baseline present (e.g. legacy v2) the fresh path returns the full versioned history.
35
38
  */
36
- export declare function selectMigrationSlice(paths: readonly string[], currentVersion?: string | null): string[];
39
+ export declare function selectMigrationSlice(paths: readonly string[], applied?: AppliedMigrationState | null): string[];
37
40
  /**
38
41
  * SIDE EFFECTS: clones from `repoUrl` over the network into a temp dir and checks out
39
42
  * only the selected migration slice. Returns the temp dir plus a `cleanup` the caller
@@ -43,7 +46,7 @@ export declare function fetchMigrationSlice(opts: {
43
46
  repoUrl: string;
44
47
  ref: string;
45
48
  dialect: MigrationDialect;
46
- /** Highest version already applied to the target DB; `null`/omitted = fresh install (baseline + tail). */
47
- currentVersion?: string | null;
49
+ /** What the target DB has already applied; `null`/omitted = fresh install (baseline + tail). */
50
+ applied?: AppliedMigrationState | null;
48
51
  }): Promise<MigrationFetchResult>;
49
52
  //# sourceMappingURL=migration-fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-fetch.d.ts","sourceRoot":"","sources":["../../src/lib/migration-fetch.ts"],"names":[],"mappings":"AAyBA,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;IACZ,iGAAiG;IACjG,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kGAAkG;IAClG,YAAY,EAAE,OAAO,CAAC;IACtB,wFAAwF;IACxF,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAKD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBA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G,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;CACxC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA2BhC"}
@@ -7,14 +7,18 @@
7
7
  * The selection depends on whether the target database is fresh or existing, because
8
8
  * Skyway only ever applies baselines to a fresh (no-history) database:
9
9
  *
10
- * fresh install → [ highest `B` baseline ] + [ every `V` after it ] + [ all `R` repeatables ]
11
- * existing upgrade → [ every `V` after the DB's current version ] + [ all `R` repeatables ] (no baseline)
10
+ * fresh install → [ highest `B` baseline ] + [ every `V` after it ] + [ all `R` repeatables ]
11
+ * existing upgrade → [ every `V` not yet applied and above the DB's baseline floor ] + [ all `R` repeatables ] (no baseline)
12
12
  *
13
- * The existing-upgrade path is what makes incremental upgrades correct: a baseline floor
14
- * would skip the intermediate versioned migrations a behind-the-baseline DB still needs.
15
- * The git ref bounds the top of the range (only migrations at/below the target are in the
16
- * tree). Selection uses the numeric `<timestamp>` filename token — Skyway's version key —
17
- * via the shared {@link parseMigrationFilename}.
13
+ * The existing-upgrade path selects by set difference against the history table, not by
14
+ * "newer than the highest applied version". Release lines make that distinction matter: a
15
+ * database upgraded from a patch line has applied files that are newer than migrations it
16
+ * has never run, and a "newer than the max" filter would drop those older files silently.
17
+ * The floor is the highest baseline row in history; Skyway never runs a `V` file at or
18
+ * below it, so fetching one would only make the CLI and Skyway disagree about what is
19
+ * pending. The git ref bounds the top of the range (only migrations at/below the target
20
+ * are in the tree). Selection uses the numeric `<timestamp>` filename token — Skyway's
21
+ * version key — via the shared {@link parseMigrationFilename}.
18
22
  */
19
23
  import { mkdtempSync } from 'node:fs';
20
24
  import { rm } from 'node:fs/promises';
@@ -38,26 +42,28 @@ export function resolveGitRef(tagOrBranch) {
38
42
  * Pure selector: given the repo-relative migration paths present at a ref, return
39
43
  * the minimal slice Skyway needs. Repeatable migrations are always included.
40
44
  *
41
- * Two modes, keyed on `currentVersion` (the highest migration already applied to the
42
- * target database, or `null` for a fresh one):
45
+ * Two modes, keyed on `applied` (what the target database's history says, or `null`
46
+ * for a fresh database):
43
47
  *
44
- * - **Fresh install** (`currentVersion == null`): `baseline + tail` — the highest `B`
48
+ * - **Fresh install** (`applied` null, or a history table with nothing successfully
49
+ * applied yet — Skyway still baselines that database): `baseline + tail` — the highest `B`
45
50
  * baseline plus every `V` after it. Skyway applies the baseline (consolidated schema)
46
51
  * then the tail. This is the bandwidth-optimal path for a brand-new database.
47
- * - **Existing-DB upgrade** (`currentVersion` set): every `V` strictly after the current
48
- * version, with **no baseline**. Skyway never applies a `B` file to a database that
49
- * already has history, and the baseline floor would wrongly skip the intermediate
50
- * versioned migrations the DB still needs (e.g. a v5.36 file below a v5.37 baseline
51
- * when upgrading a v5.35 database).
52
+ * - **Existing-DB upgrade** (`applied` set): every `V` whose version is not in
53
+ * `applied.AppliedVersions` and is strictly above `applied.BaselineFloor`, with **no
54
+ * baseline**. Skyway never applies a `B` file to a database that already has history.
55
+ * Files older than the highest applied version are still selected when they were never
56
+ * run (a database coming from a release line); the caller decides whether Skyway may
57
+ * apply them out of order.
52
58
  *
53
59
  * With no baseline present (e.g. legacy v2) the fresh path returns the full versioned history.
54
60
  */
55
- export function selectMigrationSlice(paths, currentVersion) {
61
+ export function selectMigrationSlice(paths, applied) {
56
62
  const sqlPaths = paths.filter((p) => p.toLowerCase().endsWith('.sql'));
57
63
  const repeatables = sqlPaths.filter((p) => REPEATABLE_PATTERN.test(path.basename(p)));
58
- if (currentVersion != null) {
59
- // Existing DB: upgrade with versioned migrations after the current version only.
60
- const versioned = sqlPaths.filter((p) => isVersionedAfter(p, currentVersion));
64
+ if (applied != null && applied.AppliedVersions.size > 0) {
65
+ // Existing DB: every versioned migration it has not applied, above its baseline floor.
66
+ const versioned = sqlPaths.filter((p) => isUnappliedAboveFloor(p, applied));
61
67
  return Array.from(new Set([...versioned, ...repeatables]));
62
68
  }
63
69
  // Fresh DB: baseline + everything after it.
@@ -65,10 +71,14 @@ export function selectMigrationSlice(paths, currentVersion) {
65
71
  const versioned = sqlPaths.filter((p) => isInVersionedSlice(p, floorTimestamp));
66
72
  return Array.from(new Set([...versioned, ...repeatables]));
67
73
  }
68
- /** True if `filePath` is a versioned (`V`) migration whose timestamp is strictly after `currentVersion`. */
69
- function isVersionedAfter(filePath, currentVersion) {
74
+ /** True if `filePath` is a versioned (`V`) migration the database has not applied and that lies above its baseline floor. */
75
+ function isUnappliedAboveFloor(filePath, applied) {
70
76
  const parsed = parseMigrationFilename(path.basename(filePath));
71
- return parsed?.kind === 'V' && parsed.timestamp > currentVersion;
77
+ if (parsed?.kind !== 'V')
78
+ return false;
79
+ if (applied.AppliedVersions.has(parsed.timestamp))
80
+ return false;
81
+ return applied.BaselineFloor === null || parsed.timestamp > applied.BaselineFloor;
72
82
  }
73
83
  /** Returns the timestamp of the latest `B` baseline among the paths, or null if none. */
74
84
  function highestBaselineTimestamp(sqlPaths) {
@@ -115,7 +125,7 @@ export async function fetchMigrationSlice(opts) {
115
125
  return { dir, selected: [], usedFallback: true, cleanup };
116
126
  }
117
127
  const allPaths = await listTreePaths(git, migrationsRoot);
118
- const selected = selectMigrationSlice(allPaths, opts.currentVersion);
128
+ const selected = selectMigrationSlice(allPaths, opts.applied);
119
129
  const checkoutTargets = selected.length > 0 ? selected : [migrationsRoot];
120
130
  await git.raw(['sparse-checkout', 'set', '--no-cone', ...checkoutTargets]);
121
131
  await git.raw(['checkout']);
@@ -1 +1 @@
1
- {"version":3,"file":"migration-fetch.js","sourceRoot":"","sources":["../../src/lib/migration-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAe1D,uFAA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AO,GAAG;SACP,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @module lib/out-of-order
3
+ *
4
+ * Decides whether `mj migrate` lets Skyway apply versioned migrations older than the
5
+ * database's highest applied version.
6
+ *
7
+ * Release lines make this a normal upgrade case: a fix backported to a patch line ships
8
+ * byte-identical (same timestamp) on both lines, so a database upgraded from that line
9
+ * has applied files that are newer than migrations it has never run. With `outOfOrder`
10
+ * off, Skyway marks those older files IGNORED and refuses the whole run.
11
+ *
12
+ * Policy:
13
+ * - `outOfOrder` set explicitly in the config file: honoured as written.
14
+ * - Not set, and the run targets the core schema: enabled for this run when Skyway
15
+ * reports pending files older than the highest applied version; each one is logged.
16
+ * - Not set, any other schema (Open Apps): left off, as before.
17
+ *
18
+ * Files at or below a baseline row in history are never affected: Skyway reports them
19
+ * as ABOVE_BASELINE before it considers `outOfOrder`.
20
+ */
21
+ import type { MigrationStatus } from '@memberjunction/skyway-core';
22
+ /** Inputs to {@link DecideOutOfOrder}. */
23
+ export interface OutOfOrderInputs {
24
+ /** The `outOfOrder` value written in the config file, or undefined when it is not set. */
25
+ ExplicitSetting: boolean | undefined;
26
+ /** True when the run targets the core schema (`coreSchema`, normally `__mj`). */
27
+ IsCoreSchema: boolean;
28
+ /** Pending versioned migrations older than the highest applied version (see {@link FindOutOfOrderPending}). */
29
+ OutOfOrderPending: readonly MigrationStatus[];
30
+ }
31
+ /** Result of {@link DecideOutOfOrder}. */
32
+ export interface OutOfOrderDecision {
33
+ /** Value to hand Skyway as `Migrations.OutOfOrder` for this run. */
34
+ OutOfOrder: boolean;
35
+ /** True when the CLI turned `outOfOrder` on for this run (it was not set in config). */
36
+ EnabledAutomatically: boolean;
37
+ /** True when out-of-order files exist but the config explicitly sets `outOfOrder: false`. */
38
+ BlockedByExplicitSetting: boolean;
39
+ }
40
+ /**
41
+ * Reads `outOfOrder` from the raw (pre-Zod) config. The CLI's built-in defaults do not
42
+ * include the key and the schema default is applied only at parse time, so the key is
43
+ * present in the raw config only when the user's config file sets it.
44
+ */
45
+ export declare function ReadExplicitOutOfOrder(rawConfig: Record<string, unknown> | undefined): boolean | undefined;
46
+ /**
47
+ * Pure: picks the versioned migrations Skyway would refuse as out of order. Skyway marks a
48
+ * versioned file IGNORED only when it is unapplied, above any baseline floor, below the
49
+ * highest applied version, and `outOfOrder` is off — exactly the files this run would skip.
50
+ */
51
+ export declare function FindOutOfOrderPending(statusReport: readonly MigrationStatus[]): MigrationStatus[];
52
+ /** Pure: applies the policy described in the module header. */
53
+ export declare function DecideOutOfOrder(inputs: OutOfOrderInputs): OutOfOrderDecision;
54
+ /** True when the probe for out-of-order files is worth running (it costs one history read). */
55
+ export declare function ShouldProbeOutOfOrder(explicitSetting: boolean | undefined, isCoreSchema: boolean): boolean;
56
+ //# sourceMappingURL=out-of-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"out-of-order.d.ts","sourceRoot":"","sources":["../../src/lib/out-of-order.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,0CAA0C;AAC1C,MAAM,WAAW,gBAAgB;IAC/B,0FAA0F;IAC1F,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,iFAAiF;IACjF,YAAY,EAAE,OAAO,CAAC;IACtB,+GAA+G;IAC/G,iBAAiB,EAAE,SAAS,eAAe,EAAE,CAAC;CAC/C;AAED,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,oEAAoE;IACpE,UAAU,EAAE,OAAO,CAAC;IACpB,wFAAwF;IACxF,oBAAoB,EAAE,OAAO,CAAC;IAC9B,6FAA6F;IAC7F,wBAAwB,EAAE,OAAO,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAG1G;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CAEjG;AAED,+DAA+D;AAC/D,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB,CAW7E;AAED,+FAA+F;AAC/F,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAI1G"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Reads `outOfOrder` from the raw (pre-Zod) config. The CLI's built-in defaults do not
3
+ * include the key and the schema default is applied only at parse time, so the key is
4
+ * present in the raw config only when the user's config file sets it.
5
+ */
6
+ export function ReadExplicitOutOfOrder(rawConfig) {
7
+ const value = rawConfig?.outOfOrder;
8
+ return typeof value === 'boolean' ? value : undefined;
9
+ }
10
+ /**
11
+ * Pure: picks the versioned migrations Skyway would refuse as out of order. Skyway marks a
12
+ * versioned file IGNORED only when it is unapplied, above any baseline floor, below the
13
+ * highest applied version, and `outOfOrder` is off — exactly the files this run would skip.
14
+ */
15
+ export function FindOutOfOrderPending(statusReport) {
16
+ return statusReport.filter((s) => s.Type === 'versioned' && s.State === 'IGNORED');
17
+ }
18
+ /** Pure: applies the policy described in the module header. */
19
+ export function DecideOutOfOrder(inputs) {
20
+ const hasOutOfOrder = inputs.OutOfOrderPending.length > 0;
21
+ if (inputs.ExplicitSetting !== undefined) {
22
+ return {
23
+ OutOfOrder: inputs.ExplicitSetting,
24
+ EnabledAutomatically: false,
25
+ BlockedByExplicitSetting: !inputs.ExplicitSetting && hasOutOfOrder,
26
+ };
27
+ }
28
+ const enable = inputs.IsCoreSchema && hasOutOfOrder;
29
+ return { OutOfOrder: enable, EnabledAutomatically: enable, BlockedByExplicitSetting: false };
30
+ }
31
+ /** True when the probe for out-of-order files is worth running (it costs one history read). */
32
+ export function ShouldProbeOutOfOrder(explicitSetting, isCoreSchema) {
33
+ // An explicit `true` needs no probe, and a non-core run never auto-enables. An explicit
34
+ // `false` on the core schema is probed only to explain the refusal Skyway will report.
35
+ return explicitSetting !== true && isCoreSchema;
36
+ }
37
+ //# sourceMappingURL=out-of-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"out-of-order.js","sourceRoot":"","sources":["../../src/lib/out-of-order.ts"],"names":[],"mappings":"AA0CA;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAA8C;IACnF,MAAM,KAAK,GAAG,SAAS,EAAE,UAAU,CAAC;IACpC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACxD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAwC;IAC5E,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACrF,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IACvD,MAAM,aAAa,GAAG,MAAM,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO;YACL,UAAU,EAAE,MAAM,CAAC,eAAe;YAClC,oBAAoB,EAAE,KAAK;YAC3B,wBAAwB,EAAE,CAAC,MAAM,CAAC,eAAe,IAAI,aAAa;SACnE,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,IAAI,aAAa,CAAC;IACpD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,wBAAwB,EAAE,KAAK,EAAE,CAAC;AAC/F,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,qBAAqB,CAAC,eAAoC,EAAE,YAAqB;IAC/F,wFAAwF;IACxF,uFAAuF;IACvF,OAAO,eAAe,KAAK,IAAI,IAAI,YAAY,CAAC;AAClD,CAAC"}
@@ -4510,139 +4510,6 @@
4510
4510
  "watch.js"
4511
4511
  ]
4512
4512
  },
4513
- "translate-sql": {
4514
- "aliases": [],
4515
- "args": {},
4516
- "description": "Translate SQL fragments between database dialects (SQL Server ↔ PostgreSQL)",
4517
- "examples": [
4518
- "<%= config.bin %> translate-sql --from sqlserver --to postgresql --dry-run",
4519
- "<%= config.bin %> translate-sql --from sqlserver --to postgresql --scope queries",
4520
- "<%= config.bin %> translate-sql --from sqlserver --to postgresql --sql \"SELECT TOP 10 [Name] FROM [Users]\"",
4521
- "<%= config.bin %> translate-sql --from sqlserver --to postgresql --scope all --output ./reports"
4522
- ],
4523
- "flags": {
4524
- "from": {
4525
- "description": "Source SQL dialect",
4526
- "name": "from",
4527
- "required": true,
4528
- "hasDynamicHelp": false,
4529
- "multiple": false,
4530
- "options": [
4531
- "sqlserver",
4532
- "postgresql"
4533
- ],
4534
- "type": "option"
4535
- },
4536
- "to": {
4537
- "description": "Target SQL dialect",
4538
- "name": "to",
4539
- "required": true,
4540
- "hasDynamicHelp": false,
4541
- "multiple": false,
4542
- "options": [
4543
- "sqlserver",
4544
- "postgresql"
4545
- ],
4546
- "type": "option"
4547
- },
4548
- "scope": {
4549
- "description": "What to scan for translation",
4550
- "name": "scope",
4551
- "default": "all",
4552
- "hasDynamicHelp": false,
4553
- "multiple": false,
4554
- "options": [
4555
- "queries",
4556
- "views",
4557
- "filters",
4558
- "all"
4559
- ],
4560
- "type": "option"
4561
- },
4562
- "sql": {
4563
- "description": "Translate a single SQL fragment (inline mode)",
4564
- "name": "sql",
4565
- "hasDynamicHelp": false,
4566
- "multiple": false,
4567
- "type": "option"
4568
- },
4569
- "dry-run": {
4570
- "description": "Show what would be translated without making changes",
4571
- "name": "dry-run",
4572
- "allowNo": false,
4573
- "type": "boolean"
4574
- },
4575
- "review": {
4576
- "description": "Generate review report only (no writes to database)",
4577
- "name": "review",
4578
- "allowNo": false,
4579
- "type": "boolean"
4580
- },
4581
- "output": {
4582
- "char": "o",
4583
- "description": "Output directory for the translation report",
4584
- "name": "output",
4585
- "hasDynamicHelp": false,
4586
- "multiple": false,
4587
- "type": "option"
4588
- },
4589
- "force": {
4590
- "description": "Re-translate even if platform variants already exist",
4591
- "name": "force",
4592
- "allowNo": false,
4593
- "type": "boolean"
4594
- }
4595
- },
4596
- "hasDynamicHelp": false,
4597
- "hiddenAliases": [],
4598
- "id": "translate-sql",
4599
- "pluginAlias": "@memberjunction/cli",
4600
- "pluginName": "@memberjunction/cli",
4601
- "pluginType": "core",
4602
- "strict": true,
4603
- "enableJsonFlag": false,
4604
- "isESM": true,
4605
- "relativePath": [
4606
- "dist",
4607
- "commands",
4608
- "translate-sql",
4609
- "index.js"
4610
- ]
4611
- },
4612
- "translate-sql:usage": {
4613
- "aliases": [],
4614
- "args": {},
4615
- "description": "Show usage, flags, examples, and runtime hints for every `mj translate-sql` command.",
4616
- "flags": {
4617
- "format": {
4618
- "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
4619
- "name": "format",
4620
- "hasDynamicHelp": false,
4621
- "multiple": false,
4622
- "options": [
4623
- "text",
4624
- "json",
4625
- "md"
4626
- ],
4627
- "type": "option"
4628
- }
4629
- },
4630
- "hasDynamicHelp": false,
4631
- "hiddenAliases": [],
4632
- "id": "translate-sql:usage",
4633
- "pluginAlias": "@memberjunction/cli",
4634
- "pluginName": "@memberjunction/cli",
4635
- "pluginType": "core",
4636
- "strict": true,
4637
- "enableJsonFlag": false,
4638
- "isESM": true,
4639
- "relativePath": [
4640
- "dist",
4641
- "commands",
4642
- "translate-sql",
4643
- "usage.js"
4644
- ]
4645
- },
4646
4513
  "test:compare": {
4647
4514
  "aliases": [],
4648
4515
  "args": {
@@ -5327,6 +5194,139 @@
5327
5194
  "validate.js"
5328
5195
  ]
5329
5196
  },
5197
+ "translate-sql": {
5198
+ "aliases": [],
5199
+ "args": {},
5200
+ "description": "Translate SQL fragments between database dialects (SQL Server ↔ PostgreSQL)",
5201
+ "examples": [
5202
+ "<%= config.bin %> translate-sql --from sqlserver --to postgresql --dry-run",
5203
+ "<%= config.bin %> translate-sql --from sqlserver --to postgresql --scope queries",
5204
+ "<%= config.bin %> translate-sql --from sqlserver --to postgresql --sql \"SELECT TOP 10 [Name] FROM [Users]\"",
5205
+ "<%= config.bin %> translate-sql --from sqlserver --to postgresql --scope all --output ./reports"
5206
+ ],
5207
+ "flags": {
5208
+ "from": {
5209
+ "description": "Source SQL dialect",
5210
+ "name": "from",
5211
+ "required": true,
5212
+ "hasDynamicHelp": false,
5213
+ "multiple": false,
5214
+ "options": [
5215
+ "sqlserver",
5216
+ "postgresql"
5217
+ ],
5218
+ "type": "option"
5219
+ },
5220
+ "to": {
5221
+ "description": "Target SQL dialect",
5222
+ "name": "to",
5223
+ "required": true,
5224
+ "hasDynamicHelp": false,
5225
+ "multiple": false,
5226
+ "options": [
5227
+ "sqlserver",
5228
+ "postgresql"
5229
+ ],
5230
+ "type": "option"
5231
+ },
5232
+ "scope": {
5233
+ "description": "What to scan for translation",
5234
+ "name": "scope",
5235
+ "default": "all",
5236
+ "hasDynamicHelp": false,
5237
+ "multiple": false,
5238
+ "options": [
5239
+ "queries",
5240
+ "views",
5241
+ "filters",
5242
+ "all"
5243
+ ],
5244
+ "type": "option"
5245
+ },
5246
+ "sql": {
5247
+ "description": "Translate a single SQL fragment (inline mode)",
5248
+ "name": "sql",
5249
+ "hasDynamicHelp": false,
5250
+ "multiple": false,
5251
+ "type": "option"
5252
+ },
5253
+ "dry-run": {
5254
+ "description": "Show what would be translated without making changes",
5255
+ "name": "dry-run",
5256
+ "allowNo": false,
5257
+ "type": "boolean"
5258
+ },
5259
+ "review": {
5260
+ "description": "Generate review report only (no writes to database)",
5261
+ "name": "review",
5262
+ "allowNo": false,
5263
+ "type": "boolean"
5264
+ },
5265
+ "output": {
5266
+ "char": "o",
5267
+ "description": "Output directory for the translation report",
5268
+ "name": "output",
5269
+ "hasDynamicHelp": false,
5270
+ "multiple": false,
5271
+ "type": "option"
5272
+ },
5273
+ "force": {
5274
+ "description": "Re-translate even if platform variants already exist",
5275
+ "name": "force",
5276
+ "allowNo": false,
5277
+ "type": "boolean"
5278
+ }
5279
+ },
5280
+ "hasDynamicHelp": false,
5281
+ "hiddenAliases": [],
5282
+ "id": "translate-sql",
5283
+ "pluginAlias": "@memberjunction/cli",
5284
+ "pluginName": "@memberjunction/cli",
5285
+ "pluginType": "core",
5286
+ "strict": true,
5287
+ "enableJsonFlag": false,
5288
+ "isESM": true,
5289
+ "relativePath": [
5290
+ "dist",
5291
+ "commands",
5292
+ "translate-sql",
5293
+ "index.js"
5294
+ ]
5295
+ },
5296
+ "translate-sql:usage": {
5297
+ "aliases": [],
5298
+ "args": {},
5299
+ "description": "Show usage, flags, examples, and runtime hints for every `mj translate-sql` command.",
5300
+ "flags": {
5301
+ "format": {
5302
+ "description": "Output format. Defaults to text on a terminal and json when stdout is piped.",
5303
+ "name": "format",
5304
+ "hasDynamicHelp": false,
5305
+ "multiple": false,
5306
+ "options": [
5307
+ "text",
5308
+ "json",
5309
+ "md"
5310
+ ],
5311
+ "type": "option"
5312
+ }
5313
+ },
5314
+ "hasDynamicHelp": false,
5315
+ "hiddenAliases": [],
5316
+ "id": "translate-sql:usage",
5317
+ "pluginAlias": "@memberjunction/cli",
5318
+ "pluginName": "@memberjunction/cli",
5319
+ "pluginType": "core",
5320
+ "strict": true,
5321
+ "enableJsonFlag": false,
5322
+ "isESM": true,
5323
+ "relativePath": [
5324
+ "dist",
5325
+ "commands",
5326
+ "translate-sql",
5327
+ "usage.js"
5328
+ ]
5329
+ },
5330
5330
  "update:claude": {
5331
5331
  "aliases": [],
5332
5332
  "args": {},
@@ -6862,5 +6862,5 @@
6862
6862
  ]
6863
6863
  }
6864
6864
  },
6865
- "version": "6.1.6"
6865
+ "version": "6.1.8"
6866
6866
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/cli",
3
3
  "type": "module",
4
- "version": "6.1.6",
4
+ "version": "6.1.8",
5
5
  "description": "MemberJunction command line tools",
6
6
  "keywords": [
7
7
  "oclif"
@@ -48,27 +48,27 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@inquirer/prompts": "^8.2.0",
51
- "@memberjunction/ai-cli": "6.1.6",
52
- "@memberjunction/cli-core": "6.1.6",
53
- "@memberjunction/codegen-lib": "6.1.6",
54
- "@memberjunction/config": "6.1.6",
55
- "@memberjunction/core": "6.1.6",
56
- "@memberjunction/generic-database-provider": "6.1.6",
57
- "@memberjunction/installer": "6.1.6",
58
- "@memberjunction/dynamic-packages": "6.1.6",
59
- "@memberjunction/db-auto-doc": "6.1.6",
60
- "@memberjunction/metadata-sync": "6.1.6",
61
- "@memberjunction/open-app-engine": "6.1.6",
62
- "@memberjunction/query-gen": "6.1.6",
63
- "@memberjunction/server-bootstrap-lite": "6.1.6",
51
+ "@memberjunction/ai-cli": "6.1.8",
52
+ "@memberjunction/cli-core": "6.1.8",
53
+ "@memberjunction/codegen-lib": "6.1.8",
54
+ "@memberjunction/config": "6.1.8",
55
+ "@memberjunction/core": "6.1.8",
56
+ "@memberjunction/generic-database-provider": "6.1.8",
57
+ "@memberjunction/installer": "6.1.8",
58
+ "@memberjunction/dynamic-packages": "6.1.8",
59
+ "@memberjunction/db-auto-doc": "6.1.8",
60
+ "@memberjunction/metadata-sync": "6.1.8",
61
+ "@memberjunction/open-app-engine": "6.1.8",
62
+ "@memberjunction/query-gen": "6.1.8",
63
+ "@memberjunction/server-bootstrap-lite": "6.1.8",
64
64
  "@memberjunction/skyway-core": "^0.6.2",
65
65
  "@memberjunction/skyway-postgres": "^0.6.2",
66
66
  "@memberjunction/skyway-sqlserver": "^0.6.2",
67
- "@memberjunction/sql-converter": "6.1.6",
68
- "@memberjunction/sqlglot-ts": "6.1.6",
69
- "@memberjunction/sqlserver-dataprovider": "6.1.6",
70
- "@memberjunction/standards": "6.1.6",
71
- "@memberjunction/testing-cli": "6.1.6",
67
+ "@memberjunction/sql-converter": "6.1.8",
68
+ "@memberjunction/sqlglot-ts": "6.1.8",
69
+ "@memberjunction/sqlserver-dataprovider": "6.1.8",
70
+ "@memberjunction/standards": "6.1.8",
71
+ "@memberjunction/testing-cli": "6.1.8",
72
72
  "@oclif/core": "^3.27.0",
73
73
  "@oclif/plugin-help": "^6.2.37",
74
74
  "@oclif/plugin-version": "^2.2.36",
@@ -88,9 +88,9 @@
88
88
  "recast": "^0.23.11",
89
89
  "simple-git": "^3.30.0",
90
90
  "zod": "^3.25.0",
91
- "@memberjunction/core-entities": "6.1.6",
92
- "@memberjunction/global": "6.1.6",
93
- "@memberjunction/aiengine": "6.1.6"
91
+ "@memberjunction/core-entities": "6.1.8",
92
+ "@memberjunction/global": "6.1.8",
93
+ "@memberjunction/aiengine": "6.1.8"
94
94
  },
95
95
  "devDependencies": {
96
96
  "@oclif/prettier-config": "^0.2.1",