source: xas/trunk/templates/table.pm @ 1f7fb7c704e27b311427c5e6e34839af55d3bd25

Revision 1f7fb7c704e27b311427c5e6e34839af55d3bd25, 2.1 KB checked in by Kevin L. Esteb <kevin@…>, 19 months ago (diff)

updated documentation

  • Property mode set to 100644
Line 
1package XAS::Model::Database::XXXX::Result::XXXX;
2
3our $VERSION = '0.01';
4
5use XAS::Class
6  version => $VERSION,
7  base    => 'DBIx::Class::Core',
8  mixin   => 'XAS::Model::DBM'
9;
10
11__PACKAGE__->load_components( qw/ InflateColumn::DateTime OptimisticLocking / );
12__PACKAGE__->table( 'XXXX' );
13__PACKAGE__->add_columns(
14    id => {
15        data_type         => 'bigint',
16        is_auto_increment => 1,
17        sequence          => 'XXXX_id_seq',
18        is_nullable       => 0
19    },
20
21
22    revision => {
23        data_type   => 'integer',
24        is_nullable => 1
25    }
26);
27
28__PACKAGE__->set_primary_key( 'id' );
29__PACKAGE__->optimistic_locking_strategy('version');
30__PACKAGE__->optimistic_locking_version_column('revision');
31
32sub sqlt_deploy_hook {
33    my ($self, $sqlt_table) = @_;
34
35}
36
37sub table_name {
38    return __PACKAGE__;
39}
40
411;
42
43__END__
44 
45=head1 NAME
46
47XAS::Model::Database::XXXX::Result::XXXX - Table defination for XAS Model
48
49=head1 DESCRIPTION
50
51The definition for the log table.
52
53=head1 FIELDS
54
55=head2 id
56
57An automatic incremental index.
58
59=over 4
60
61=item B<data type> - bigint
62
63=item B<sequence name> - 'XXXX_id_seq'
64
65=item B<is nullable> - no
66
67=back
68
69=head2 revision
70
71Used by L<DBIx::Class::OptimisticLocking|https://metacpan.org/pod/DBIx::Class::Optimisticlocking>
72to manage changes for this record.
73
74=over 4
75
76=item B<data type> - integer
77 
78=item B<is nullable> - yes
79
80=back
81
82=head1 METHODS
83
84=head2 sqlt_deploy_hook($sqlt_table)
85
86This method is used when a database schema is being generated. It can be used
87to add additional features.
88
89=over 4
90
91=item B<$sqlt_table>
92
93The DBIx::Class class for this table.
94
95=back
96
97=head2 table_name
98
99Used by the helper functions mixed in from L<XAS::Model::DBM|XAS::Model::DBM>.
100
101=head1 SEE ALSO
102
103=over 4
104
105=item L<XAS|XAS>
106
107=back
108
109=head1 AUTHOR
110
111Kevin L. Esteb, <kevin@kesteb.us>
112
113=head1 COPYRIGHT AND LICENSE
114
115Copyright (c) 2012-2019 Kevin L. Esteb
116
117This is free software; you can redistribute it and/or modify it under
118the terms of the Artistic License 2.0. For details, see the full text
119of the license at http://www.perlfoundation.org/artistic_license_2_0.
120
121=cut
Note: See TracBrowser for help on using the repository browser.