| 1 | use utf8; | ||
| 2 | package Schema::RackTables::0_19_5::Result::Rack; | ||
| 3 | |||
| 4 | # Created by DBIx::Class::Schema::Loader | ||
| 5 | # DO NOT MODIFY THE FIRST PART OF THIS FILE | ||
| 6 | |||
| 7 | =head1 NAME | ||
| 8 | |||
| 9 | Schema::RackTables::0_19_5::Result::Rack | ||
| 10 | |||
| 11 | =cut | ||
| 12 | |||
| 13 | use strict; | ||
| 14 | use warnings; | ||
| 15 | |||
| 16 | use base 'DBIx::Class::Core'; | ||
| 17 | |||
| 18 | =head1 COMPONENTS LOADED | ||
| 19 | |||
| 20 | =over 4 | ||
| 21 | |||
| 22 | =item * L<DBIx::Class::InflateColumn::DateTime> | ||
| 23 | |||
| 24 | =back | ||
| 25 | |||
| 26 | =cut | ||
| 27 | |||
| 28 | __PACKAGE__->load_components("InflateColumn::DateTime"); | ||
| 29 | |||
| 30 | =head1 TABLE: C<Rack> | ||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | __PACKAGE__->table("Rack"); | ||
| 35 | |||
| 36 | =head1 ACCESSORS | ||
| 37 | |||
| 38 | =head2 id | ||
| 39 | |||
| 40 | data_type: 'integer' | ||
| 41 | extra: {unsigned => 1} | ||
| 42 | is_auto_increment: 1 | ||
| 43 | is_nullable: 0 | ||
| 44 | |||
| 45 | =head2 name | ||
| 46 | |||
| 47 | data_type: 'char' | ||
| 48 | is_nullable: 1 | ||
| 49 | size: 255 | ||
| 50 | |||
| 51 | =head2 row_id | ||
| 52 | |||
| 53 | data_type: 'integer' | ||
| 54 | default_value: 1 | ||
| 55 | extra: {unsigned => 1} | ||
| 56 | is_foreign_key: 1 | ||
| 57 | is_nullable: 0 | ||
| 58 | |||
| 59 | =head2 height | ||
| 60 | |||
| 61 | data_type: 'tinyint' | ||
| 62 | default_value: 42 | ||
| 63 | extra: {unsigned => 1} | ||
| 64 | is_nullable: 0 | ||
| 65 | |||
| 66 | =head2 comment | ||
| 67 | |||
| 68 | data_type: 'text' | ||
| 69 | is_nullable: 1 | ||
| 70 | |||
| 71 | =head2 thumb_data | ||
| 72 | |||
| 73 | data_type: 'blob' | ||
| 74 | is_nullable: 1 | ||
| 75 | |||
| 76 | =cut | ||
| 77 | |||
| 78 | __PACKAGE__->add_columns( | ||
| 79 | "id", | ||
| 80 | { | ||
| 81 | data_type => "integer", | ||
| 82 | extra => { unsigned => 1 }, | ||
| 83 | is_auto_increment => 1, | ||
| 84 | is_nullable => 0, | ||
| 85 | }, | ||
| 86 | "name", | ||
| 87 | { data_type => "char", is_nullable => 1, size => 255 }, | ||
| 88 | "row_id", | ||
| 89 | { | ||
| 90 | data_type => "integer", | ||
| 91 | default_value => 1, | ||
| 92 | extra => { unsigned => 1 }, | ||
| 93 | is_foreign_key => 1, | ||
| 94 | is_nullable => 0, | ||
| 95 | }, | ||
| 96 | "height", | ||
| 97 | { | ||
| 98 | data_type => "tinyint", | ||
| 99 | default_value => 42, | ||
| 100 | extra => { unsigned => 1 }, | ||
| 101 | is_nullable => 0, | ||
| 102 | }, | ||
| 103 | "comment", | ||
| 104 | { data_type => "text", is_nullable => 1 }, | ||
| 105 | "thumb_data", | ||
| 106 | { data_type => "blob", is_nullable => 1 }, | ||
| 107 | ); | ||
| 108 | |||
| 109 | =head1 PRIMARY KEY | ||
| 110 | |||
| 111 | =over 4 | ||
| 112 | |||
| 113 | =item * L</id> | ||
| 114 | |||
| 115 | =back | ||
| 116 | |||
| 117 | =cut | ||
| 118 | |||
| 119 | __PACKAGE__->set_primary_key("id"); | ||
| 120 | |||
| 121 | =head1 UNIQUE CONSTRAINTS | ||
| 122 | |||
| 123 | =head2 C<name_in_row> | ||
| 124 | |||
| 125 | =over 4 | ||
| 126 | |||
| 127 | =item * L</row_id> | ||
| 128 | |||
| 129 | =item * L</name> | ||
| 130 | |||
| 131 | =back | ||
| 132 | |||
| 133 | =cut | ||
| 134 | |||
| 135 | __PACKAGE__->add_unique_constraint("name_in_row", ["row_id", "name"]); | ||
| 136 | |||
| 137 | =head1 RELATIONS | ||
| 138 | |||
| 139 | =head2 rack_spaces | ||
| 140 | |||
| 141 | Type: has_many | ||
| 142 | |||
| 143 | Related object: L<Schema::RackTables::0_19_5::Result::RackSpace> | ||
| 144 | |||
| 145 | =cut | ||
| 146 | |||
| 147 | __PACKAGE__->has_many( | ||
| 148 | "rack_spaces", | ||
| 149 | "Schema::RackTables::0_19_5::Result::RackSpace", | ||
| 150 | { "foreign.rack_id" => "self.id" }, | ||
| 151 | { cascade_copy => 0, cascade_delete => 0 }, | ||
| 152 | ); | ||
| 153 | |||
| 154 | =head2 row | ||
| 155 | |||
| 156 | Type: belongs_to | ||
| 157 | |||
| 158 | Related object: L<Schema::RackTables::0_19_5::Result::RackRow> | ||
| 159 | |||
| 160 | =cut | ||
| 161 | |||
| 162 | __PACKAGE__->belongs_to( | ||
| 163 | "row", | ||
| 164 | "Schema::RackTables::0_19_5::Result::RackRow", | ||
| 165 | { id => "row_id" }, | ||
| 166 | { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, | ||
| 167 | ); | ||
| 168 | |||
| 169 | |||
| 170 | # Created by DBIx::Class::Schema::Loader v0.07043 @ 2015-10-22 23:02:19 | ||
| 171 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KyhIRtYlYdv/31Ynhr0eOQ | ||
| 172 | |||
| 173 | |||
| 174 | # You can replace this text with custom code or comments, and it will be preserved on regeneration | ||
| 175 | 1; |