Class: CreateTaskQueues

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

Class Method Summary collapse

Class Method Details

.downObject



16
17
18
# File 'lib/generators/queue_dispatcher/migration/templates/task_queues.rb', line 16

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

.upObject



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

def self.up
  create_table "<%= options[:task_queues_table_name] %>" do |t|
    t.string :name
    t.string :state
    t.integer :pid
    t.boolean :terminate_immediately
    t.string :interrupts

    t.timestamps
  end

  add_index "<%= options[:task_queues_table_name] %>", :name
end