Open Ian-Stewart-Binks opened 9 years ago
This can certainly be done (and should be). See #620 for initial work on this.
@klmerryn Why don't you work on this.
Take a look at the Lecture and Course tables in app/Database/Tables.hs. The Lecture table has a column called "code", which is currently just text (you can see this in the contents of the database itself). Try removing this column and replacing it with a CourseId column instead. Note that this actually will break a few different things, so you'll need to look at the existing code carefully to see how we deal with existing keys, and read the Persistent documentation carefully.
thought I had replied already -- on it, thank you!
Tables.hs does not contain any foreign key constraints, but it should. I'm not certain if this is possible with Persistent, but it's worth looking into.
If I recall correctly, foreign key constraints need to be enabled for Persistent's SQLite.