package TrialWorkers::Person; use base 'TrialWorkers::DBI'; TrialWorkers::Person->table('people'); TrialWorkers::Person->columns( All=>qw[ people_id user_id first_name last_name comments ] ); TrialWorkers::Person->has_many(priveleges=>'TrialWorkers::Priveleges'); TrialWorkers::Person->has_many( password_notification=>'TrialWorkers::PasswordNotification'); TrialWorkers::Person->has_many(jobsignup=>'TrialWorkers::JobSignup'); TrialWorkers::Person->has_many(daysignup=>'TrialWorkers::DaySignup'); TrialWorkers::Person->has_many(dogs=>'TrialWorkers::Dog'); TrialWorkers::Person->has_a(user_id=>'TrialWorkers::User'); use Class::DBI::DATA::Schema; 1; __DATA__ drop table if exists people; create table people ( people_id integer unsigned not null auto_increment primary key, user_id integer unsigned not null, first_name varchar(40) not null, last_name varchar(40) not null, comments varchar(128), unique index (people_id,user_id) ); drop table if exists priveleges; create table priveleges ( priv_id integer not null auto_increment primary key, people_id integer not null, is_admin enum ('N','Y') not null default 'N', can_sched enum ('N','Y') not null default 'N', unique index (priv_id,people_id) ); drop table if exists password_notification; create table password_notification ( pn_id integer not null auto_increment primary key, people_id integer not null, notified enum ('N','Y') not null default 'N', bounced enum('N','Y') not null default 'N', whenNotified date not null default '2004-08-01', unique index (pn_id,people_id,whenNotified) );