We have a rather large DB schema that is ocnstantly changing - every application release comprises the app itself, plus a migration script to apply to the live DB as required.
Nopw, in parallel we maintain a schema creation script which we can use at any point to build a DB from scratch (for testing purposes).
The thing that vexes me slightly is that this seems to be a violatyion of DRY - if I add a column to a table I have to create a script to do it and make a similar change to the schema build script.
Is there any strategy to avoid this? I thought of having maybe a 'reference DB' with no dynamic data in it that we could simply export after every build is installed. SO we create a migration script and then, once the build is live, export the schema back into the 'create' script.
Im not convinced that wouldnt be more work than the process it replaces though.....