Sha256: 064b748e71eaa99a1ea0bf953ef61242a4dc467f366008754ac6209e6f24d2b5

Contents?: true

Size: 362 Bytes

Versions: 15

Compression:

Stored size: 362 Bytes

Contents

class RubyGalleryCreateAlbumPhotos < ActiveRecord::Migration

  
  def self.up
    create_table :album_photos do |b|
      b.belongs_to :photoable, polymorphic: true
      b.integer :position, default: 0
      b.timestamps
    end
    
    add_index :album_photos, [:photoable_id, :photoable_type]
  end
  
  def self.down
    drop_table :album_photos
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ruby_gallery-0.3.0.3 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.3.0.2 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.3.0.1 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.3.0 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.2.9 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.2.7 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.2.6 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.2.5 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.2.4 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.2.2 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.2.1 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.1.9 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.1.8 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.1.7 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.1.6 lib/generators/active_record/templates/album_photo_migration.rb