Provision PostgreSQL for dev and test and configure the database URL #54

Closed
opened 2026-09-26 13:58:53 +00:00 by belvedere · 1 comment
Collaborator

Objective: A reachable Postgres instance for dev and test environments.

config/dev.exs and config/test.exs will need credentials; AshPostgres and Ecto both use the
same repo config.

Files:

  • Create: docker-compose.yml (or document a native install)
  • Modify: config/dev.exs, config/test.exs (read from DATABASE_URL where sensible)

Steps:

  1. Add a docker-compose.yml running postgres:17 with a named volume and a healthcheck, or
    document the native-install route.
  2. Point config/dev.exs and config/test.exs at it.
  3. Verify connectivity: mix ecto.create succeeds.

Verify:

docker compose up -d
mix ecto.create && mix ecto.migrate   # both succeed

Notes: test must use a distinct database (e.g. first_thousand_words_test) so the
mix test alias cannot truncate dev data.

**Objective:** A reachable Postgres instance for `dev` and `test` environments. `config/dev.exs` and `config/test.exs` will need credentials; AshPostgres and Ecto both use the same repo config. **Files:** - Create: `docker-compose.yml` (or document a native install) - Modify: `config/dev.exs`, `config/test.exs` (read from `DATABASE_URL` where sensible) **Steps:** 1. Add a `docker-compose.yml` running `postgres:17` with a named volume and a healthcheck, or document the native-install route. 2. Point `config/dev.exs` and `config/test.exs` at it. 3. Verify connectivity: `mix ecto.create` succeeds. **Verify:** ```bash docker compose up -d mix ecto.create && mix ecto.migrate # both succeed ``` **Notes:** `test` must use a distinct database (e.g. `first_thousand_words_test`) so the `mix test` alias cannot truncate dev data.
Author
Collaborator

Duplicate of #2 — created by a re-run whose pagination helper only saw the first page of issues. Closing to keep the backlog clean. Repo owner can delete this outright.

Duplicate of #2 — created by a re-run whose pagination helper only saw the first page of issues. Closing to keep the backlog clean. Repo owner can delete this outright.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nickkeers/first-thousand-words#54
No description provided.