nycmeshnet / meshdb

A convenient, stable, and sane database for tracking Members and Nodes for use with robots and humans
https://db.nycmesh.net
MIT License
12 stars 14 forks source link

Consolidate migrations into single file with thermonuclear option #594

Closed Andrew-Dickinson closed 3 weeks ago

Andrew-Dickinson commented 2 months ago
rm -rf src/meshapi/migrations
python src/manage.py makemigrations

Then everywhere that we have a DB, drop all the tables (super destructive option, make sure you have a backup first):

DROP SCHEMA public CASCADE;
CREATE SCHEMA public;

And run the combined migration

python src/manage.py migrate

Then to get the data back, import from a backup, run the import script, use scripts/import_spreadsheet_dump.sh, etc.