Sha256: bb867fb9203978eade615a66b0b8ddcbe3f0346e05f9008960165eda5c805d9b

Contents?: true

Size: 711 Bytes

Versions: 104

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

class MigrateAccountabilityResultsCategory < ActiveRecord::Migration[5.1]
  def change
    # Create categorizations ensuring database integrity
    execute('
      INSERT INTO decidim_categorizations(decidim_category_id, categorizable_id, categorizable_type, created_at, updated_at)
        SELECT decidim_category_id, decidim_accountability_results.id, \'Decidim::Accountability::Result\', NOW(), NOW()
        FROM decidim_accountability_results
        INNER JOIN decidim_categories ON decidim_categories.id = decidim_accountability_results.decidim_category_id
    ')
    # Remove unused column
    remove_column :decidim_accountability_results, :decidim_category_id
  end
end

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
decidim-accountability-0.25.0.rc4 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.25.0.rc3 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.25.0.rc2 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.25.0.rc1 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.24.3 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.6 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.24.2 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.5 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.24.1 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.24.0 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.24.0.rc2 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.4 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.24.0.rc1 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.3 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.2 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.1 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.1.rc1 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.23.0 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.22.0 db/migrate/20170623094200_migrate_accountability_results_category.rb
decidim-accountability-0.21.0 db/migrate/20170623094200_migrate_accountability_results_category.rb