Sha256: 124079181e1ed2bbd28d69d29440a87014b67900b258d8359cd88f72b960acb7

Contents?: true

Size: 353 Bytes

Versions: 2

Compression:

Stored size: 353 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

2 entries across 2 versions & 1 rubygems

Version Path
ruby_gallery-0.3.0.6 lib/generators/active_record/templates/album_photo_migration.rb
ruby_gallery-0.3.0.4 lib/generators/active_record/templates/album_photo_migration.rb