Skip to content

rpm: declarative SQL DB init, bare cloud-style names, single role #65

Merged
duynhne merged 1 commit into
mainfrom
ci/db-init-sql
Jun 30, 2026
Merged

rpm: declarative SQL DB init, bare cloud-style names, single role #65
duynhne merged 1 commit into
mainfrom
ci/db-init-sql

Conversation

@duynhne

@duynhne duynhne commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

… service

Replace the shell heredoc DB/role creation with two declarative, idempotent SQL
files applied by duynhlab-bootstrap; align DB names with the cloud (bare <svc>,
not duynhlab_<svc>); collapse the app/migrator two-role split into one
generated-password login role per service that owns its database.

- rpm/postgresql/init-users.sql: per-service login role (create + ALTER to sync
  password on upgrade), psql -v role/pass. Password still generated per install.
- rpm/postgresql/init-databases.sql: one CREATE DATABASE per service owned by its
  role; idempotent; reserved words (user, order) safe via format(%I).
- duynhlab-bootstrap: apply roles -> databases -> migrate (peer auth or
  SUPERUSER_DSN). duynhdb: drop the bootstrap subcommand; keep migrate/status.
- secret-tpl, registry, docs, test-install: bare DB_NAME/DB_USER=<svc>.
- delete the dead bootstrap.sql template.
@duynhne
duynhne merged commit 87b63f0 into main Jun 30, 2026
3 checks passed
@duynhne
duynhne deleted the ci/db-init-sql branch June 30, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant