Sha256: cc5b316190f49558116c7f4f4b372de768a31f6da0103b321d3a2652335f2211

Contents?: true

Size: 673 Bytes

Versions: 142

Compression:

Stored size: 673 Bytes

Contents

# frozen_string_literal: true

class MigrateMeetingsCategory < 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_meetings_meetings.id, \'Decidim::Meetings::Meeting\', NOW(), NOW()
        FROM decidim_meetings_meetings
        INNER JOIN decidim_categories ON decidim_categories.id = decidim_meetings_meetings.decidim_category_id
    ')
    # Remove unused column
    remove_column :decidim_meetings_meetings, :decidim_category_id
  end
end

Version data entries

142 entries across 142 versions & 2 rubygems

Version Path
decidim-meetings-0.26.8 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.27.4 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.27.3 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.7 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.5 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.27.2 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.27.1 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.4 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.27.0 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.3 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.27.0.rc2 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.27.0.rc1 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.2 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.1 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.0 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.0.rc2 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.26.0.rc1 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.25.2 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.25.1 db/migrate/20170612101925_migrate_meetings_category.rb
decidim-meetings-0.25.0 db/migrate/20170612101925_migrate_meetings_category.rb