1b3dc2418a04b06b7a6098b0573909657c4a2664
[dbsrgits/DBIx-Class-Journal.git] / lib / DBIx / Class / Schema / Journal / DB / ChangeLog.pm
1 package DBIx::Class::Schema::Journal::DB::ChangeLog;
2
3 use base 'DBIx::Class::Core';
4
5 __PACKAGE__->load_components(qw/Ordered/);
6 __PACKAGE__->table('changelog');
7
8 __PACKAGE__->add_columns(
9         ID => {
10                 data_type => 'integer',
11                 is_auto_increment => 1,
12                 is_primary_key => 1,
13                 is_nullable => 0,
14         },
15                 changeset_id => {
16                 data_type => 'integer',
17                 is_nullable => 0,
18                 is_foreign_key => 1,
19         },
20         order_in => {
21                 data_type => 'integer',
22                 is_nullable => 0,
23         },
24 );
25
26
27 __PACKAGE__->set_primary_key('ID');
28 __PACKAGE__->add_unique_constraint('setorder', [ qw/changeset_id order_in/ ]);
29 __PACKAGE__->belongs_to('changeset', 'DBIx::Class::Schema::Journal::DB::ChangeSet', 'changeset_id');
30
31  __PACKAGE__->position_column('order_in');
32  __PACKAGE__->grouping_column('changeset_id');
33
34 1;