BEGIN {
};
__PACKAGE__->load_components(
qw/
+Handel::Components::DefaultValues
+Handel::Components::Constraints
+Handel::Components::Validation
InflateColumn::DateTime
Core
/
);
__PACKAGE__->table(
'user'
);
__PACKAGE__->source_name(
'Users'
);
__PACKAGE__->add_columns(
id
=> {
data_type
=>
'INT'
,
is_auto_increment
=> 1,
is_nullable
=> 0,
extras
=> {
unsigned
=> 1}
},
username
=> {
data_type
=>
'VARCHAR'
,
size
=> 25,
is_nullable
=> 0
},
password
=> {
data_type
=>
'VARCHAR'
,
size
=> 255,
is_nullable
=> 0
},
created
=> {
data_type
=>
'DATETIME'
,
is_nullable
=> 0,
extra
=> {
timezone
=>
"UTC"
}
},
updated
=> {
data_type
=>
'DATETIME'
,
is_nullable
=> 0,
extra
=> {
timezone
=>
"UTC"
}
}
);
__PACKAGE__->set_primary_key(
'id'
);
__PACKAGE__->add_unique_constraint(
username
=> [
qw/username/
]
);
__PACKAGE__->has_many(
map_user_role
=>
'Mango::Schema::UserRole'
,
{
'foreign.user_id'
=>
'self.id'
}
);
__PACKAGE__->many_to_many(
roles
=>
'map_user_role'
,
'role'
);
__PACKAGE__->might_have(
profile
=>
'Mango::Schema::Profile'
,
{
'foreign.user_id'
=>
'self.id'
}
);
__PACKAGE__->has_many(
wishlists
=>
'Mango::Schema::Wishlist'
,
{
'foreign.user_id'
=>
'self.id'
}
);
__PACKAGE__->default_values({
created
=>
sub
{DateTime->now},
updated
=>
sub
{DateTime->now}
});
1;