package Orchard::DB::Schema::RoyaltyAccounting::StatementAttachment;

use strict;
use warnings;

use lib '/var/app/orchard/collab/jgetter/perllib';
use base 'Orchard::DB::DBIxCore';

## table
__PACKAGE__->table('royalty_accounting.statement_attachment');

## columns
__PACKAGE__->add_columns(
    'statement_attachment_id' => {'is_auto_increment'=>1,'data_type'=>'mediumint','is_nullable'=>0},
    'account_id' => {'data_type'=>'mediumint','is_nullable'=>0},
    'contract_id' => {'data_type'=>'mediumint','is_nullable'=>0},
    'statement_period_id' => {'data_type'=>'mediumint','is_nullable'=>0},
    'statement_attachment_status' => {'data_type'=>'enum','is_nullable'=>0},
    'statement_attachment_type' => {'data_type'=>'enum','is_nullable'=>0},
    'invoice_number' => {'data_type'=>'varchar','is_nullable'=>1},
    'file_location' => {'data_type'=>'varchar','is_nullable'=>1},
    'created_by' => {'data_type'=>'varchar','is_nullable'=>0},
    'created_at' => {'data_type'=>'datetime','is_nullable'=>0}
);

## primary key
__PACKAGE__->set_primary_key('statement_attachment_id');

## unique key (invoice_number)
__PACKAGE__->add_unique_constraint('uidx_statement_attachment_invoice_number' => [qw/invoice_number/]);

1;
