Sha256: 824ac25a1b6a2cc4023d9722b29fa7a192aeb44a618df617cec287e4992d9644

Contents?: true

Size: 541 Bytes

Versions: 7

Compression:

Stored size: 541 Bytes

Contents

class RenameAttachableToAttachedTo < ActiveRecord::Migration[5.0]
  def change
    remove_index :decidim_attachments, name: "index_decidim_attachments_on_attachable_id_and_attachable_type" 
    remove_foreign_key :decidim_attachments, column: :attachable_id

    rename_column :decidim_attachments, :attachable_id, :attached_to_id
    rename_column :decidim_attachments, :attachable_type, :attached_to_type

    add_index :decidim_attachments, [:attached_to_id, :attached_to_type], name: "index_decidim_attachments_on_attached_to"
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
decidim-core-0.2.0 db/migrate/20170125135937_rename_attachable_to_attached_to.rb
decidim-core-0.1.0 db/migrate/20170125135937_rename_attachable_to_attached_to.rb
decidim-core-0.0.8.1 db/migrate/20170125135937_rename_attachable_to_attached_to.rb
decidim-core-0.0.7 db/migrate/20170125135937_rename_attachable_to_attached_to.rb
decidim-core-0.0.6 db/migrate/20170125135937_rename_attachable_to_attached_to.rb
decidim-core-0.0.5 db/migrate/20170125135937_rename_attachable_to_attached_to.rb
decidim-core-0.0.3 db/migrate/20170125135937_rename_attachable_to_attached_to.rb