<commit_before># encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120501184422) do

  create_table "account_users", :force => true do |t|
    t.integer  "account_id",               :null => false
    t.integer  "user_id",                  :null => false
    t.string   "user_role",  :limit => 50, :null => false
    t.datetime "created_at",               :null => false
    t.integer  "created_by",               :null => false
    t.datetime "deleted_at"
    t.integer  "deleted_by"
  end

  add_index "account_users", ["account_id"], :name => "fk_accounts"

  create_table "accounts", :force => true do |t|
    t.string   "type",                   :limit => 50,  :null => false
    t.string   "account_number",         :limit => 50,  :null => false
    t.string   "description",            :limit => 50,  :null => false
    t.datetime "expires_at",                            :null => false
    t.string   "name_on_card",           :limit => 200
    t.integer  "expiration_month"
    t.integer  "expiration_year"
    t.datetime "created_at",                            :null => false
    t.integer  "created_by",                            :null => false
    t.datetime "updated_at"
    t.integer  "updated_by"
    t.datetime "suspended_at"
    t.text     "remittance_information"
    t.integer  "facility_id"
    t.integer  "affiliate_id"
    t.string   "affiliate_other"
  end

  add_index "accounts", ["affiliate_id"], :name => "index_accounts_on_affiliate_id"
  add_index "accounts", ["facility_id"], :name => "fk_account_facility_id"

  create_table "affiliates", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "budgeted_chart_strings", :force => true do |t|
    t.string   "fund",       :limit => 20, :null => false
    t.string   "dept",       :limit => 20, :null => false
    t.string   "project",    :limit => 20
    t.string   "activity",   :limit => 20
    t.string   "account",    :limit => 20
    t.datetime "starts_at",                :null => false
    t.datetime "expires_at",               :null => false
  end

  create_table "bundle_products", :force => true do |t|
    t.integer "bundle_product_id", :null => false
    t.integer "product_id",        :null => false
    t.integer "quantity",          :null => false
  end

  add_index "bundle_products", ["bundle_product_id"], :name => "fk_bundle_prod_prod"
  add_index "bundle_products", ["product_id"], :name => "fk_bundle_prod_bundle"

  create_table "external_service_passers", :force => true do |t|
    t.integer  "external_service_id"
    t.integer  "passer_id"
    t.string   "passer_type"
    t.boolean  "active",              :default => false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "external_service_receivers", :force => true do |t|
    t.integer  "external_service_id"
    t.integer  "receiver_id"
    t.string   "receiver_type"
    t.string   "response_data"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "external_services", :force => true do |t|
    t.string   "type"
    t.string   "location"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "facilities", :force => true do |t|
    t.string   "name",              :limit => 200,                   :null => false
    t.string   "abbreviation",      :limit => 50,                    :null => false
    t.string   "url_name",          :limit => 50,                    :null => false
    t.boolean  "is_active",                                          :null => false
    t.datetime "created_at",                                         :null => false
    t.datetime "updated_at",                                         :null => false
    t.text     "description"
    t.boolean  "accepts_cc",                       :default => true
    t.boolean  "accepts_po",                       :default => true
    t.text     "short_description",                                  :null => false
    t.text     "address"
    t.string   "phone_number"
    t.string   "fax_number"
    t.string   "email"
    t.string   "journal_mask",      :limit => 50,                    :null => false
  end

  add_index "facilities", ["abbreviation"], :name => "sys_c008532", :unique => true
  add_index "facilities", ["name"], :name => "sys_c008531", :unique => true
  add_index "facilities", ["url_name"], :name => "sys_c008533", :unique => true

  create_table "facility_accounts", :force => true do |t|
    t.integer  "facility_id",                   :null => false
    t.string   "account_number",  :limit => 50, :null => false
    t.boolean  "is_active",                     :null => false
    t.integer  "created_by",                    :null => false
    t.datetime "created_at",                    :null => false
    t.integer  "revenue_account",               :null => false
  end

  add_index "facility_accounts", ["facility_id"], :name => "fk_facilities"

  create_table "file_uploads", :force => true do |t|
    t.integer  "order_detail_id"
    t.integer  "product_id"
    t.string   "name",              :limit => 200, :null => false
    t.string   "file_type",         :limit => 50,  :null => false
    t.integer  "created_by",                       :null => false
    t.datetime "created_at",                       :null => false
    t.string   "file_file_name"
    t.string   "file_content_type"
    t.integer  "file_file_size"
    t.datetime "file_updated_at"
  end

  add_index "file_uploads", ["order_detail_id"], :name => "fk_files_od"
  add_index "file_uploads", ["product_id"], :name => "fk_files_product"

  create_table "instrument_statuses", :force => true do |t|
    t.integer  "instrument_id", :null => false
    t.boolean  "is_on",         :null => false
    t.datetime "created_at",    :null => false
  end

  add_index "instrument_statuses", ["instrument_id"], :name => "fk_int_stats_product"

  create_table "journal_rows", :force => true do |t|
    t.integer "journal_id",                                                   :null => false
    t.integer "order_detail_id"
    t.decimal "amount",                         :precision => 9, :scale => 2, :null => false
    t.string  "description",     :limit => 200
    t.string  "reference",       :limit => 50
    t.string  "fund",            :limit => 3,                                 :null => false
    t.string  "dept",            :limit => 7,                                 :null => false
    t.string  "project",         :limit => 8
    t.string  "activity",        :limit => 2
    t.string  "program",         :limit => 4
    t.string  "account",         :limit => 5,                                 :null => false
  end

  create_table "journals", :force => true do |t|
    t.integer  "facility_id",                      :null => false
    t.string   "reference",         :limit => 50
    t.string   "description",       :limit => 200
    t.boolean  "is_successful"
    t.integer  "created_by",                       :null => false<commit_msg>Task #47021 : Genericize journal_rows table<commit_after># encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20120502223446) do

  create_table "account_users", :force => true do |t|
    t.integer  "account_id",               :null => false
    t.integer  "user_id",                  :null => false
    t.string   "user_role",  :limit => 50, :null => false
    t.datetime "created_at",               :null => false
    t.integer  "created_by",               :null => false
    t.datetime "deleted_at"
    t.integer  "deleted_by"
  end

  add_index "account_users", ["account_id"], :name => "fk_accounts"

  create_table "accounts", :force => true do |t|
    t.string   "type",                   :limit => 50,  :null => false
    t.string   "account_number",         :limit => 50,  :null => false
    t.string   "description",            :limit => 50,  :null => false
    t.datetime "expires_at",                            :null => false
    t.string   "name_on_card",           :limit => 200
    t.integer  "expiration_month"
    t.integer  "expiration_year"
    t.datetime "created_at",                            :null => false
    t.integer  "created_by",                            :null => false
    t.datetime "updated_at"
    t.integer  "updated_by"
    t.datetime "suspended_at"
    t.text     "remittance_information"
    t.integer  "facility_id"
    t.integer  "affiliate_id"
    t.string   "affiliate_other"
  end

  add_index "accounts", ["affiliate_id"], :name => "index_accounts_on_affiliate_id"
  add_index "accounts", ["facility_id"], :name => "fk_account_facility_id"

  create_table "affiliates", :force => true do |t|
    t.string   "name"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "budgeted_chart_strings", :force => true do |t|
    t.string   "fund",       :limit => 20, :null => false
    t.string   "dept",       :limit => 20, :null => false
    t.string   "project",    :limit => 20
    t.string   "activity",   :limit => 20
    t.string   "account",    :limit => 20
    t.datetime "starts_at",                :null => false
    t.datetime "expires_at",               :null => false
  end

  create_table "bundle_products", :force => true do |t|
    t.integer "bundle_product_id", :null => false
    t.integer "product_id",        :null => false
    t.integer "quantity",          :null => false
  end

  add_index "bundle_products", ["bundle_product_id"], :name => "fk_bundle_prod_prod"
  add_index "bundle_products", ["product_id"], :name => "fk_bundle_prod_bundle"

  create_table "external_service_passers", :force => true do |t|
    t.integer  "external_service_id"
    t.integer  "passer_id"
    t.string   "passer_type"
    t.boolean  "active",              :default => false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "external_service_receivers", :force => true do |t|
    t.integer  "external_service_id"
    t.integer  "receiver_id"
    t.string   "receiver_type"
    t.string   "response_data"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "external_services", :force => true do |t|
    t.string   "type"
    t.string   "location"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "facilities", :force => true do |t|
    t.string   "name",              :limit => 200,                   :null => false
    t.string   "abbreviation",      :limit => 50,                    :null => false
    t.string   "url_name",          :limit => 50,                    :null => false
    t.boolean  "is_active",                                          :null => false
    t.datetime "created_at",                                         :null => false
    t.datetime "updated_at",                                         :null => false
    t.text     "description"
    t.boolean  "accepts_cc",                       :default => true
    t.boolean  "accepts_po",                       :default => true
    t.text     "short_description",                                  :null => false
    t.text     "address"
    t.string   "phone_number"
    t.string   "fax_number"
    t.string   "email"
    t.string   "journal_mask",      :limit => 50,                    :null => false
  end

  add_index "facilities", ["abbreviation"], :name => "sys_c008532", :unique => true
  add_index "facilities", ["name"], :name => "sys_c008531", :unique => true
  add_index "facilities", ["url_name"], :name => "sys_c008533", :unique => true

  create_table "facility_accounts", :force => true do |t|
    t.integer  "facility_id",                   :null => false
    t.string   "account_number",  :limit => 50, :null => false
    t.boolean  "is_active",                     :null => false
    t.integer  "created_by",                    :null => false
    t.datetime "created_at",                    :null => false
    t.integer  "revenue_account",               :null => false
  end

  add_index "facility_accounts", ["facility_id"], :name => "fk_facilities"

  create_table "file_uploads", :force => true do |t|
    t.integer  "order_detail_id"
    t.integer  "product_id"
    t.string   "name",              :limit => 200, :null => false
    t.string   "file_type",         :limit => 50,  :null => false
    t.integer  "created_by",                       :null => false
    t.datetime "created_at",                       :null => false
    t.string   "file_file_name"
    t.string   "file_content_type"
    t.integer  "file_file_size"
    t.datetime "file_updated_at"
  end

  add_index "file_uploads", ["order_detail_id"], :name => "fk_files_od"
  add_index "file_uploads", ["product_id"], :name => "fk_files_product"

  create_table "instrument_statuses", :force => true do |t|
    t.integer  "instrument_id", :null => false
    t.boolean  "is_on",         :null => false
    t.datetime "created_at",    :null => false
  end

  add_index "instrument_statuses", ["instrument_id"], :name => "fk_int_stats_product"

  create_table "journal_rows", :force => true do |t|
    t.integer "journal_id",                                                   :null => false
    t.integer "order_detail_id"
    t.decimal "amount",                         :precision => 9, :scale => 2, :null => false
    t.string  "description",     :limit => 200
    t.string  "reference",       :limit => 50
    t.string  "account",         :limit => 5,                                 :null => false
  end

  create_table "journals", :force => true do |t|
    t.integer  "facility_id",                      :null => false
    t.string   "reference",         :limit => 50
    t.string   "description",       :limit => 200
    t.boolean  "is_successful"
    t.integer  "created_by",                       :null => false
{'fraction_non_alphanumeric': 0.12146948449535848, 'fraction_numerical': 0.011587332938310619, 'mean_word_length': 2.112704918032787, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 212, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 22, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '595323', 'n_tokens_mistral': 4820, 'n_tokens_neox': 4575, 'n_words': 1249}