A new topic, 'Creating insert data without hardcoded IDs', has been made on a 
board you are watching.

You can see it at
http://liquibase.org/forum/index.php?topic=103.new#new

The text of the topic is shown below:

Hey all,

I would like to allow Liquibase to fully manage not only database migrations, 
but also the data within it. 

I have a question pertaining to the usage of keys and foreign keys when using 
<insert> Say I have a table 'b' that references another table 'a'.  In insert 
syntax, i have to do something like this in changeSet id='1':
Code:
<insert table="a">
<column name="id" valueNumber="1" />
</insert>

<insert table="b">
<column name="a_id" valueNumber="1" /> <!-- fk to a-->
</insert>

That's fine for initial production data.  But say that tables a and b will, 
once run in production, have more data that 'pollutes' available IDs.  

So say in changeSet 2, I want to add another entry into table a, and would like 
to also add another entry into b that references that table a.  How would I 
know what id to use, safely?

I'm trying to avoid using sql directly.

Thanks!
Seth

Unsubscribe to new topics from this board by clicking here: 
http://liquibase.org/forum/index.php?action=notifyboard;board=1.0

Regards,
The LiquiBase Community Forum Team.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to