package LIMS::DB::AuditRequestOption;

use base qw(LIMS::RDBO);

__PACKAGE__->meta->setup(
    table   => 'audit_request_options',

    columns => [
        id          => { type => 'serial', not_null => 1 },
        description => { type => 'varchar', length => 255, not_null => 1 },
        category_id => { type => 'integer', default => '0', not_null => 1 },
        active	    => { type => 'enum', check_in => [ 'yes', 'no' ], not_null => 1 },
   ],

    primary_key_columns => [ 'id' ],

    unique_key => [ 'description' ],

    foreign_keys => [
        category => {
            class       => 'LIMS::DB::AuditRequestCategory',
            key_columns => { category_id => 'id' },
        },
    ],

    relationships => [
        request_audit => {
            class      => 'LIMS::DB::RequestAudit',
            column_map => { id => 'audit_request_option_id' },
            type       => 'one to many',
        },
    ],
);

# or to see what it should be:
#__PACKAGE__->meta->table('trials');
#__PACKAGE__->meta->auto_initialize;
# print __PACKAGE__->meta->perl_class_definition(indent => 4);

__PACKAGE__->meta->make_manager_class('audit_request_options');

1;