-
Notifications
You must be signed in to change notification settings - Fork 247
Onetimescripts
- RunAfterCreateDatabase - New in v0.8.5!
- Up
- Down
Scripts that are found in the up (or down when that is implemented) are one time scripts. That means they are only ever run once.
- DDL (schema changes - database structure)
- DML (inserts/updates/deletes)
RoundhousE always runs files in order alphabetically.
One should prepend your order specific scripts with either a number moving upwards padded with three zeros (i.e. 0001_somescript.sql
followed by 0002_nextscript.sql
) or a nice long date time in YYYYMMddHHmmss format (i.e. 20121026091400_somescript.sql
followed by 20121026091401_nextscript.sql
), but you are not limited to those options. Some people do a separation by numbers as in ####.##.##.####
or something else. Find what works for you (and your team) and use it.
If there is a change to a one time script and the migrator is run, RH will determine you have changed that file and will shut down immediately with errors. That being said, there is a configuration setting to allow you to still run with warnings. Although not recommended, RH tries not to be a tool that constrains users.
See ConfigurationOptions under Switches WarnOnOneTimeScriptChanges
See AnyTimeScripts