cirandas.net

ref: master

db/migrate/017_create_images.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class CreateImages < ActiveRecord::Migration
  def self.up
    create_table :images do |t|
      t.column :owner_type,    :string
      t.column :owner_id,      :integer
      
      t.column :parent_id,     :integer
      t.column :content_type,  :string
      t.column :filename,      :string    
      t.column :thumbnail,     :string 
      t.column :size,          :integer
      t.column :width,         :integer
      t.column :height,        :integer
    end
  end

  def self.down
    drop_table :images
  end
end