Everytime scripts executing before Update scripts on Rebuild
Closed this issue · 1 comments
I'm currently having an issue with the Everytime scripts folder when I do a rebuild of the database. The scripts that get executed in order are:
- Create
- Everytime
- Update
- Everytime
My problem is that the Everytime scripts rely on schemas and tables that have been created in the Update scripts, so when calling rebuild, when the Everytime scripts are called after the Create scripts, they fail and therefore the rebuild fails.
I've had a look at the code and I think this is an easy fix. In DatabaseActionResolver, a Create request returns Create and Update, and a Rebuild request returns Drop, Create and Update. Therefore in DatabaseCreator it is unnecessary to execute the Everytime scripts as they will be executed in DatabaseUpdater. It would just be a case of deleting lines 30 and 31.
If you want me to submit a PR for this change then I'm happy to.
This makes sense. Please submit a PR and I'll deploy a new version ASAP.