Sha256: 41ccd99ba637c6a321b0716e2306a554d2a15f9c3964021ef9fd0ea85b2c454a

Contents?: true

Size: 400 Bytes

Versions: 60

Compression:

Stored size: 400 Bytes

Contents

# frozen_string_literal: true

class PublishExistingProposalsState < ActiveRecord::Migration[5.2]
  def up
    execute <<-SQL.squish
      UPDATE decidim_proposals_proposals SET state_published_at = COALESCE(answered_at, published_at) WHERE state IS NOT NULL
    SQL
  end

  def down
    execute <<-SQL.squish
      UPDATE decidim_proposals_proposals SET state_published_at = NULL
    SQL
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
decidim-proposals-0.29.1 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.28.4 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.27.9 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.29.0 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.28.3 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.27.8 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.29.0.rc4 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.29.0.rc3 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.29.0.rc2 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.29.0.rc1 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.28.2 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.27.7 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.28.1 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.27.6 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.26.10 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.26.9 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.28.0 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.27.5 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.28.0.rc5 db/migrate/20200306123652_publish_existing_proposals_state.rb
decidim-proposals-0.28.0.rc4 db/migrate/20200306123652_publish_existing_proposals_state.rb