Sha256: b94b3b66142d6caa9200dbe13c65798bd4f6eaf82b76f0e2fe825b26d53f90cb

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

# This migration comes from erp_financial_accounting (originally 20101025003639)
class FinancialAccountingServices < ActiveRecord::Migration
  def self.up

    unless table_exists?(:gl_accounts)
      create_table :gl_accounts do |t|

        #these columns are required to support the behavior of the plugin 'better_nested_set'
        t.column  	:parent_id,    :integer
        t.column  	:lft,          :integer
        t.column  	:rgt,          :integer

        #custom columns go here   
        t.column  	:description, :string
        t.column  	:comments, :string
		    t.column 	:internal_identifier, 	:string
		    t.column 	:external_identifier, 	:string
		    t.column 	:external_id_source, 	:string

        t.timestamps
      
      end
    end

    unless table_exists?(:price_plan_comp_gl_accounts)
      create_table :price_plan_comp_gl_accounts do |t|

        t.references  :pricing_plan_component
        t.references  :gl_account
        t.string      :mapping_rule_klass

        t.timestamps
      end
    end

  end

  def self.down

    [
      :gl_accounts, :price_plan_comp_gl_accounts
    ].each do |tbl|
      if table_exists?(tbl)
        drop_table tbl
      end
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
erp_financial_accounting-3.1.0 spec/dummy/db/migrate/20121213234213_financial_accounting_services.erp_financial_accounting.rb