Sha256: 62f98123ea57b74b93ef059eff6b71eab2064f779ab4f6af94c66eff2ff5251e

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

Dir.glob(File.expand_path(File.join(__FILE__, "..", "data_migrations", "*.rb"))).sort.each do | path |
  require path
end

# Data migrations run *every* time the broker starts up, after the schema migrations.
# Their purpose is to ensure that data integrity is maintained during rolling migrations
# in architectures with multiple application instances running against the same
# database (eg. EC2 autoscaling group) where "old" data might be inserted by
# the application instance running the previous version of the code AFTER
# the schema migrations have been run on the first application instance with the
# new version of the code.

module PactBroker
  module DB
    class MigrateData
      def self.call database_connection, options = {}
        DataMigrations::SetPacticipantIdsForVerifications.call(database_connection)
        DataMigrations::SetConsumerIdsForPactPublications.call(database_connection)
        DataMigrations::SetLatestVersionSequenceValue.call(database_connection)
        DataMigrations::SetWebhooksEnabled.call(database_connection)
        DataMigrations::DeleteDeprecatedWebhookExecutions.call(database_connection)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pact_broker-2.51.0 lib/pact_broker/db/migrate_data.rb
pact_broker-2.50.1 lib/pact_broker/db/migrate_data.rb
pact_broker-2.50.0 lib/pact_broker/db/migrate_data.rb