Class: CreateImports

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/import/install/templates/migrations/1_create_imports.rb

Class Method Summary collapse

Class Method Details

.downObject



24
25
26
# File 'lib/generators/import/install/templates/migrations/1_create_imports.rb', line 24

def self.down
  drop_table :imports
end

.upObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/import/install/templates/migrations/1_create_imports.rb', line 2

def self.up
  create_table :imports do |t| 
    t.string :type
    t.text :input
    t.text :parameters
    t.string :email
    t.integer :author_id
    t.string :parent_type
    t.integer :parent_id
    t.text :exception
    t.string :state
    t.timestamps
  end  

  change_table :imports do |t|
    t.index :type
    t.index :author_id
    t.index [:parent_type, :parent_id]
    t.index :state
  end
end