| 1 | 13 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | package Biblio::Zotero::DB::Schema::Result::Tag; | ||
| 3 | 13 | $Biblio::Zotero::DB::Schema::Result::Tag::VERSION = '0.004'; | |
| 4 | # Created by DBIx::Class::Schema::Loader | ||
| 5 | # DO NOT MODIFY THE FIRST PART OF THIS FILE | ||
| 6 | |||
| 7 | |||
| 8 | 13 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 13 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 13 | ▶ | use base 'DBIx::Class::Core'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | |||
| 14 | 13 | __PACKAGE__->table("tags"); | |
| 15 | |||
| 16 | |||
| 17 | 13 | __PACKAGE__->add_columns( | |
| 18 | "tagid", | ||
| 19 | { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, | ||
| 20 | "name", | ||
| 21 | { data_type => "text", is_nullable => 0 }, | ||
| 22 | "type", | ||
| 23 | { data_type => "int", is_nullable => 0 }, | ||
| 24 | "dateadded", | ||
| 25 | { | ||
| 26 | data_type => "timestamp", | ||
| 27 | default_value => \"current_timestamp", | ||
| 28 | is_nullable => 0, | ||
| 29 | }, | ||
| 30 | "datemodified", | ||
| 31 | { | ||
| 32 | data_type => "timestamp", | ||
| 33 | default_value => \"current_timestamp", | ||
| 34 | is_nullable => 0, | ||
| 35 | }, | ||
| 36 | "clientdatemodified", | ||
| 37 | { | ||
| 38 | data_type => "timestamp", | ||
| 39 | default_value => \"current_timestamp", | ||
| 40 | is_nullable => 0, | ||
| 41 | }, | ||
| 42 | "libraryid", | ||
| 43 | { data_type => "int", is_nullable => 1 }, | ||
| 44 | "key", | ||
| 45 | { data_type => "text", is_nullable => 0 }, | ||
| 46 | ); | ||
| 47 | |||
| 48 | |||
| 49 | 13 | __PACKAGE__->set_primary_key("tagid"); | |
| 50 | |||
| 51 | |||
| 52 | 13 | __PACKAGE__->add_unique_constraint("libraryid_key_unique", ["libraryid", "key"]); | |
| 53 | |||
| 54 | |||
| 55 | 13 | __PACKAGE__->add_unique_constraint("libraryid_name_type_unique", ["libraryid", "name", "type"]); | |
| 56 | |||
| 57 | |||
| 58 | 13 | __PACKAGE__->has_many( | |
| 59 | "item_tags", | ||
| 60 | "Biblio::Zotero::DB::Schema::Result::ItemTag", | ||
| 61 | { "foreign.tagid" => "self.tagid" }, | ||
| 62 | { cascade_copy => 0, cascade_delete => 0 }, | ||
| 63 | ); | ||
| 64 | |||
| 65 | |||
| 66 | 13 | __PACKAGE__->many_to_many("itemids", "item_tags", "itemid"); | |
| 67 | |||
| 68 | |||
| 69 | # Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-07-02 23:02:38 | ||
| 70 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KZ6mzhv66OnDC6I6Qr/EwQ | ||
| 71 | |||
| 72 | |||
| 73 | # You can replace this text with custom code or comments, and it will be preserved on regeneration | ||
| 74 | 13 | 1; | |
| 75 | |||
| 76 | __END__ | ||