| 1 | use utf8; | ||
| 2 | package Schema::RackTables::0_18_5::Result::TagStorage; | ||
| 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_18_5::Result::TagStorage | ||
| 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<TagStorage> | ||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | __PACKAGE__->table("TagStorage"); | ||
| 35 | |||
| 36 | =head1 ACCESSORS | ||
| 37 | |||
| 38 | =head2 entity_realm | ||
| 39 | |||
| 40 | data_type: 'enum' | ||
| 41 | default_value: 'object' | ||
| 42 | extra: {list => ["file","ipv4net","ipv4vs","ipv4rspool","object","rack","user"]} | ||
| 43 | is_nullable: 0 | ||
| 44 | |||
| 45 | =head2 entity_id | ||
| 46 | |||
| 47 | data_type: 'integer' | ||
| 48 | extra: {unsigned => 1} | ||
| 49 | is_nullable: 0 | ||
| 50 | |||
| 51 | =head2 tag_id | ||
| 52 | |||
| 53 | data_type: 'integer' | ||
| 54 | default_value: 0 | ||
| 55 | extra: {unsigned => 1} | ||
| 56 | is_foreign_key: 1 | ||
| 57 | is_nullable: 0 | ||
| 58 | |||
| 59 | =cut | ||
| 60 | |||
| 61 | __PACKAGE__->add_columns( | ||
| 62 | "entity_realm", | ||
| 63 | { | ||
| 64 | data_type => "enum", | ||
| 65 | default_value => "object", | ||
| 66 | extra => { | ||
| 67 | list => [ | ||
| 68 | "file", | ||
| 69 | "ipv4net", | ||
| 70 | "ipv4vs", | ||
| 71 | "ipv4rspool", | ||
| 72 | "object", | ||
| 73 | "rack", | ||
| 74 | "user", | ||
| 75 | ], | ||
| 76 | }, | ||
| 77 | is_nullable => 0, | ||
| 78 | }, | ||
| 79 | "entity_id", | ||
| 80 | { data_type => "integer", extra => { unsigned => 1 }, is_nullable => 0 }, | ||
| 81 | "tag_id", | ||
| 82 | { | ||
| 83 | data_type => "integer", | ||
| 84 | default_value => 0, | ||
| 85 | extra => { unsigned => 1 }, | ||
| 86 | is_foreign_key => 1, | ||
| 87 | is_nullable => 0, | ||
| 88 | }, | ||
| 89 | ); | ||
| 90 | |||
| 91 | =head1 UNIQUE CONSTRAINTS | ||
| 92 | |||
| 93 | =head2 C<entity_tag> | ||
| 94 | |||
| 95 | =over 4 | ||
| 96 | |||
| 97 | =item * L</entity_realm> | ||
| 98 | |||
| 99 | =item * L</entity_id> | ||
| 100 | |||
| 101 | =item * L</tag_id> | ||
| 102 | |||
| 103 | =back | ||
| 104 | |||
| 105 | =cut | ||
| 106 | |||
| 107 | __PACKAGE__->add_unique_constraint("entity_tag", ["entity_realm", "entity_id", "tag_id"]); | ||
| 108 | |||
| 109 | =head1 RELATIONS | ||
| 110 | |||
| 111 | =head2 tag | ||
| 112 | |||
| 113 | Type: belongs_to | ||
| 114 | |||
| 115 | Related object: L<Schema::RackTables::0_18_5::Result::TagTree> | ||
| 116 | |||
| 117 | =cut | ||
| 118 | |||
| 119 | __PACKAGE__->belongs_to( | ||
| 120 | "tag", | ||
| 121 | "Schema::RackTables::0_18_5::Result::TagTree", | ||
| 122 | { id => "tag_id" }, | ||
| 123 | { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" }, | ||
| 124 | ); | ||
| 125 | |||
| 126 | |||
| 127 | # Created by DBIx::Class::Schema::Loader v0.07043 @ 2015-10-22 23:03:18 | ||
| 128 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rDFS3pcVtNHa7Ml9cA/ung | ||
| 129 | |||
| 130 | |||
| 131 | # You can replace this text with custom code or comments, and it will be preserved on regeneration | ||
| 132 | 1; |