symmetria-kit 3.3.0 → 3.4.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.
@@ -1 +1 @@
1
- export { t as explainLines, n as inspectQueryScreen, r as inspectValue, i as terminalText, a as wrapExplainLines } from "../query-inspector-CBU9Ug5e.js";
1
+ export { t as explainLines, n as inspectQueryScreen, r as inspectValue, i as terminalText, a as wrapExplainLines } from "../query-inspector-C-7K9wtB.js";
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { _ as migrationSnapshot, x as snapshotHash, y as parseMigrationSnapshot } from "./ddl-CYsBI6_H.js";
3
- import { d as formatDriftFindings, i as diffSchemas, u as detectDrift } from "./diff-D2EbyDmY.js";
4
- import { _ as lintMigration, a as boundaryDifferences, c as MigrationExecutionError, d as generateMigration, f as loadMigrationState, g as formatLintFindings, h as recoverMigrationFiles, l as lintMigrationSQL, m as squashMigrations, n as schemaGraph, o as verifyMigrations, r as pullSchema, s as migrator, t as renderMermaid, u as discardMigration, v as parseMigrationSQL } from "./src-Dog3TEh8.js";
5
- import { A as terminalWidth, C as view, D as formatError, E as fitLine, M as wrapLines, O as numberedLines, S as choose, T as withSpinner, _ as formatHelp, a as wrapExplainLines, b as formatStatus, c as inspectTableSQL, d as matchesTableName, f as matchingTables, g as formatExecution, h as formatDiff, i as terminalText, j as theme, k as supportsColor, l as inspectTabs, m as formatDashboard, o as highlightSQL, p as formatCreated, s as inspectEntries, t as explainLines, u as matchesEntry, v as formatPullWarnings, w as withScreen, x as ask, y as formatSchema } from "./query-inspector-CBU9Ug5e.js";
2
+ import { _ as migrationSnapshot, x as snapshotHash, y as parseMigrationSnapshot } from "./ddl-CtdVeD9m.js";
3
+ import { c as parseMigrationSQL, g as formatDriftFindings, h as detectDrift, i as diffSchemas, o as lintMigrationSQL } from "./diff-DA7huWi5.js";
4
+ import { a as boundaryDifferences, c as MigrationExecutionError, d as loadMigrationState, g as lintMigration, h as formatLintFindings, l as discardMigration, m as recoverMigrationFiles, n as schemaGraph, o as verifyMigrations, p as squashMigrations, r as pullSchema, s as migrator, t as renderMermaid, u as generateMigration } from "./src-J1Nn7Wca.js";
5
+ import { A as terminalWidth, C as view, D as formatError, E as fitLine, M as wrapLines, O as numberedLines, S as choose, T as withSpinner, _ as formatHelp, a as wrapExplainLines, b as formatStatus, c as inspectTableSQL, d as matchesTableName, f as matchingTables, g as formatExecution, h as formatDiff, i as terminalText, j as theme, k as supportsColor, l as inspectTabs, m as formatDashboard, o as highlightSQL, p as formatCreated, s as inspectEntries, t as explainLines, u as matchesEntry, v as formatPullWarnings, w as withScreen, x as ask, y as formatSchema } from "./query-inspector-C-7K9wtB.js";
6
6
  import * as nodeModule from "node:module";
7
7
  import { access, lstat, mkdir, open, readFile, readdir, rm, writeFile } from "node:fs/promises";
8
- import { basename, dirname, extname, relative, resolve } from "node:path";
8
+ import { basename, dirname, extname, join, relative, resolve } from "node:path";
9
9
  import { parseArgs, stripVTControlCharacters } from "node:util";
10
10
  import { postgres } from "symmetria/driver";
11
11
  import { sqlState } from "symmetria";
@@ -825,7 +825,8 @@ const squash = async (context, project, name) => {
825
825
  const discard = async (context, project, id) => {
826
826
  const { values } = context;
827
827
  const { migrations } = await loadMigrationState(project.directory).catch(() => ({ migrations: [] }));
828
- const latest = migrations.at(-1)?.id;
828
+ const listed = migrations.length ? void 0 : await readFile(join(project.directory, "meta", "migration.json"), "utf8").then((text) => JSON.parse(text).migrations?.at(-1)?.id, () => void 0);
829
+ const latest = migrations.at(-1)?.id ?? (typeof listed === "string" ? listed : void 0);
829
830
  if (latest !== void 0) {
830
831
  if (project.databaseUrl) {
831
832
  const driver = postgres(project.databaseUrl);