warehouse
warehouse copied to clipboard
Migrate keywords data structure to Postgres ARRAY type
This will be taken apart and shipped in parts.
🚨 Note: Data migration contained within
Does not drop existing column, but removes references to it.
Once merged, no new Releases will populate their keywords column, only the keywords_array column will be filled.
I haven't read the entire PR yet, but you probably want this split over multiple deploys, currently what's going to happen is:
- Column will be added, data migration will be run.
- New deployment will occur with the new code.
- Old deployment will be spun down, shutting down old code.
The important bit of that is that the old code will still be running after the data migration has completed, so anything uploaded in that window of time via the old code will have keywords populated, but not keywords_array.
So I would refactor this into multiple PRs, that we can deploy in separate deployments:
- Adds the
keywords_arraycolumn, sets up the upload code to write both columns. - Does the data migration, guarding not to run against rows that (1) would have already written, sets up the code to only use the
keywords_arraycolumn.- Optional: This could also drop the
keywordscolumn from the code, but not from the database, making SQLAlchemy completely ignore that column.
- Optional: This could also drop the
- If the
keywordscolumn has been dropped from the code, drop it from the database as well.
probably want this split over multiple deploys
Yep! Going to dismantle and rebuild, now that all the pieces are known.