Sha256: fcae16f95f5319d1e26c8da0fea27d194fbbe460c059d59e20c8248c1cb18568

Contents?: true

Size: 913 Bytes

Versions: 3

Compression:

Stored size: 913 Bytes

Contents

class CreateFamilyGalleryPictures < ActiveRecord::Migration
  def up
    create_table :family_gallery_pictures do |t|
      t.integer :user_owner_id
      t.integer :user_uploaded_id
      t.datetime :taken_at
      t.integer :width
      t.integer :height
      t.decimal :latitude, precision: 12, scale: 3
      t.decimal :longitude, precision: 12, scale: 3
      t.timestamps
    end

    add_index :family_gallery_pictures, :user_owner_id
    add_index :family_gallery_pictures, :user_uploaded_id
    add_index :family_gallery_pictures, :taken_at
    add_index :family_gallery_pictures, :latitude
    add_index :family_gallery_pictures, :longitude

    add_attachment :family_gallery_pictures, :image

    FamilyGallery::Picture.create_translation_table! title: :string, description: :text
  end

  def down
    drop_table :family_gallery_pictures
    FamilyGallery::Picture.drop_translation_table!
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
family_gallery-0.0.3 db/plugin_migrate/20150224155704_create_family_gallery_pictures.rb
family_gallery-0.0.2 db/plugin_migrate/20150224155704_create_family_gallery_pictures.rb
family_gallery-0.0.1 db/plugin_migrate/20150224155704_create_family_gallery_pictures.rb