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