Merge remote-tracking branch 'parent/main' into upstream-20241206

This commit is contained in:
KMY 2024-12-06 12:17:45 +09:00
commit 3c3ee557d0
187 changed files with 1105 additions and 537 deletions

View file

@ -43,8 +43,14 @@ namespace :db do
end
task pre_migration_check: :environment do
version = ActiveRecord::Base.connection.database_version
abort 'This version of Mastodon requires PostgreSQL 12.0 or newer. Please update PostgreSQL before updating Mastodon.' if version < 120_000
pg_version = ActiveRecord::Base.connection.database_version
abort 'This version of Mastodon requires PostgreSQL 12.0 or newer. Please update PostgreSQL before updating Mastodon.' if pg_version < 120_000
schema_version = ActiveRecord::Migrator.current_version
abort <<~MESSAGE if ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS'] && schema_version < 2023_09_07_150100
Zero-downtime migrations from Mastodon versions earlier than 4.2.0 are not supported.
Please update to Mastodon 4.2.x first or upgrade by stopping all services and running migrations without `SKIP_POST_DEPLOYMENT_MIGRATIONS`.
MESSAGE
end
Rake::Task['db:migrate'].enhance(['db:pre_migration_check'])