| 1 | use utf8; | ||
| 2 | package ExpenseTracker::Models::Result::Category; | ||
| 3 | { | ||
| 4 | $ExpenseTracker::Models::Result::Category::VERSION = '0.008'; | ||
| 5 | } | ||
| 6 | { | ||
| 7 | $ExpenseTracker::Models::Result::Category::VERSION = '0.008'; | ||
| 8 | } | ||
| 9 | |||
| 10 | # Created by DBIx::Class::Schema::Loader | ||
| 11 | # DO NOT MODIFY THE FIRST PART OF THIS FILE | ||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | ExpenseTracker::Models::Result::Category | ||
| 16 | |||
| 17 | =head1 VERSION | ||
| 18 | |||
| 19 | version 0.008 | ||
| 20 | |||
| 21 | =cut | ||
| 22 | |||
| 23 | use strict; | ||
| 24 | use warnings; | ||
| 25 | |||
| 26 | use base 'DBIx::Class::Core'; | ||
| 27 | |||
| 28 | =head1 TABLE: C<categories> | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | __PACKAGE__->table("categories"); | ||
| 33 | |||
| 34 | =head1 ACCESSORS | ||
| 35 | |||
| 36 | =head2 id | ||
| 37 | |||
| 38 | data_type: 'integer' | ||
| 39 | is_auto_increment: 1 | ||
| 40 | is_nullable: 0 | ||
| 41 | |||
| 42 | =head2 parent_id | ||
| 43 | |||
| 44 | data_type: 'integer' | ||
| 45 | is_nullable: 1 | ||
| 46 | |||
| 47 | =head2 name | ||
| 48 | |||
| 49 | data_type: 'varchar' | ||
| 50 | is_nullable: 0 | ||
| 51 | |||
| 52 | =head2 description | ||
| 53 | |||
| 54 | data_type: 'text' | ||
| 55 | is_nullable: 1 | ||
| 56 | |||
| 57 | =head2 created_at | ||
| 58 | |||
| 59 | data_type: 'datetime' | ||
| 60 | is_nullable: 1 | ||
| 61 | |||
| 62 | =head2 user_id | ||
| 63 | |||
| 64 | data_type: 'integer' | ||
| 65 | is_nullable: 1 | ||
| 66 | |||
| 67 | =cut | ||
| 68 | |||
| 69 | __PACKAGE__->add_columns( | ||
| 70 | "id", | ||
| 71 | { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, | ||
| 72 | "parent_id", | ||
| 73 | { data_type => "integer", is_nullable => 1 }, | ||
| 74 | "name", | ||
| 75 | { data_type => "varchar", is_nullable => 0 }, | ||
| 76 | "description", | ||
| 77 | { data_type => "text", is_nullable => 1 }, | ||
| 78 | "created_at", | ||
| 79 | { data_type => "datetime", is_nullable => 1 }, | ||
| 80 | "user_id", | ||
| 81 | { data_type => "integer", is_nullable => 1 }, | ||
| 82 | ); | ||
| 83 | |||
| 84 | =head1 PRIMARY KEY | ||
| 85 | |||
| 86 | =over 4 | ||
| 87 | |||
| 88 | =item * L</id> | ||
| 89 | |||
| 90 | =back | ||
| 91 | |||
| 92 | =cut | ||
| 93 | |||
| 94 | __PACKAGE__->set_primary_key("id"); | ||
| 95 | |||
| 96 | |||
| 97 | # Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-07-08 11:25:25 | ||
| 98 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Q4inyXJmZPFAxtYf6421MA | ||
| 99 | |||
| 100 | |||
| 101 | # You can replace this text with custom code or comments, and it will be preserved on regeneration | ||
| 102 | __PACKAGE__->load_components(qw( Tree::AdjacencyList )); | ||
| 103 | __PACKAGE__->parent_column('parent_id'); | ||
| 104 | __PACKAGE__->repair_tree( 1 ); | ||
| 105 | |||
| 106 | |||
| 107 | __PACKAGE__->belongs_to(user => 'ExpenseTracker::Models::Result::User', 'user_id'); | ||
| 108 | __PACKAGE__->has_many(operations_category => 'ExpenseTracker::Models::Result::OperationsCategory', 'category_id'); | ||
| 109 | __PACKAGE__->many_to_many(operations => 'operations_category', 'operation'); | ||
| 110 | |||
| 111 | 1; |