gut-space / satnogs

The goal of this project is to create a functional satellite ground station, able to receive VHF transmissions from NOAA sats and more!
https://aquarius.klub.com.pl
MIT License
10 stars 0 forks source link

DB migrations #32

Closed tomaszmrugalski closed 4 years ago

tomaszmrugalski commented 4 years ago

Our current approach to migrations is a bit primitive. Consider using something similar to: https://pypi.org/project/yoyo-migrations/ or https://pypi.org/project/raw-sql-migrate/

fivitti commented 4 years ago

Few useful links:

fivitti commented 4 years ago

I prepared migration script - migrate-db.py. It uses schema table to recognize DB version. Migration files should be in db directory in .psql. You need to use name convention:

satnogs-XX.psql

where XX is schema version. Solution isn't limited to range 00-99. It means that you can use satnogs-9999.psql and it will work correctly.

In migration script you need to include query for increment (set) version column in schema. In this way you have a possibility to perform migration manually without Python script.

tomaszmrugalski commented 4 years ago

Thanks for writing this. I've tested that script and it works well. I think this can be closed now.