opendatacube / datacube-core

Open Data Cube analyses continental scale Earth Observation data through time
http://www.opendatacube.org
Apache License 2.0
493 stars 175 forks source link

Alembic-managed schema migrations for postgis driver. (cleaned up git history) #1520

Closed SpacemanPaul closed 6 months ago

SpacemanPaul commented 7 months ago

Reason for this pull request

The database schema for the postgres database has been frozen for years because making schema changes requires manually writing code to check whether an update is required and applying said update.

Alembic is a schema migration framework for SQLAlchemy that automates much of this.

Proposed changes

N.B. Some remaining coverage gaps that can't really be filled until we have some actual migrations lined up.

codecov[bot] commented 7 months ago

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (5be0e6e) 85.37% compared to head (bd72270) 85.16%.

Files Patch % Lines
datacube/drivers/postgis/alembic/env.py 42.18% 37 Missing :warning:
datacube/drivers/postgis/_core.py 70.37% 8 Missing :warning:
.../alembic/versions/48fb71ece268_initial_revision.py 80.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop-1.9 #1520 +/- ## =============================================== - Coverage 85.37% 85.16% -0.22% =============================================== Files 137 139 +2 Lines 14784 14895 +111 =============================================== + Hits 12622 12685 +63 - Misses 2162 2210 +48 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.