Skip to content

chore(compose): drop redundant init-databases.sql (apps self-create their dbs)#13

Merged
ipasechnikov merged 1 commit into
mainfrom
chore/drop-redundant-init-db-sql
Jul 8, 2026
Merged

chore(compose): drop redundant init-databases.sql (apps self-create their dbs)#13
ipasechnikov merged 1 commit into
mainfrom
chore/drop-redundant-init-db-sql

Conversation

@ipasechnikov

Copy link
Copy Markdown
Collaborator

Why

Both apps create their own database on first boot, so pre-creating them via an initdb SQL is redundant on current versions:

  • Aidbox — always (creates its db after an initial connection retry).
  • Engine — since 1.4.0 (the ensure-database step). .env.example ships 1.4.2.

Verified empirically

With the init SQL gone and a fresh volume, docker compose up on 1.4.2:

  • created both interbox and aidbox databases,
  • engine logged ensuring database exists…migrations applied successfully,
  • Aidbox created its own db and booted.

(Also observed the negative case: on the old 1.3.1 image — which predates ensure-database — the engine does not self-create and needs the db pre-created.)

Changes

  • Delete compose/init-databases.sql and its pg volume mount.
  • Update the pg comment to note both apps self-create.

Caveat

Requires engine ≥ 1.4.0 (older images have no self-create step). .env.example is already 1.4.2.

🤖 Generated with Claude Code

…their dbs

Both apps create their own database on first boot: Aidbox always, and the engine
since 1.4.0 (the ensure-database step). Pre-creating interbox + aidbox via an
initdb SQL is therefore redundant on current versions (.env.example ships 1.4.2).

Verified empirically: with the init SQL gone and a fresh volume, `docker compose
up` on 1.4.2 creates both `interbox` and `aidbox` databases and boots — engine
logs "ensuring database exists…" then "migrations applied"; Aidbox creates its
own db after an initial retry.

Note: requires engine >= 1.4.0 (older images have no self-create step and would
need the db pre-created).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ipasechnikov ipasechnikov merged commit a97af9a into main Jul 8, 2026
2 checks passed
@ipasechnikov ipasechnikov deleted the chore/drop-redundant-init-db-sql branch July 8, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant