LasTres/lib/LasTres/Schema/Result/Player.pm

53 lines
1.2 KiB
Perl

package LasTres::Schema::Result::Player;
use v5.36.0;
use strict;
use warnings;
use parent 'DBIx::Class::Core';
__PACKAGE__->table('players');
__PACKAGE__->add_columns(
uuid => {
data_type => 'uuid',
is_nullable => 0,
},
username => {
data_type => 'text',
is_nullable => 0,
},
encrypted_password => {
data_type => 'text',
is_nullable => 0,
},
email => {
data_type => 'text',
is_nullable => 0,
},
verified => {
data_type => 'boolean',
is_nullable => 0,
},
verification_token => {
data_type => 'text',
is_nullable => 1,
},
register_date => {
data_type => 'timestamp',
is_nullable => 0,
default_value => \'NOW()',
},
last_activity => {
data_type => 'timestamp',
is_nullable => 0,
default_value => \'NOW()',
},
);
__PACKAGE__->set_primary_key('uuid');
__PACKAGE__->has_many('pjs', 'LasTres::Schema::Result::PJ', 'owner');
__PACKAGE__->add_unique_constraint("unique_constraint_username", ['username']);
__PACKAGE__->add_unique_constraint("unique_constraint_email", ["email"]);
1;