1 Reply Latest reply on Mar 25, 2010 4:13 PM by philmodjunk

    Record ID pk / fk fields -- can I create them after the fact?



      Record ID pk / fk fields -- can I create them after the fact?


      I'm working on a database that's been in use for a couple of years (I did not create it) and has over 10k records.  Many of the tables link to multiple fields in the central hub.  I think it would be better served if the central hub used an ID pk, and the other tables linked to this with an ID fk.


      Can I add these pk / fk fields after the fact?

      If so, what is the safest way to do so?

        • 1. Re: Record ID pk / fk fields -- can I create them after the fact?

          Simply adding new fields (whether they are used as keys in a relationship or not) shouldn't affect your existing data so it's pretty safe. There is a known issue with scripted imports that can trash your file after new fields have been added (the fields may no longer align correctly) so check that out if you have scripted imports.


          The real challenge and risk here is when you start modifying existing relationships so that you can use your new fields in relationships. This can affect the behaviour of value lists, validation rules, scripts, calculations and possibly any access privlege based record locking that might have been set up. Basically any part of your system where the modified relationship is used to refer to data in another table could now behave differently or fail all together.


          1) Make frequent back up copies of your file

          2) Get a copy of filemaker advanced if at all possible so you can used Database Design Reports to check for issues (Simply searching a report for the word "missing" can find a lot of potential problems in your file.)

          3) do a lot of testing at each step of your changes