Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Connect to CliDE database and check schema matches ORM models (for CliDE/Postgres) #11

@isedwards

Description

@isedwards

This issue requires an instance of PostgreSQL to be running with CliDE database restored (instructions for restoring the CliDE schema are given in #9).

The aim is to make one or more small changes to the CliDE database in Postgres, e.g.

ALTER TABLE stations ALTER COLUMN start_date int;
ALTER TABLE stations DROP COLUMN end_date;

When pyopencdms connects to the database we would like to have a method that can detect whether the schema is the same as our models. It is important that we:

a) detect if the schema is not exactly what we expected it to be
b) report the exact difference
c) do not change the database to match our model

Before beginning an implementation, the approach should be discussed in the comments below. It's possible that we may use alembic to detect the differences, e.g. by getting diffs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions