fixed recursive_children cvterm function, and added tests for parents and children
[cxgn-corelibs.git] / lib / SGN / Schema / Organism.pm
blob5585ef7e93c3b3f704c15ed34522c269c1f331ac
1 package SGN::Schema::Organism;
3 use strict;
4 use warnings;
6 use base 'DBIx::Class';
8 __PACKAGE__->load_components("Core");
9 __PACKAGE__->table("organism");
10 __PACKAGE__->add_columns(
11 "organism_id",
13 data_type => "integer",
14 default_value => "nextval('organism_organism_id_seq'::regclass)",
15 is_auto_increment => 1,
16 is_nullable => 0,
17 size => 4,
19 "organism_name",
21 data_type => "character varying",
22 default_value => undef,
23 is_nullable => 1,
24 size => 80,
26 "common_name_id",
28 data_type => "bigint",
29 default_value => undef,
30 is_foreign_key => 1,
31 is_nullable => 0,
32 size => 8,
34 "organism_descrip",
36 data_type => "text",
37 default_value => undef,
38 is_nullable => 1,
39 size => undef,
41 "specie_tax",
43 data_type => "character varying",
44 default_value => undef,
45 is_nullable => 1,
46 size => 80,
48 "genus_tax",
50 data_type => "integer",
51 default_value => undef,
52 is_foreign_key => 1,
53 is_nullable => 1,
54 size => 4,
56 "subfamily_tax",
58 data_type => "integer",
59 default_value => undef,
60 is_foreign_key => 1,
61 is_nullable => 1,
62 size => 4,
64 "family_tax",
66 data_type => "integer",
67 default_value => undef,
68 is_foreign_key => 1,
69 is_nullable => 1,
70 size => 4,
72 "order_tax",
74 data_type => "integer",
75 default_value => undef,
76 is_foreign_key => 1,
77 is_nullable => 1,
78 size => 4,
80 "chr_n_gnmc",
81 { data_type => "integer", default_value => undef, is_nullable => 1, size => 4 },
82 "polypl_gnmc",
84 data_type => "character varying",
85 default_value => undef,
86 is_nullable => 1,
87 size => 50,
89 "genom_size_gnmc",
91 data_type => "character varying",
92 default_value => undef,
93 is_nullable => 1,
94 size => 50,
96 "genom_proj_gnmc",
98 data_type => "text",
99 default_value => undef,
100 is_nullable => 1,
101 size => undef,
103 "est_attribution_tqmc",
105 data_type => "text",
106 default_value => undef,
107 is_nullable => 1,
108 size => undef,
111 __PACKAGE__->set_primary_key("organism_id");
112 __PACKAGE__->add_unique_constraint("unique_organism_name", ["organism_name"]);
113 __PACKAGE__->has_many(
114 "accessions",
115 "SGN::Schema::Accession",
116 { "foreign.organism_id" => "self.organism_id" },
118 __PACKAGE__->has_many(
119 "deprecated_map_crosses",
120 "SGN::Schema::DeprecatedMapCross",
121 { "foreign.organism_id" => "self.organism_id" },
123 __PACKAGE__->belongs_to(
124 "order_tax",
125 "SGN::Schema::Taxonomy",
126 { tax_id => "order_tax" },
127 { join_type => "LEFT" },
129 __PACKAGE__->belongs_to(
130 "family_tax",
131 "SGN::Schema::Taxonomy",
132 { tax_id => "family_tax" },
133 { join_type => "LEFT" },
135 __PACKAGE__->belongs_to(
136 "genus_tax",
137 "SGN::Schema::Taxonomy",
138 { tax_id => "genus_tax" },
139 { join_type => "LEFT" },
141 __PACKAGE__->belongs_to(
142 "subfamily_tax",
143 "SGN::Schema::Taxonomy",
144 { tax_id => "subfamily_tax" },
145 { join_type => "LEFT" },
147 __PACKAGE__->belongs_to(
148 "common_name",
149 "SGN::Schema::CommonName",
150 { common_name_id => "common_name_id" },
154 # Created by DBIx::Class::Schema::Loader v0.04999_07 @ 2009-09-04 13:21:55
155 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hIsxt1nQ/SSj6bkmAl7lzg
158 # You can replace this text with custom content, and it will be preserved on regeneration