David Beroff (d4b) wrote,
David Beroff

Not-so-strange loops

The observant reader may have noticed that, in my prior post, there appears to be a dependency loop. While in that particular pictured case the tables can be defined in a specific sequence with no referential problem, (i.e., first Language, then Member, then Fluency, then Opinion), there are a few notable spots in my schema where the foreign keys are getting circular. I was trying to figure out how to make forward declarations in MySQL, when I realized that I can declare the foreign key constraints by using "ALTER TABLE tbl_name ADD CONSTRAINT FOREIGN KEY..." after both (all) tables have been initially defined. Forward declarations would've been nice in the earlier table definitions, but nothing wrong with simple comments at those points for the human readers. :-)
Tags: mtat, webdev
  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.