Sha256: 34b4052e3c5a7a4484559c92512ce747ec7c07723587f38f0a98710693b8db21

Contents?: true

Size: 785 Bytes

Versions: 9

Compression:

Stored size: 785 Bytes

Contents

class AddForeignKeys < ActiveRecord::Migration[4.2]
  def change
    add_foreign_key :alchemy_cells, :alchemy_pages,
      column: :page_id,
      on_update: :cascade,
      on_delete: :cascade,
      name: :alchemy_cells_page_id_fkey

    add_foreign_key :alchemy_contents, :alchemy_elements,
      column: :element_id,
      on_update: :cascade,
      on_delete: :cascade,
      name: :alchemy_contents_element_id_fkey

    add_foreign_key :alchemy_elements, :alchemy_pages,
      column: :page_id,
      on_update: :cascade,
      on_delete: :cascade,
      name: :alchemy_elements_page_id_fkey

    add_foreign_key :alchemy_elements, :alchemy_cells,
      column: :cell_id,
      on_update: :cascade,
      on_delete: :cascade,
      name: :alchemy_elements_cell_id_fkey
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.5 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.4 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.3 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.2 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.1 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.0 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.0.rc2 db/migrate/20160928080104_add_foreign_keys.rb
alchemy_cms-4.0.0.rc1 db/migrate/20160928080104_add_foreign_keys.rb