Class: CreateImages

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/carrierwave_gallery/install/templates/create_images.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/generators/carrierwave_gallery/install/templates/create_images.rb', line 2

def change
  create_table :images do |t|
    t.string :title
    t.string :alt
    t.text :description
    t.string :file
    t.references :gallery, index: true

    t.timestamps null: false
  end
  add_foreign_key :images, :galleries
end