What’s the most efficient way to insert data with a proper order? For example I have 2 tables:
create table Primary (dataset_id number, info varchar2(100) PRIMARY KEY dataset_id);
create table Foreign (dataset_id number, category varchar2(100) FOREIGN KEY dataset_id REFERENCES Primary(dataset_id))
Now I run
liquibase data to generate
data.xml for the insertion. However, when I deployed to the Oracle DB, I found the foreign key issue. Liquibase exported data.xml in the alphabetical order of tables so the data in Primary is executed after Foreign (since P is behind F).
Each time I have to manully copy and paste the data for Foreign below the Primary… Is there any efficient way to insert the data with the dependency order? In other words, alway insert Primary table at first.
I found some solutions from the Internet but all of them are out of date. Was it added as a new feature so that we can achieve via command directly? I don’t want to touch
data.xml once it’s auto-exported. Thanks!