Skip to Content

Moving Foreign Keys

We have a large Physical Data Model (PDM) that we are splitting apart into smaller (subject-area-focused) PDMs. We can move tables from the larger model to the smaller models but cannot move FK relationships to the smaller models along with the tables. How can we move both the tables and relationships from model to model?

Additionally, once we have the larger model split apart, we need to maintain FK relationships that cross subject areas. We can create shortcuts in our smaller models that reference tables in other subject area models but need to ensure that FK relationships between the actual tables are maintained and want to understand the best way to do so.

Lastly, are we approaching this properly? Should we be splitting the model into multiple PDMs, using packages, some other structure? What is best practice?

Add comment
10|10000 characters needed characters exceeded

2 Answers

  • Posted on Jul 23 at 09:05 AM

    Have you tried these 3 steps?

    1. move the tables from your first model to your second model - the references those tables own will also move, and they will disappear from the first model
    2. use the right-mouse drag to copy all references from your second model into the first model as shortcuts - they will re-appear in the first model
    3. drag the shortcut references onto the diagram in your second model while holding down the <Shift> key (to prevent graphical synonyms being created) - alternatively, use show/hide symbols
    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23 at 09:11 AM

    Answering your last point "Should we be splitting the model into multiple PDMs, using packages, some other structure?"

    I'm not an expert on applying SQL to create or alter databases - from my quick experiment just now it looks like you could combine the SQL generated from the multiple PDMs, but you'd have to be very careful about it.

    Add comment
    10|10000 characters needed characters exceeded