Sha256: 79b1ed0d8b35ef9647694c74ad9ea115b58e0c8aa8f0f703444781886b3469ad
Contents?: true
Size: 916 Bytes
Versions: 44
Compression:
Stored size: 916 Bytes
Contents
require "pact_broker/db/data_migrations/helpers" module PactBroker module DB module DataMigrations class SetCreatedAtForLatestVerifications def self.call connection connection[:latest_verification_id_for_pact_version_and_provider_version] query = "UPDATE latest_verification_id_for_pact_version_and_provider_version SET created_at = (SELECT created_at FROM verifications WHERE id = latest_verification_id_for_pact_version_and_provider_version.verification_id) WHERE created_at is null" connection.run(query) end def self.columns_exist?(connection) column_exists?(connection, :latest_verification_id_for_pact_version_and_provider_version, :created_at) && column_exists?(connection, :verifications, :created_at) end end end end end
Version data entries
44 entries across 44 versions & 1 rubygems