-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make run_sqitch work services beyond erchef
Partybus.run_sqitch was previously hard-coded to apply database migrations only to opscode_chef, from the opscode_chef schema path. It also re-applied the legacy 1.0.4 schema with every new schema change. This change updates the function so that it only applies the migration it's told to apply. It also expands it to permit other services to invoke run_sqitch for updating their own databases. The partybus migrations were retrofitted to use the new form. In addition migration 014 was updated to explicitly apply the legacy 1.0.4 schema. This was added as a precaution -- there should be no path that has migration 14 (or later) running, that does not already have the baseline sqitch deployments applied: * new installations will already have the baseline properly applied. * EC 11.current will already have the baseline properly applied, as sqitch was introduced sometime early in the 11.x timeframe. * Upgrading from 11.old (pre-sqitch) requires an upgrade to 11.x current before proceeding.
- Loading branch information
Marc Paradise
committed
Feb 1, 2016
1 parent
56fac91
commit afa6781
Showing
10 changed files
with
86 additions
and
33 deletions.
There are no files selected for viewing
14 changes: 11 additions & 3 deletions
14
omnibus/files/private-chef-upgrades/001/014_upgrade_migration_schema.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
define_upgrade do | ||
|
||
if Partybus.config.bootstrap_server | ||
|
||
must_be_data_master | ||
|
||
# run 2.2.4 migration which includes schema upgrade for migration state | ||
run_sqitch("@2.2.4", "@1.0.4") | ||
# This ensures that sqitch is properly set up, even when upgrading from private chef (which did | ||
# not use sqitch), as well as ensuring the baseline schema is present for opscode_chef. | ||
# | ||
# Note that we only have to apply it in this upgrade, because this is the first sqitch migration | ||
# that will be run. If this doesn't need to be run, that tells us they're upgrading from an installation | ||
# that already has applied it. | ||
run_sqitch('@1.0.4', 'oc_erchef', path: 'oc_erchef/schema/baseline') | ||
|
||
# The actual schema change for this release - | ||
# track more state values in migration_state. | ||
run_sqitch('@2.2.4', 'oc_erchef') | ||
end | ||
end |
5 changes: 2 additions & 3 deletions
5
omnibus/files/private-chef-upgrades/001/016_add_org_tables_osc_hash_types.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
define_upgrade do | ||
|
||
if Partybus.config.bootstrap_server | ||
|
||
must_be_data_master | ||
|
||
# run 2.4.0 migrations to update db - includes adding org association/user tables | ||
# schema updates include adding org association/user tables | ||
# and adding the OSC password hash types to the password_hash_type_enum | ||
run_sqitch("@2.4.0", "@1.0.4") | ||
run_sqitch('@2.4.0', 'oc_erchef') | ||
end | ||
end |
10 changes: 6 additions & 4 deletions
10
omnibus/files/private-chef-upgrades/001/020_multi_key_schema_migration.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
omnibus/files/private-chef-upgrades/001/021_key_schema_migration_2.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
define_upgrade do | ||
if Partybus.config.bootstrap_server | ||
must_be_data_master | ||
run_sqitch("@2.9.0", "@1.0.4") | ||
# 1. cookbook artifacts | ||
# 2. adds last update tracking to keys table. | ||
run_sqitch('@2.9.0', 'oc_erchef') | ||
end | ||
end |
3 changes: 2 additions & 1 deletion
3
omnibus/files/private-chef-upgrades/001/022_cbv_type_addition.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
define_upgrade do | ||
if Partybus.config.bootstrap_server | ||
must_be_data_master | ||
run_sqitch("@cbv-type", "@1.0.4") | ||
# Performance improvements for cookbook fetching. | ||
run_sqitch('@cbv-type', 'oc_erchef') | ||
end | ||
end |
3 changes: 2 additions & 1 deletion
3
omnibus/files/private-chef-upgrades/001/027_node_policyfile_fields.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
define_upgrade do | ||
if Partybus.config.bootstrap_server | ||
must_be_data_master | ||
run_sqitch("@node-policyfile-fields", "@1.0.4") | ||
# Add policyfile fields to node table | ||
run_sqitch('@node-policyfile-fields', 'oc_erchef') | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters