Closed rhystmills closed 1 year ago
Just a general comment, as there's some repetition in this PR – have you explored a way of sharing code between tables? I wonder if it might be possible to encapsulate common functionality in a trait, and leave the things that are not common (table name, syntax) to the inheriting objects?
Just a general comment, as there's some repetition in this PR – have you explored a way of sharing code between tables? I wonder if it might be possible to encapsulate common functionality in a trait, and leave the things that are not common (table name, syntax) to the inheriting objects?
I wasn't quite sure how to do it but you have compelled me to figure it out, looking much better now!
What does this change?
Follow-up to https://github.com/guardian/typerighter/pull/330
Adds join tables for tags and rules, modelling the many-to-many relationships between the two. These relationships will have a live and draft state, modelled in separate live and draft tables.
This PR only adds:
It does not add routes for managing tag-rule relationships (e.g. endpoints for adding/removing tags to/from rules) or a UI, which will be added in follow-up PRs in order to keep this one simple.
How to test
./script.start
)sbt test
). Do they all pass?