Simplify codebase per audit of 8b89f14
This commit is contained in:
@@ -8,6 +8,8 @@ The data directory must remain private to the service's OS user (0700): it conta
|
||||
|
||||
Add SQL migrations in `internal/store/migrations/` as `NNN-name.sql`. The number only orders; a migration is identified by its name. A migration's SQL is fixed once applied anywhere: write it out in full rather than sharing Go constants that later change. Concurrent task branches can each add migrations, so after a merge a migration can land before others the database has already applied, and it still runs. Give a new migration a name no other branch will use, and make any data migration safe to run twice. `sqlite3 byre.db 'SELECT * FROM migrations'` lists what has been applied.
|
||||
|
||||
Migrations up to a threshold are folded into `100-baseline.sql`, the schema as they left it, and no data conversion survives below it. A database that hasn't applied the migration `baselineThrough` names (in `internal/store/store.go`) is refused at startup as too old; one that has is marked as on the baseline. To move the threshold up, apply the migrations to be folded to an empty database, dump its schema into the baseline file in place of the old one, delete those migrations' files, and set `baselineThrough` to the last one's name.
|
||||
|
||||
## Worktrees
|
||||
|
||||
byre runs nothing in a new worktree. Installing dependencies or copying untracked files such as `.env` is the project's own instruction in its AGENTS.md, carried out by the agent with its own tools.
|
||||
|
||||
Reference in New Issue
Block a user