Class: Khronos::Storage::Adapter::ActiveRecord::CreateSchedule

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/khronos/storage/adapter/activerecord/migrations/schedule.rb

Class Method Summary collapse

Class Method Details

.downObject



21
22
23
# File 'lib/khronos/storage/adapter/activerecord/migrations/schedule.rb', line 21

def self.down
  drop_table :schedules
end

.upObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/khronos/storage/adapter/activerecord/migrations/schedule.rb', line 7

def self.up
  create_table :schedules do |t|
    t.string    :context,    :null => false, :limit => 100
    t.datetime  :at,         :null => false
    t.string    :task_url,   :null => false
    t.integer   :recurrency, :null => true,  :default => 0
    t.string    :callbacks,  :null => true,  :limit => 500
    t.boolean   :active,     :null => false, :default => true
  end

  add_index :schedules, :at
  add_index :schedules, :context
end