Database/Model refactors which need migration
Here we can add database and model refactors that need migrations. After having enough refactor list, we would fix them. This can help us have more integrated changes and less migration revisions.
unique constraint for (group <---> category) at basic.opportunity_study_area_confifg
As each category belongs to one group maybe we need to unique these two. But as we have different study areas maybe we should have constraint for (group <---> category <---> study_area) However this can make our table complex. So maybe needs more discussion about it.
refactor foreign key at customer.layer_library.source_{1,2} to connect to customer.layer_source.id
Now these two foreign keys are connected to layer_source.name. As layer_source.name is long, we can refactor to connect to id so that the objects and requests can be more clean. This also needs to change the endpoints to query source field while querying the layer_library itself.
unique constraint for (group <---> category) at basic.opportunity_study_area_confifg
As each category belongs to one group maybe we need to unique these two. But as we have different study areas maybe we should have constraint for (group <---> category <---> study_area) However this can make our table complex. So maybe it needs more discussion about it.
Yes I also believe (group <---> category <---> study_area) is better. As it could be that we change the groups. So this combination should be really unique. We currently already have a unique key category <---> study_area. I believe we would need the other one in addition.
I am also unhappy with this. Also the style table uses the name. We did this kind of very fast without thinking enough and when doing it one requirement was to be able adding the information fast to the DB table using Dbeaver. Now as we have the endpoints this is not needed anymore.