Debugging and tests, why do we get "database locked" with sqlite?
[dbsrgits/DBIx-Class-Journal.git] / lib / DBIx / Class / Schema / Journal / DB / AuditLog.pm
1 package DBIx::Class::Schema::Journal::DB::AuditLog;
2
3 use base 'DBIx::Class::Schema::Journal::DB::Base';
4 __PACKAGE__->table(__PACKAGE__->table);
5
6 __PACKAGE__->add_columns(
7                            ID => {
8                                data_type => 'integer',
9                                is_nullable => 0,
10                            },
11                            create_id => {
12                                data_type => 'integer',
13                                is_nullable => 0,
14                                is_foreign_key => 1,
15                            },
16                            delete_id => {
17                                data_type => 'integer',
18                                is_nullable => 1,
19                                is_foreign_key => 1,
20                            });
21   __PACKAGE__->belongs_to('created', 'DBIx::Class::Schema::Journal::DB::Change', 'create_id');
22   __PACKAGE__->belongs_to('deleted', 'DBIx::Class::Schema::Journal::DB::Change', 'delete_id');
23
24 sub new
25 {
26     my ($self, $data, $source, @rest) = @_;
27
28     $data->{created} = { 
29 #        ID => \'DEFAULT',
30         changeset_id => $source->schema->current_changeset,
31         %{$data->{created}}, 
32     };
33
34     $self->next::method($data, $source, @rest);
35 }                           
36
37 1;