LasTres/lib/LasTres/Schema/Result/Team.pm

50 lines
986 B
Perl

package LasTres::Schema::Result::Team;
use v5.36.0;
use strict;
use warnings;
use parent 'DBIx::Class::Core';
__PACKAGE__->table('teams');
__PACKAGE__->add_columns(
uuid => {
data_type => 'uuid',
is_nullable => 0,
},
leader => {
data_type => 'uuid',
is_nullable => 0,
is_foreign_key => 1,
},
name => {
data_type => 'text',
is_nullable => 0,
},
planet => {
data_type => 'text',
is_nullable => 0,
},
super_area => {
data_type => 'text',
is_nullable => 0,
},
area => {
data_type => 'text',
is_nullable => 0,
},
location => {
data_type => 'text',
is_nullable => 0,
},
);
__PACKAGE__->set_primary_key('uuid');
__PACKAGE__->add_unique_constraint(u_name => ['name']);
__PACKAGE__->has_many('members', 'LasTres::Schema::Result::PJ', 'team');
__PACKAGE__->belongs_to('leader', 'LasTres::Schema::Result::PJ');
1;