Fix issue with migrations in Rails 8 (#165)

This commit is contained in:
Justin Edmund 2025-01-16 00:34:13 -08:00 committed by GitHub
parent bde8dffaa2
commit 6a60b605b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,8 +28,8 @@ module PostDeployment
log_step "TEST MODE: Would run pending migrations..."
# Check schema migrations
pending_schema_migrations = ActiveRecord::Base.connection.migration_context.needs_migration?
schema_migrations = ActiveRecord::Base.connection.migration_context.migrations
pending_schema_migrations = ActiveRecord::Base.connection.pool.migration_context.needs_migration?
schema_migrations = ActiveRecord::Base.connection.pool.migration_context.migrations
# Check data migrations
data_migrations_path = DataMigrate.config.data_migrations_path
@ -60,9 +60,9 @@ module PostDeployment
ActiveRecord::Migration.verbose = @verbose
# Run schema migrations
schema_version = ActiveRecord::Base.connection.migration_context.current_version
schema_version = ActiveRecord::Base.connection.pool.migration_context.current_version
ActiveRecord::Tasks::DatabaseTasks.migrate
new_schema_version = ActiveRecord::Base.connection.migration_context.current_version
new_schema_version = ActiveRecord::Base.connection.pool.migration_context.current_version
# Run data migrations
data_migrations_path = DataMigrate.config.data_migrations_path