forked from hailo/hailo
/
Expr.pm
123 lines (85 loc) · 2.14 KB
/
Expr.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package Hailo::Storage::Schema::Result::Expr;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 NAME
Hailo::Storage::Schema::Result::Expr
=cut
__PACKAGE__->table("expr");
=head1 ACCESSORS
=head2 id
data_type: INTEGER
default_value: undef
is_auto_increment: 1
is_nullable: 1
size: undef
=head2 token*_id
data_type: INTEGER
default_value: undef
is_foreign_key: 1
is_nullable: 0
=cut
__PACKAGE__->add_columns(
"id",
{
data_type => "INTEGER",
default_value => undef,
is_auto_increment => 1,
is_nullable => 1,
size => undef,
}
);
sub add_tokenN_id {
my ($self, $n) = @_;
__PACKAGE__->add_columns(
"token${n}_id",
{
data_type => "INTEGER",
default_value => undef,
is_foreign_key => 1,
is_nullable => 0,
size => undef,
},
);
__PACKAGE__->belongs_to(
"token${n}",
"Hailo::Storage::Schema::Result::Token",
{ id => "token${n}_id" },
{},
);
}
if (my $n = $ENV{HAILO_STORAGE_SCHEMA_RESULT_EXPR_TOKENN_ORDERS}) {
# Work around add_tokenN_id() not working properly after the class
# has been loaded once.
add_tokenN_id(undef, $_) for 0 .. $n;
}
__PACKAGE__->set_primary_key("id");
=head1 RELATIONS
=head2 token*
Type: belongs_to
Related object: L<Hailo::Storage::Schema::Result::Token>
=cut
=head2 next_tokens
Type: has_many
Related object: L<Hailo::Storage::Schema::Result::NextToken>
=cut
__PACKAGE__->has_many(
"next_tokens",
"Hailo::Storage::Schema::Result::NextToken",
{ "foreign.expr_id" => "self.id" },
);
=head2 prev_tokens
Type: has_many
Related object: L<Hailo::Storage::Schema::Result::PrevToken>
=cut
__PACKAGE__->has_many(
"prev_tokens",
"Hailo::Storage::Schema::Result::PrevToken",
{ "foreign.expr_id" => "self.id" },
);
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-03-14 16:32:30
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HW8plHxg8erk2e8UIaMWwg
# You can replace this text with custom content, and it will be preserved on regeneration
1;