DEV: Tweak promote_migrations script

We need to use core's 'earliest post deploy version' as the threshold for promoting plugin migrations, otherwise plugin migrations will be blocked by the `SafeMigrate.earliest_post_deploy_version` check
This commit is contained in:
David Taylor 2024-01-19 13:55:06 +00:00
parent cbe4b3d7d8
commit 8f575a7325
No known key found for this signature in database
GPG Key ID: 46904C18B1D3F434
1 changed files with 7 additions and 1 deletions

View File

@ -67,7 +67,13 @@ latest_stable_post_migration = stable_post_migrate_filenames.last
puts "The latest core post_migrate file in #{previous_stable_version} is #{latest_stable_post_migration}"
puts 'Promoting this, and all earlier post_migrates, to regular migrations'
promote_threshold = latest_stable_post_migration[VERSION_REGEX, 1].to_i
promote_threshold = if PLUGINS
# Gotta be more conservative here because of SafeMigrate.earliest_post_deploy_version
Dir.glob("#{PLUGINS_BASE}/**/db/post_migrate/*.rb").sort.first[VERSION_REGEX, 1].to_i
else
latest_stable_post_migration[VERSION_REGEX, 1].to_i
end
current_post_migrations =
if PLUGINS
puts 'Looking in plugins...'