blob: 897700a1e1b4c762cf9be47febf963ea1025ac6e (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 | class CreateComplianceCheckTasks < ActiveRecord::Migration
  def up
    unless table_exists? :compliance_check_tasks
      create_table :compliance_check_tasks do |t|
        t.belongs_to :referential, :null => :no ,:limit => 8
        t.belongs_to :import_task ,:limit => 8 # optional
        t.string :status      # global status of conformity checking
        t.string :parameter_set_name       # name of parameter set used for testing
        t.text :parameter_set   # all parameters needed to execute the import operation
        t.integer :user_id  ,:limit => 8    # id to the user who has requested this task (may be nil)
        t.string :user_name     # name of the user who has requested this task
        t.text :progress_info # percentage of progress and step code
        t.timestamps
      end
      add_foreign_key :compliance_check_tasks, :referentials, :on_delete => :cascade
      add_foreign_key :compliance_check_tasks, :import_tasks, :on_delete => :cascade
    end
  end
  def down
    if table_exists? :compliance_check_tasks
      execute "drop table compliance_check_tasks"
      # drop_table :compliance_check_tasks
    end
  end
end
 |