Skip to content

Tests: add tests for internal/db Migrate #23

@koinsaari

Description

@koinsaari

internal/db has no tests. Migrate and the PostGIS spatial index creation are exercised only as a side-effect of other integration tests — there is no explicit test that they work on a fresh DB or that re-running them is idempotent.

Suggested coverage

  • Spin up a clean Postgres+PostGIS via testcontainers.
  • Run Migrate twice; assert no error on the second run (idempotency).
  • Assert that the expected tables (places, accessibility_profiles) and the spatial GIST index exist.
  • Once Replace AutoMigrate with a real migration tool #9 (real migrations) lands, replace this with proper migration up/down tests.
  • File: new internal/db/integration_test.go.

Depends on / pairs with: #9 (replace AutoMigrate with a real migration tool).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions