Class: CreateImages

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/engine_room/templates/004_create_images.rb

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/generators/engine_room/templates/004_create_images.rb', line 16

def self.down
  drop_table :images
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/engine_room/templates/004_create_images.rb', line 2

def self.up
  create_table(:images) do |t|
    # todo: add foreign keys to belongs_to model

    t.string   :title
    t.text     :description
    t.string   :image_file_name     # paperclip property
    t.string   :image_content_type  # paperclip property
    t.integer  :image_file_size     # paperclip property
    t.datetime :image_updated_at    # paperclip property
    t.timestamps
  end
end