Sha256: d1e2426dffd1f65bd26e838cdf8adf93546c1022ee34aa8188ad159680576dee

Contents?: true

Size: 1.61 KB

Versions: 1

Compression:

Stored size: 1.61 KB

Contents

class CreateRePipelines < ActiveRecord::Migration
  def self.up
    create_table :re_pipelines do |t|
      t.string   :type
      t.integer  :parent_re_pipeline_id      
      
      t.string  :code
      t.string  :title
      t.text    :description
      
      t.datetime :created_at
      t.datetime :updated_at
    end
    
    add_index :re_pipelines, [:id, :type]
    add_index :re_pipelines, [:type]

    #################################
    create_table :re_rules do |t|
      t.integer :re_pipeline_id
      
      t.integer :position

      t.string  :rule_class

      t.string  :title
      t.string  :summary      
      t.integer :data_version
      t.text    :data      
      t.string  :error
      
      t.datetime :created_at
      t.datetime :updated_at
    end

    #################################
    create_table :re_rule_outcomes do |t|
      t.integer :re_rule_id
      
      t.integer :outcome
      t.string  :pipeline_code      
      
      t.datetime :created_at
      t.datetime :updated_at
    end    
    
    #################################
    create_table :re_jobs do |t|
      t.integer  :job_status
      t.datetime :created_at
    end    

    create_table :re_job_audits do |t|
      t.integer  :re_job_id
      t.integer  :re_pipeline_id
      t.integer  :re_rule_id
            
      t.datetime :audit_date
      t.integer  :audit_code
      t.boolean  :audit_success
      t.text     :audit_data      
      
    end    
    
  end

  def self.down
    drop_table :re_job_audits
    drop_table :re_jobs
    drop_table :re_rule_outcomes
    drop_table :re_rules
    drop_table :re_pipelines
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rules_engine-0.0.1 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb