CREATE TABLE IF NOT EXISTS `friends` (
`user_id` int(10) unsigned NOT NULL,
`friend_id` int(10) unsigned NOT NULL,
`status` enum('approved','pending') NOT NULL default 'pending',
`requestTime` int(10) NOT NULL,
KEY `user_id` (`user_id`),
KEY `friend_id` (`friend_id`)
)
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL auto_increment,
`username` varchar(50) NOT NULL,
`password` varchar(100) NOT NULL,
`status` enum('active','inactive','pending','disabled') NOT NULL
default 'pending',
`hash` varchar(255) NOT NULL,
`email` varchar(50) NOT NULL,
`handle` varchar(50) NOT NULL,
`gender` enum('male','female') NOT NULL default 'male',
`firstName` varchar(25) NOT NULL,
`lastName` varchar(25) NOT NULL,
`birthdate` int(10) unsigned NOT NULL default '0',
`city` varchar(25) NOT NULL,
`state_id` int(10) unsigned NOT NULL default '0',
`country_id` int(10) unsigned NOT NULL default '0',
`zipCode` varchar(10) NOT NULL,
`created` datetime default NULL,
`modified` datetime default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
KEY `state_id` (`state_id`),
KEY `country_id` (`country_id`)
)
class User extends AppModel {
var $hasMany = array(
// Profile modules
'Module' => array(
'className' => 'Module',
'conditions'=> array('Module.display' => 'yes'),
'order' => 'Module.orderNo ASC',
'dependent' => true
),
// Friends
'Friend' => array(
'className' => 'Friend',
'order' => 'Friend.requestTime ASC',
'dependent' => true
)
);
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment