@cleocode/cleo 2026.4.43 → 2026.4.45
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/cli/index.js +21 -15
- package/dist/cli/index.js.map +2 -2
- package/package.json +8 -8
package/dist/cli/index.js
CHANGED
|
@@ -11467,16 +11467,27 @@ function reconcileJournal(nativeDb, migrationsFolder, existenceTable, logSubsyst
|
|
|
11467
11467
|
const localMigrations = readMigrationFiles({ migrationsFolder });
|
|
11468
11468
|
const localHashes = new Set(localMigrations.map((m2) => m2.hash));
|
|
11469
11469
|
const dbEntries = nativeDb.prepare('SELECT hash FROM "__drizzle_migrations"').all();
|
|
11470
|
-
const
|
|
11470
|
+
const orphanedEntries = dbEntries.filter((e) => !localHashes.has(e.hash));
|
|
11471
|
+
const hasOrphanedEntries = orphanedEntries.length > 0;
|
|
11471
11472
|
if (hasOrphanedEntries) {
|
|
11472
|
-
const
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
|
|
11479
|
-
|
|
11473
|
+
const dbHashes = new Set(dbEntries.map((e) => e.hash));
|
|
11474
|
+
const allLocalHashesPresentInDb = localMigrations.every((m2) => dbHashes.has(m2.hash));
|
|
11475
|
+
if (allLocalHashesPresentInDb) {
|
|
11476
|
+
const log12 = getLogger(logSubsystem);
|
|
11477
|
+
log12.debug(
|
|
11478
|
+
{ extra: orphanedEntries.length },
|
|
11479
|
+
`Migration journal has ${orphanedEntries.length} entries for migrations not known to this install (DB is ahead). Skipping reconciliation.`
|
|
11480
|
+
);
|
|
11481
|
+
} else {
|
|
11482
|
+
const log12 = getLogger(logSubsystem);
|
|
11483
|
+
log12.warn(
|
|
11484
|
+
{ orphaned: orphanedEntries.length },
|
|
11485
|
+
`Detected stale migration journal entries from a previous CLEO version. Reconciling.`
|
|
11486
|
+
);
|
|
11487
|
+
nativeDb.exec('DELETE FROM "__drizzle_migrations"');
|
|
11488
|
+
for (const m2 of localMigrations) {
|
|
11489
|
+
insertJournalEntry(nativeDb, m2.hash, m2.folderMillis, m2.name ?? "");
|
|
11490
|
+
}
|
|
11480
11491
|
}
|
|
11481
11492
|
}
|
|
11482
11493
|
}
|
|
@@ -14993,12 +15004,7 @@ function runBrainMigrations(nativeDb, db) {
|
|
|
14993
15004
|
"brain"
|
|
14994
15005
|
);
|
|
14995
15006
|
}
|
|
14996
|
-
ensureColumns(
|
|
14997
|
-
nativeDb,
|
|
14998
|
-
"brain_observations",
|
|
14999
|
-
[{ name: "agent", ddl: "text" }],
|
|
15000
|
-
"brain"
|
|
15001
|
-
);
|
|
15007
|
+
ensureColumns(nativeDb, "brain_observations", [{ name: "agent", ddl: "text" }], "brain");
|
|
15002
15008
|
}
|
|
15003
15009
|
function loadBrainVecExtension(nativeDb) {
|
|
15004
15010
|
try {
|