diff --git a/src/servers/plugins/schema.ts b/src/servers/plugins/schema.ts index 50187d98..bf3243f7 100644 --- a/src/servers/plugins/schema.ts +++ b/src/servers/plugins/schema.ts @@ -190,20 +190,15 @@ export default defineConfig({ } /** - * Apply the schema to Postgres. + * The global push — `bun db:push` over the whole schema — is deliberately NOT used by installs. * - * Shells out to the same `bun db:push` a human runs, rather than driving drizzle-kit in-process: it is - * one definition of "apply the schema" instead of two that can disagree, and an owner can reproduce - * exactly what an install did with a command they already know. + * It was removed as a plugin's install step on 2026-08-16 and is not replaced by anything here: nothing + * in the server should run it. `scripts/setup/officer-setup/lib/build.sh` still does, once, on a machine + * that has no tables yet, which is the only situation where "make the database match this schema" is a + * safe instruction. * - * `--force` because there is nothing to prompt about by construction — the barrel only ever gains entries - * unless a plugin's source is deleted — and a prompt with no terminal attached would hang the install - * forever rather than fail it. + * On any machine that already holds tables the schema does not declare, that command is a trap. It stops + * on an interactive rename prompt no non-TTY caller can answer (applying nothing and exiting 0), and + * `--force` converts that into dropping every one of those tables. Both were observed on a real server: + * see `pushPluginSchema` below for the full account and for what installs do instead. */ -export async function pushSchema(onLog?: OnLog): Promise { - // Streamed rather than captured. drizzle writes progress to stderr and results to stdout, and this is - // the command that reported success while creating nothing — so what it says is worth showing at the - // time it says it, not summarised into a exit code afterwards. - const result = await runLogged(['bun', 'run', 'db:push', '--force'], { cwd: PLATFORM_DIR, onLog }); - return { ok: result.ok, ms: result.ms, output: result.output.slice(-600) }; -}