package LasTres::Schema::Result::PJFlag;

use v5.36.0;
use strict;
use warnings;

use feature 'signatures';

use parent 'DBIx::Class::Core';

use Data::Dumper;

use Moo;

__PACKAGE__->table('player_pjs_flags');

__PACKAGE__->add_columns(
    name => {
        data_type   => 'text',
        is_nullable => 0,
    },
    owner => {
        data_type      => 'uuid',
        is_nullable    => 0,
        is_foreign_key => 1,
    },
);

__PACKAGE__->set_primary_key( 'owner', 'name' );

__PACKAGE__->belongs_to( 'owner', 'LasTres::Schema::Result::PJ' );

sub sqlt_deploy_hook ( $self, $sqlt_table ) {
    $sqlt_table->add_index( name => 'index_flag', fields => [qw/owner name/] );
}
1;
