ui/server: start no-company flow in onboarding and remove auto-seed

This commit is contained in:
Dotta
2026-03-03 11:25:56 -06:00
parent 4292c28654
commit 5f37b70be5
2 changed files with 33 additions and 37 deletions

View File

@@ -210,28 +210,6 @@ async function ensureLocalTrustedBoardPrincipal(db: any): Promise<void> {
}
}
async function ensureInitialCompanySeed(db: any): Promise<{ id: string; name: string; issuePrefix: string } | null> {
const existingCompany = await db
.select({ id: companies.id })
.from(companies)
.limit(1)
.then((rows: Array<{ id: string }>) => rows[0] ?? null);
if (existingCompany) return null;
return db
.insert(companies)
.values({
name: "Paperclip",
description: "Default company created on first startup",
})
.returning({
id: companies.id,
name: companies.name,
issuePrefix: companies.issuePrefix,
})
.then((rows: Array<{ id: string; name: string; issuePrefix: string }>) => rows[0] ?? null);
}
let db;
let embeddedPostgres: EmbeddedPostgresInstance | null = null;
let embeddedPostgresStartedByThisProcess = false;
@@ -383,11 +361,6 @@ if (config.databaseUrl) {
startupDbInfo = { mode: "embedded-postgres", dataDir, port };
}
const seededCompany = await ensureInitialCompanySeed(db as any);
if (seededCompany) {
logger.info(`Seeded initial company: ${seededCompany.name} (${seededCompany.issuePrefix})`);
}
if (config.deploymentMode === "local_trusted" && !isLoopbackHost(config.host)) {
throw new Error(
`local_trusted mode requires loopback host binding (received: ${config.host}). ` +