Class: CreateTaskDependencies

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

Class Method Summary collapse

Class Method Details

.downObject



13
14
15
# File 'lib/generators/queue_dispatcher/migration/templates/task_dependencies.rb', line 13

def self.down
  drop_table "<%= options[:task_dependencies_table_name] %>"
end

.upObject



2
3
4
5
6
7
8
9
10
11
# File 'lib/generators/queue_dispatcher/migration/templates/task_dependencies.rb', line 2

def self.up
  create_table "<%= options[:task_dependencies_table_name] %>" do |t|
    t.integer :task_id
    t.integer :dependent_task_id

    t.timestamps
  end
  add_index "<%= options[:task_dependencies_table_name] %>", :task_id
  add_index "<%= options[:task_dependencies_table_name] %>", :dependent_task_id
end