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

Squash migrations using the "nuclear" option #634

Closed Andrew-Dickinson closed 2 weeks ago

Andrew-Dickinson commented 1 month ago

Removed all existing migration code, and ran python src/manage.py makemigrations to create new ones from scratch

Copied over the manually written migration for the readonly database role

Closes #594

Procedure to roll out this change:

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 new migrations

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.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.21%. Comparing base (fc2c805) to head (e63f3e5). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #634 +/- ## ======================================= Coverage 94.21% 94.21% ======================================= Files 80 80 Lines 3284 3284 ======================================= Hits 3094 3094 Misses 190 190 ```

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