What are the challenges you face when working across database platforms? Take the survey
Options

Force ordering when a migration script runs

I have just started using SQL Source Control.

I want to seed some base tables with some initial data that should be shipped with the database.
These tables are not look-up tables and are not candidates for linked tables.
They are entity tables such as User, Role and Organization. There is circular referencing between some of them.
The entity tables also depend on the lookup data being there.

I wrote a data migration script that:

1. Turns off all relevant table constraints
2. Seeds the data
3. Turns on the constraints

I checked the migration script in last.

However, it seems to run before linked data is inserted.

Is this the case?
Can I force my migration script to be the last thing run?

Best regards

Phil
Tagged:

Answers

Sign In or Register to comment.