BscThesis / aboard.iee.ihu.gr

7 stars 0 forks source link

attachment foreign key #1

Closed asidirop closed 3 years ago

asidirop commented 3 years ago

The announcement_id in attachments table should be converted to BIGINT (20) UNSIGNED, so a foreign key could be added.

ALTER TABLE aboard.attachments CHANGE announcement_id announcement_id BIGINT (20) UNSIGNED NOT NULL, ADD FOREIGN KEY (announcement_id) REFERENCES aboard.announcements (id) ON UPDATE CASCADE ON DELETE CASCADE;

nickcn commented 3 years ago

Did you run this already against our DB and we just need the migration or shall I add the migration and then run it?

nickcn commented 3 years ago

Please check the contents of the file under: database/migrations/2020_08_26_005104_add_foreign_key_to_announcements_table.php. Is this what we are looking for?