# This file is autogenerated. Instead of editing this file, please use the
# migrations feature of ActiveRecord to incrementally modify your database, and
# then regenerate this schema definition.

ActiveRecord::Schema.define() do

  create_table "freqsummarybysspops", :force => true do |t|
    t.column "subsnp_id",           :integer,               :null => false
    t.column "population_id",       :integer,               :null => false
    t.column "source",              :string,   :limit => 1, :null => false
    t.column "chr_cnt",             :integer,               :null => false
    t.column "ind_cnt",             :integer,               :null => false
    t.column "non_founder_ind_cnt", :integer,               :null => false
    t.column "chisq",               :float
    t.column "df",                  :integer
    t.column "hwp",                 :float
    t.column "het",                 :float
    t.column "het_se",              :float
    t.column "last_updated_time",   :datetime,              :null => false
  end

  add_index "freqsummarybysspops", ["population_id"], :name => "freqsummarybysspop_pop_idx"
  add_index "freqsummarybysspops", ["subsnp_id"], :name => "freqsummarybysspop_subsnp_idx"

  create_table "populations", :force => true do |t|
    t.column "handle",            :string,   :limit => 20, :null => false
    t.column "loc_pop_id",        :string,   :limit => 64, :null => false
    t.column "loc_pop_id_upp",    :string,   :limit => 64, :null => false
    t.column "create_time",       :datetime
    t.column "last_updated_time", :datetime
    t.column "src_id",            :integer
  end

  create_table "snpcontiglocusids", :force => true do |t|
    t.column "snp_id",        :integer,               :null => false
    t.column "contig_acc",    :string,  :limit => 15, :null => false
    t.column "contig_ver",    :integer,               :null => false
    t.column "asn_from",      :integer
    t.column "asn_to",        :integer
    t.column "locus_id",      :integer,               :null => false
    t.column "locus_symbol",  :string,  :limit => 50
    t.column "mrna_acc",      :string,  :limit => 15
    t.column "mrna_ver",      :integer
    t.column "protein_acc",   :string,  :limit => 15
    t.column "protein_ver",   :integer
    t.column "fxn_class",     :integer,               :null => false
    t.column "reading_frame", :integer
    t.column "allele",        :string,  :limit => 25
    t.column "residue",       :string,  :limit => 5
    t.column "aa_position",   :integer
    t.column "build_id",      :string,  :limit => 10, :null => false
    t.column "ctg_id",        :integer,               :null => false
  end

  add_index "snpcontiglocusids", ["snp_id"], :name => "b126_snpcontiglocusid_36_1_snp_idx"

  create_table "snps", :force => true do |t|
    t.column "avg_heterozygosity", :float
    t.column "het_se",             :float
    t.column "create_time",        :datetime
    t.column "last_updated_time",  :datetime
    t.column "cpg_code",           :integer
    t.column "tax_id",             :integer,  :null => false
    t.column "validation_status",  :integer
    t.column "exemplar_subsnp_id", :integer,  :null => false
    t.column "univar_id",          :integer,  :null => false
    t.column "cnt_subsnp",         :integer,  :null => false
    t.column "map_property",       :integer
  end

  create_table "snpsubsnplinks", :id => false, :force => true do |t|
    t.column "subsnp_id",               :integer,  :null => false
    t.column "snp_id",                  :integer,  :null => false
    t.column "substrand_reversed_flag", :integer,  :null => false
    t.column "create_time",             :datetime
    t.column "last_updated_time",       :datetime
    t.column "build_id",                :integer
    t.column "comment",                 :string
  end

  add_index "snpsubsnplinks", ["snp_id"], :name => "snpsubsnplink_snp_idx"
  add_index "snpsubsnplinks", ["subsnp_id"], :name => "snpsubsnplink_subsnp_idx"

  create_table "subpopalleles", :force => true do |t|
    t.column "batch_id",          :integer,               :null => false
    t.column "subsnp_id",         :integer,               :null => false
    t.column "population_id",     :integer,               :null => false
    t.column "allele",            :string,   :limit => 1, :null => false
    t.column "other",             :string
    t.column "freq",              :float
    t.column "cnt_int",           :integer
    t.column "freq_min",          :float
    t.column "freq_max",          :float
    t.column "data_src",          :string,   :limit => 6
    t.column "kind",              :string,   :limit => 3
    t.column "last_updated_time", :datetime
    t.column "allele_flag",       :integer
    t.column "cnt",               :float
    t.column "allele_id",         :integer
    t.column "subpop_id",         :integer,               :null => false
  end

  add_index "subpopalleles", ["population_id"], :name => "subpopallele_pop_idx"
  add_index "subpopalleles", ["subpop_id"], :name => "subpopallele_subpop_idx"
  add_index "subpopalleles", ["subsnp_id"], :name => "subpopallele_subsnp_idx"

  create_table "subpops", :force => true do |t|
    t.column "batch_id",              :integer,               :null => false
    t.column "subsnp_id",             :integer,               :null => false
    t.column "population_id",         :integer,               :null => false
    t.column "kind",                  :string,   :limit => 3, :null => false
    t.column "samplesize",            :integer,               :null => false
    t.column "submitted_strand_code", :integer
    t.column "submitted_rs",          :integer
    t.column "allele_flag",           :integer
    t.column "ambiguity_status",      :integer
    t.column "sub_heterozygosity",    :float
    t.column "est_heterozygosity",    :float
    t.column "est_het_se_sq",         :float
    t.column "last_updated_time",     :datetime,              :null => false
    t.column "observed",              :string
    t.column "sub_het_se_sq",         :float
  end

  add_index "subpops", ["population_id"], :name => "subpop_pop_idx"
  add_index "subpops", ["subsnp_id"], :name => "subpop_subsnp_idx"

  create_table "subsnps", :force => true do |t|
    t.column "known_snp_handle",            :string,   :limit => 20
    t.column "known_snp_loc_id",            :string,   :limit => 64
    t.column "known_snp_loc_id_upp",        :string,   :limit => 64
    t.column "batch_id",                    :integer,                :null => false
    t.column "loc_snp_id",                  :string,   :limit => 64
    t.column "loc_snp_id_upp",              :string,   :limit => 64
    t.column "synonym_names",               :string
    t.column "loc_sts_id",                  :string,   :limit => 64
    t.column "loc_sts_id_upp",              :string,   :limit => 64
    t.column "segregate",                   :string,   :limit => 1,  :null => false
    t.column "indiv_homozygosity_detected", :string,   :limit => 1
    t.column "pcr_confirmed_ind",           :string,   :limit => 1
    t.column "gene_name",                   :string,   :limit => 64
    t.column "sequence_len",                :integer
    t.column "samplesize",                  :integer
    t.column "expressed_sequence_ind",      :string,   :limit => 1
    t.column "somatic_ind",                 :string,   :limit => 1
    t.column "sub_locus_id",                :integer
    t.column "create_time",                 :datetime
    t.column "last_updated_time",           :datetime
    t.column "ancestral_allele",            :string
    t.column "cpg_code",                    :integer
    t.column "variation_id",                :integer
    t.column "top_or_bot_strand",           :string,   :limit => 1
    t.column "validation_status",           :integer
    t.column "snp_id",                      :integer
    t.column "tax_id",                      :integer,                :null => false
    t.column "chr_id",                      :integer
  end

  add_index "subsnps", ["snp_id"], :name => "subsnp_snp_idx"

end
