DPIclimate / broker

3 stars 3 forks source link

Add db schema versioning and upgrade mechanisms #50

Closed dajtxx closed 8 months ago

dajtxx commented 12 months ago

DB schema updates are manual and ad-hoc at present. It would be nice to have a schema versioning method and upgrade script.

Something like a schema version table containing a single column, single row with the schema version number in it.

A series of SQL upgrade scripts upgrades from one schema to another, identified by the version they upgrade to, such as 0001_upgrade.sql, 0002_upgrade.sql. 0001 upgrades from the last non-versioned schema to version 1.

A python script can check the current database schema and run the necessary upgrade scripts in order.

This will have to be run with only the db container running.

dajtxx commented 10 months ago

See issue #35

dajtxx commented 8 months ago

Fixed with commits e4b75444bc290ec979956083488a250c2f57ee2e, 1caf7d4dc24182dd4ae0ecebae2bc11900af5c68