Class: CreateNiftyAttachmentsTable

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/nifty/attachments/migration.rb

Instance Method Summary collapse

Instance Method Details

#downObject



12
13
14
# File 'lib/nifty/attachments/migration.rb', line 12

def down
  drop_table :nifty_attachments
end

#upObject



3
4
5
6
7
8
9
10
# File 'lib/nifty/attachments/migration.rb', line 3

def up
  create_table :nifty_attachments do |t|
    t.integer :parent_id
    t.string  :parent_type, :token, :digest, :role, :file_name, :file_type
    t.binary :data, :limit => 10.megabytes
    t.timestamps
  end
end