Sha256: f9b11a7be04afbf17aaeacbd2a4adcc7a2d8a3c0f22616ab66799e55f157a962

Contents?: true

Size: 980 Bytes

Versions: 7

Compression:

Stored size: 980 Bytes

Contents

class AddIndexes < ActiveRecord::Migration
  def self.up
    add_index Refinery::PhotoGallery::Album.table_name, :id, :unique => true
    add_index Refinery::PhotoGallery::Collection.table_name, :id, :unique => true
    add_index Refinery::PhotoGallery::Photo.table_name, :id, :unique => true


    add_index Refinery::PhotoGallery::CollectionAlbum.table_name, :collection_id
    add_index Refinery::PhotoGallery::CollectionAlbum.table_name, :album_id
    add_index Refinery::PhotoGallery::Photo.table_name, :album_id
  end

  def self.down
    remove_index Refinery::PhotoGallery::Album.table_name, :id
    remove_index Refinery::PhotoGallery::Collection.table_name, :id
    remove_index Refinery::PhotoGallery::Photo.table_name, :id


    remove_index Refinery::PhotoGallery::CollectionAlbum.table_name, :collection_id
    remove_index Refinery::PhotoGallery::CollectionAlbum.table_name, :album_id
    remove_index Refinery::PhotoGallery::Photo.table_name, :album_id

  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
refinerycms-photo-gallery-0.1.2 db/migrate/20120805222125_add_indexes.rb
refinerycms-photo-gallery-0.1.1 db/migrate/20120805222125_add_indexes.rb
refinerycms-photo-gallery-0.1.0 db/migrate/20120805222125_add_indexes.rb
refinerycms-6hoursdaily-photo-gallery-0.0.5.dev db/migrate/20120805222125_add_indexes.rb
refinerycms-6hoursdaily-photo-gallery-0.0.4.dev db/migrate/20120805222125_add_indexes.rb
refinerycms-photo-gallery-0.0.2.dev db/migrate/20120805222125_add_indexes.rb
refinerycms-photo-gallery-0.0.1.dev db/migrate/20120805222125_add_indexes.rb