rcos / rcos-data

RCOS database definition and internal API.
MIT License
3 stars 1 forks source link

Break up the rcos.sql file #6

Closed rushsteve1 closed 3 years ago

rushsteve1 commented 3 years ago

This PR breaks up the massive rcos.sql and converts it and the other SQL files into DbMate migrations. Migrations are ordered according to the timestamp at the start of their filename. Ignore some odd sequential timestamps, some things needed manual re-ordering.

Along with this I took the time to refactor much of the SQL and to cleanup a lot of the weirdness created from generating it from DBML. Along with various other things like some CHECKs, a new checked url type, and improved relations.

These migrations are fully functional and can be applied with dbmate up and rolled all the way back down to a clean database with dbmate down (you have to run that repeatedly since it only goes on at a time).