Courseography / courseography

Courseography is a tool created by David Liu and Ian Stewart-Binks to guide students through their undergraduate careers.
GNU General Public License v3.0
59 stars 65 forks source link

Add Foreign Key Constraints To Tables.hs #309

Open Ian-Stewart-Binks opened 9 years ago

Ian-Stewart-Binks commented 9 years ago

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.

david-yz-liu commented 9 years ago

This can certainly be done (and should be). See #620 for initial work on this.

david-yz-liu commented 8 years ago

@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.

klmerryn commented 8 years ago

thought I had replied already -- on it, thank you!