— — — — — — — |
__PACKAGE__->table( "staff" );
__PACKAGE__->add_columns(
"staff_id" ,
{
data_type => "TINYINT" ,
default_value => undef ,
extra => { unsigned => 1 },
is_auto_increment => 1,
is_nullable => 0,
size => 3,
},
"first_name" ,
{
data_type => "VARCHAR" ,
default_value => undef ,
is_nullable => 0,
size => 45,
},
"last_name" ,
{
data_type => "VARCHAR" ,
default_value => undef ,
is_nullable => 0,
size => 45,
},
"address_id" ,
{
data_type => "SMALLINT" ,
default_value => undef ,
extra => { unsigned => 1 },
is_foreign_key => 1,
is_nullable => 0,
size => 5,
},
"picture" ,
{
data_type => "BLOB" ,
default_value => undef ,
is_nullable => 1,
size => 65535,
},
"email" ,
{
data_type => "VARCHAR" ,
default_value => undef ,
is_nullable => 1,
size => 50,
},
"store_id" ,
{
data_type => "TINYINT" ,
default_value => undef ,
extra => { unsigned => 1 },
is_foreign_key => 1,
is_nullable => 0,
size => 3,
},
"active" ,
{ data_type => "TINYINT" , default_value => 1, is_nullable => 0, size => 1 },
"username" ,
{
data_type => "VARCHAR" ,
default_value => undef ,
is_nullable => 0,
size => 16,
},
"password" ,
{
data_type => "VARCHAR" ,
default_value => undef ,
is_nullable => 1,
size => 40,
},
"last_update" ,
{
data_type => "TIMESTAMP" ,
default_value => \ "CURRENT_TIMESTAMP" ,
is_nullable => 0,
size => 14,
},
);
__PACKAGE__->set_primary_key( "staff_id" );
__PACKAGE__->has_many(
"payments" ,
"Sakila::Result::Payment" ,
{ "foreign.staff_id" => "self.staff_id" },
);
__PACKAGE__->has_many(
"rentals" ,
"Sakila::Result::Rental" ,
{ "foreign.staff_id" => "self.staff_id" },
);
__PACKAGE__->belongs_to(
"address" ,
"Sakila::Result::Address" ,
{ address_id => "address_id" },
{},
);
__PACKAGE__->belongs_to(
"store" ,
"Sakila::Result::Store" ,
{ store_id => "store_id" },
{},
);
__PACKAGE__->might_have(
"store" ,
"Sakila::Result::Store" ,
{ "foreign.manager_staff_id" => "self.staff_id" },
);
1;
|