CharmBoard/lib/CharmBoard/Schema/Source/Threads.pm

30 lines
717 B
Perl

package CharmBoard::Schema::Source::Threads;
use strict;
use warnings;
use experimental qw(try smartmatch);
use utf8;
use base qw(DBIx::Class::Core);
__PACKAGE__->table('threads');
__PACKAGE__->add_columns(
thread_id => {
data_type => 'integer',
is_auto_increment => 1,
is_nullable => 0, },
thread_title => {
data_type => 'text',
is_nullable => 0, },
thread_subf => {
data_type => 'integer',
is_foreign_key => 1,
is_nullable => 0, });
__PACKAGE__->set_primary_key('thread_id');
__PACKAGE__->belongs_to(
thread_subf =>
'CharmBoard::Schema::Source::Subforums',
{'foreign.subf_id' => 'self.thread_subf'});
1;
__END__