Class: PaperclipI18nTables

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/paperclip_i18n/templates/migration.rb

Class Method Summary collapse

Class Method Details

.downObject



18
19
20
# File 'lib/generators/paperclip_i18n/templates/migration.rb', line 18

def self.down
  drop_table(:assets)
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/generators/paperclip_i18n/templates/migration.rb', line 2

def self.up
  create_table('assets') do |t|
    t.string('attachable_type')
    t.integer('attachable_id')
    t.string('upload_file_name')
    t.string('upload_content_type')
    t.integer('upload_file_size')
    t.string('upload_language', :limit => 6, :default => 'en')
    t.datetime('created_at')
    t.datetime('updated_at')
    t.datetime('upload_updated_at')
  end

  add_index('assets', ['attachable_id', 'attachable_type'], :name => 'index_assets_on_attachable_id_and_type')
end