locked
Data Generation for Foreign Keys RRS feed

  • Question

  • I have seen several similar posts, but no solutions, so I will ask again just in case I missed something.
     
    Imagine a very simple Order and OrderDetail example, where the OrderId column in the OrderDetail table is a foreign key tied to the Order table.  The biggest problem with the FK generator is that the OrderId column is randomly populated with values from the Order table.  In order to simulate "real life" data, there should be several Detail records for OrderId = 1, then several for OrderId = 2, etc.
     
    Is there any way to control the data generation for a foreign key column (other than removing the FK constraints)?  An actual database would have many FK columns involving many tables, and randomly generated values for the FK results in generated data that does not resemble actual data, since the FK values should have actual causal relationships between tables, not random.
     
    If it is not possible to do this, could it be a feature in a future release to allow changing the generator type even for a FK column?  If the selected generator produced data that violated the FK constraint, the generation could fail and report the error.
     
    Two other items were mentioned in other posts.  Will there be the ability in a future release to not delete "lookup" data in tables with FK relationships?  The other issue is that the one thing that should be allowable to be random is the ratio.  In the Order and Detail example, it would be nice to be able to vary the number of Details per Order.
    Thursday, February 14, 2008 9:24 PM

Answers

  • Randy,

     

    The scenario you wish to enable is very valid and there are a number of customers who have expressed the desire for the type of increased functionality that you envision.  In the released versions of our product there is not a way to customize FK column population in the way that you want other than to temporarily remove the constraint and leverage the Data Bound Generator or a custom generator.

     

    Looking ahead, rest assured that we are very actively working on enabling the scenarios that you describe.  This isn't marketing hot air, we have specific solutions from Dev Smile

     

    As to the 'other items' you mention, we are working on solutions for those specific concerns, as well.

     

    Wish I could give you specific timing for when you might have these improvements in your hands, but if I did I'd silently disappear and you'd never hear from me again Wink

     

     

    Friday, February 15, 2008 10:59 PM
    Moderator

All replies

  • Randy,

     

    The scenario you wish to enable is very valid and there are a number of customers who have expressed the desire for the type of increased functionality that you envision.  In the released versions of our product there is not a way to customize FK column population in the way that you want other than to temporarily remove the constraint and leverage the Data Bound Generator or a custom generator.

     

    Looking ahead, rest assured that we are very actively working on enabling the scenarios that you describe.  This isn't marketing hot air, we have specific solutions from Dev Smile

     

    As to the 'other items' you mention, we are working on solutions for those specific concerns, as well.

     

    Wish I could give you specific timing for when you might have these improvements in your hands, but if I did I'd silently disappear and you'd never hear from me again Wink

     

     

    Friday, February 15, 2008 10:59 PM
    Moderator
  • Well, that is encouraging news.  Some of the original posts on this issue were quite old, and it wasn't clear that a solution was either possible or on the way.
     
    Regarding the timing, that is semi-encouraging.  Would not want you to disappear, since that would mean a further delay 
     
    In the meantime, I'm playing with the Valentine's Day present.
     
    Friday, February 15, 2008 11:14 PM