Closed xandroc closed 3 months ago
I'm still unsure if this works for a from-scratch setup (as it's done in the CAPI CI pipeline for three environments). I think at this time - i.e. the very first time this runs on a vm on a new foundation - the database is completely empty (no tables etc.). So loading the models should actually fail...
I'm still unsure if this works for a from-scratch setup (as it's done in the CAPI CI pipeline for three environments). I think at this time - i.e. the very first time this runs on a vm on a new foundation - the database is completely empty (no tables etc.). So loading the models should actually fail...
Thanks @philippthun, perhaps we can detect if any migrations have run at all do you have any recommendations on how we might do that?
@xandroc Hm, maybe connect to the database and check if the migrations table exists:
db = VCAP::CloudController::DB.connect(RakeConfig.config.get(:db), logger)
return unless db.table_exists?(:schema_migrations)
...
Thanks @philippthun we added a variation, schema_migrations
table does exist prior to migrations running so we checked for stacks
table
next unless db.table_exists?(:stacks)
This reverts commit f445c39c88fd3b0f5efed7d873bd2c0198a0a299.
We can now run the stack checker before migrations as per https://github.com/cloudfoundry/cloud_controller_ng/pull/3925.
This is an improvement as we want to fail the stack checker before any migrations have run so that we are not in a state where migrations have run but the deployment has failed
[x] I have viewed signed and have submitted the Contributor License Agreement
[x] I have made this pull request to the
develop
branch[ ] I have run CF Acceptance Tests on bosh lite