Sha256: 4c992f3a680acbfe906adc0ba4fc4280bd5e92e318aec0730673ddc3aeff9eb9
Contents?: true
Size: 950 Bytes
Versions: 48
Compression:
Stored size: 950 Bytes
Contents
require "pact_broker/db/data_migrations/helpers" module PactBroker module DB module DataMigrations class SetCreatedAtForLatestPactPublications def self.call connection # pact ordering goes by creation date of the consumer version connection[:latest_pact_publication_ids_for_consumer_versions] query = "UPDATE latest_pact_publication_ids_for_consumer_versions SET created_at = (SELECT created_at FROM versions WHERE id = latest_pact_publication_ids_for_consumer_versions.consumer_version_id) WHERE created_at IS NULL" connection.run(query) end def self.columns_exist?(connection) column_exists?(connection, :latest_pact_publication_ids_for_consumer_versions, :created_at) && column_exists?(connection, :pact_publications, :created_at) end end end end end
Version data entries
48 entries across 48 versions & 1 rubygems