Sha256: 98e57acdddc43130ad1557e4cb926f1c26d4cbc321978eae167d3d6963590168

Contents?: true

Size: 482 Bytes

Versions: 1

Compression:

Stored size: 482 Bytes

Contents

class CreateGalleries < ActiveRecord::Migration
  def change
    create_table :assetable_galleries do |t|
      t.references :galleryable, :polymorphic => true
      t.string :name
      t.timestamps
    end

    add_index :assetable_galleries, [:galleryable_type, :galleryable_id], name: "poly_asset"
    add_index :assetable_galleries, [:galleryable_type, :galleryable_id, :name], unique: true, name: "named_gallery"

    add_index :assetable_galleries, :galleryable_id
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assetable-0.3.0 db/migrate/20131125200943_create_galleries.rb