backend icon indicating copy to clipboard operation
backend copied to clipboard

Add foreign key constraints to model changsets

Open tuesmiddt opened this issue 6 years ago • 2 comments

Where models have foreign keys that cannot be null, the tables should have appropriate constraints and changesets should also validate this with Ecto.Changeset.foreign_key_constraint/3.

See here for difference with Ecto.Changeset.assoc_constraint/3.

Todo:

  • Update changesets
  • Add migrations

tuesmiddt avatar Jul 02 '18 14:07 tuesmiddt

For the assessments context, this will be complete when #144 is merged. Not done yet for accounts/course contexts.

tuesmiddt avatar Jul 19 '18 13:07 tuesmiddt

I asked Julius, and this is what he says:

Essentially we didn't really use course and accounts contexts so we haven't put them in

Someone just needs to check that the foreign key constraint has been added

martin-henz avatar Feb 23 '19 01:02 martin-henz