Sha256: b43ee394f316eb84b9847da7486a52eb5230bf2751267f484b3e21df1b9286e8

Contents?: true

Size: 1.83 KB

Versions: 8

Compression:

Stored size: 1.83 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_name

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

    add_index :re_rules, [:re_pipeline_id]
    add_index :re_rules, [:re_pipeline_id, :position]

    #################################
    create_table :re_rule_expected_outcomes do |t|
      t.integer :re_rule_id
      
      t.integer :outcome
      t.string  :pipeline_code      
      
      t.datetime :created_at
      t.datetime :updated_at
    end    
    add_index :re_rule_expected_outcomes, [:re_rule_id]
    
    #################################
    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.string   :audit_message            
    end    

    add_index :re_job_audits, [:re_job_id]
    add_index :re_job_audits, [:re_pipeline_id]
    add_index :re_job_audits, [:audit_date]
  end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rules_engine-0.1.1 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb
rules_engine-0.1.0 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb
rules_engine-0.0.8 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb
rules_engine-0.0.7 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb
rules_engine-0.0.6 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb
rules_engine-0.0.5 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb
rules_engine-0.0.4 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb
rules_engine-0.0.3 rails_generators/templates/db/migrate/20100308225008_create_re_pipelines.rb