fixed recursive_children cvterm function, and added tests for parents and children
[cxgn-corelibs.git] / lib / SGN / Schema / Map.pm
blob3945e930e0cd7e995ec4109409afca4e0abb154b
1 package SGN::Schema::Map;
3 use strict;
4 use warnings;
6 use base 'DBIx::Class';
8 __PACKAGE__->load_components("Core");
9 __PACKAGE__->table("map");
10 __PACKAGE__->add_columns(
11 "map_id",
13 data_type => "integer",
14 default_value => "nextval('map_map_id_seq'::regclass)",
15 is_auto_increment => 1,
16 is_nullable => 0,
17 size => 4,
19 "short_name",
21 data_type => "text",
22 default_value => undef,
23 is_nullable => 0,
24 size => undef,
26 "long_name",
28 data_type => "text",
29 default_value => undef,
30 is_nullable => 1,
31 size => undef,
33 "abstract",
35 data_type => "text",
36 default_value => undef,
37 is_nullable => 1,
38 size => undef,
40 "map_type",
42 data_type => "text",
43 default_value => undef,
44 is_nullable => 1,
45 size => undef,
47 "parent_1",
49 data_type => "integer",
50 default_value => undef,
51 is_foreign_key => 1,
52 is_nullable => 1,
53 size => 4,
55 "parent_2",
57 data_type => "integer",
58 default_value => undef,
59 is_foreign_key => 1,
60 is_nullable => 1,
61 size => 4,
63 "units",
65 data_type => "text",
66 default_value => "'cM'::text",
67 is_nullable => 1,
68 size => undef,
70 "ancestor",
72 data_type => "integer",
73 default_value => undef,
74 is_foreign_key => 1,
75 is_nullable => 1,
76 size => 4,
79 __PACKAGE__->set_primary_key("map_id");
80 __PACKAGE__->belongs_to(
81 "ancestor",
82 "SGN::Schema::Accession",
83 { accession_id => "ancestor" },
84 { join_type => "LEFT" },
86 __PACKAGE__->belongs_to(
87 "parent_2",
88 "SGN::Schema::Accession",
89 { accession_id => "parent_2" },
90 { join_type => "LEFT" },
92 __PACKAGE__->belongs_to(
93 "parent_1",
94 "SGN::Schema::Accession",
95 { accession_id => "parent_1" },
96 { join_type => "LEFT" },
98 __PACKAGE__->has_many(
99 "map_versions",
100 "SGN::Schema::MapVersion",
101 { "foreign.map_id" => "self.map_id" },
103 __PACKAGE__->has_many(
104 "pcr_experiments",
105 "SGN::Schema::PcrExperiment",
106 { "foreign.map_id" => "self.map_id" },
110 # Created by DBIx::Class::Schema::Loader v0.04999_07 @ 2009-09-04 13:21:55
111 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VAbpsHO3jE5BVJ77K8dd5Q
114 # You can replace this text with custom content, and it will be preserved on regeneration