Sha256: b4080d8147d49dc3906a4e2f76012577484179a9b27ae86542d9deb6bdfb8a3a
Contents?: true
Size: 879 Bytes
Versions: 60
Compression:
Stored size: 879 Bytes
Contents
# frozen_string_literal: true class SyncProposalsStateWithAmendmentsState < ActiveRecord::Migration[5.2] def up execute <<-SQL.squish UPDATE decidim_proposals_proposals AS proposals SET state = amendments.state FROM decidim_amendments AS amendments WHERE proposals.state IS NULL AND amendments.decidim_emendation_type = 'Decidim::Proposals::Proposal' AND amendments.decidim_emendation_id = proposals.id AND amendments.state IS NOT NULL SQL end def down execute <<-SQL.squish UPDATE decidim_proposals_proposals AS proposals SET state = NULL FROM decidim_amendments AS amendments WHERE amendments.decidim_emendation_type = 'Decidim::Proposals::Proposal' AND amendments.decidim_emendation_id = proposals.id AND amendments.state IS NOT NULL SQL end end
Version data entries
60 entries across 60 versions & 1 rubygems