Use ordered SQLite migrations (Refs #75)
CI / checks (push) Successful in 5m6s

This commit is contained in:
2026-10-10 00:01:18 -04:00
parent a0663e43b8
commit 8d1bb69591
56 changed files with 1085 additions and 736 deletions
-3
View File
@@ -22,7 +22,6 @@ async function exclusive<T>(id: number, action: () => Promise<T>): Promise<T> {
import { mkdir, rm, writeFile } from 'node:fs/promises';
import { readFile, exists } from '../backends/files.js';
import { getHostOperation } from '../hosts/index.js';
import { ensureHostSchema } from '../hosts/schema.js';
import { join, posix } from 'node:path';
import { betaArchiveOf, configFileOf, destOfKind, type ArtifactKind } from '../config.js';
@@ -668,7 +667,6 @@ export async function reviseBeta(
'invalid-state'
);
}
ensureHostSchema(db());
assertNativeActivationSettled(betaId);
if (stagedFileChanges('beta', String(betaId)).some((row) => row.state === 'applying')) {
throw new BetaError(
@@ -961,7 +959,6 @@ async function rollbackBetaInternal(
versionId: br.script_version_id
}));
ensureHostSchema(db());
db().transaction(() => {
const jobs = db()
.prepare(
@@ -1,5 +1,4 @@
import { db } from '../db/index.js';
import { ensureHostSchema } from '../hosts/schema.js';
import { HEARTBEAT_MAX_AGE_MS } from '../hosts/index.js';
import { parseHostInventory } from '../hosts/request-context.js';
import type { Host } from '../../hosts.js';
@@ -70,7 +69,6 @@ interface Record {
export class MonitoringSnapshot {
private records = new Map<string, Record>();
constructor(serverName?: string) {
ensureHostSchema(db());
this.refresh(serverName);
}
refresh(server?: string): void {