Class: CreateBatchyBatches
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateBatchyBatches
- Defined in:
- lib/generators/batchy/templates/migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
22 23 24 |
# File 'lib/generators/batchy/templates/migration.rb', line 22 def self.down drop_table :batchy_batches end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/batchy/templates/migration.rb', line 2 def self.up create_table :batchy_batches, :force => true do |table| table.datetime :started_at # When the batch started table.datetime :finished_at # When the batch finished table.datetime :expire_at # When this batch should expire table.string :state # Current state of the batch table.text :error # Reason for failure (if there is one) table.string :hostname # Host the batch is running on table.integer :pid # Process ID of the current batch table.string :name # Name of the batch job table.string :guid # Field to be used for unique identification of the calling job table.integer :parent_id # Self-referential ID for identifying parent batches table.text :backtrace # Backtrace for an error, if there is one table. end add_index :batchy_batches, :guid add_index :batchy_batches, :state end |