treasuredb/TrsrDB/Transfer.pm

22 lines
545 B
Perl
Raw Normal View History

2016-06-26 17:49:12 +02:00
use strict;
package TrsrDB::Transfer;
use base qw/DBIx::Class::Core/;
__PACKAGE__->table('Transfer');
__PACKAGE__->add_column("timestamp" => { data_type => 'TIMESTAMP' });
__PACKAGE__->add_column("billId");
__PACKAGE__->add_column("credId" => { data_type => 'INTEGER' });
2016-06-26 17:49:12 +02:00
__PACKAGE__->add_column("amount" => { data_type => 'INTEGER', nullable => 1 });
__PACKAGE__->set_primary_key("billId", "credId");
2016-06-26 17:49:12 +02:00
__PACKAGE__->belongs_to(
credit => 'TrsrDB::Credit', 'credId'
2016-06-26 17:49:12 +02:00
);
__PACKAGE__->belongs_to(
debit => 'TrsrDB::Credit', 'billId'
);
1;