Class: UsefullAttachmentCreateLinks

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

Class Method Summary collapse

Class Method Details

.downObject



20
21
22
# File 'lib/generators/usefull_attachment/migration/templates/create_migration_template.rb', line 20

def self.down
  drop_table :usefull_attachment_links
end

.upObject



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

def self.up
  create_table :usefull_attachment_links do |t|
    
    t.string      :description
    t.string      :typology
    
    t.has_attached_file :link
    
    t.integer    :created_by
    t.integer    :updated_by
    t.timestamps
    t.string      :type
    t.integer    :attachmentable_id
    t.string      :attachmentable_type, :limit => 100, :null => false
    
  end
end