Just for anyone else, who gets stuck on this, Dont name you tables
using capitals

e.g.

"User" -> wont work
"user" -> does work

Cheers
M

On Jul 5, 11:40 am, Maxus <[EMAIL PROTECTED]> wrote:
> Hi People,
>
> When using Bake in phpcake 1.2 rc2, the bake model function never asks
> about relationships, I have followed the name conventions but nothing
> seems to be found, anything I should try? I'm using MySQL 5.0.
>
> Here is an example of my Database model:
>
> -- -----------------------------------------------------
> -- Table `Linked`.`Users`
> -- -----------------------------------------------------
> DROP TABLE IF EXISTS `Linked`.`Users` ;
>
> SHOW WARNINGS;
> CREATE  TABLE IF NOT EXISTS `Linked`.`Users` (
>   `id` INT NOT NULL AUTO_INCREMENT ,
>   `username` VARCHAR(80) NOT NULL ,
>   `password` VARCHAR(80) NOT NULL ,
>   `email` VARCHAR(300) NOT NULL ,
>   `lastlogin` DATETIME NOT NULL ,
>   `created` DATETIME NOT NULL ,
>   `modified` DATETIME NOT NULL ,
>   PRIMARY KEY (`id`) )
> ENGINE = InnoDB;
>
> SHOW WARNINGS;
> CREATE INDEX IDX_UserName ON `Linked`.`Users` (`username` ASC) ;
>
> SHOW WARNINGS;
> CREATE INDEX IDX_Email ON `Linked`.`Users` (`email` ASC) ;
>
> SHOW WARNINGS;
>
> -- -----------------------------------------------------
> -- Data for table `Linked`.`Users`
> -- -----------------------------------------------------
> SET AUTOCOMMIT=0;
> INSERT INTO `Users` (`id`, `username`, `password`, `email`,
> `lastlogin`, `created`, `modified`) VALUES (0, 'EvilAdmin',
> 'Password', '[EMAIL PROTECTED]', '2008-01-01', '2008-01-01',
> '2008-01-01');
>
> COMMIT;
>
> -- -----------------------------------------------------
> -- Table `Linked`.`Links`
> -- -----------------------------------------------------
> DROP TABLE IF EXISTS `Linked`.`Links` ;
>
> SHOW WARNINGS;
> CREATE  TABLE IF NOT EXISTS `Linked`.`Links` (
>   `id` INT NOT NULL AUTO_INCREMENT ,
>   `user_id` INT NOT NULL ,
>   `url` VARCHAR(900) NOT NULL ,
>   `name` VARCHAR(200) NOT NULL ,
>   `description` VARCHAR(500) NOT NULL ,
>   `visits` BIGINT NOT NULL DEFAULT 0 ,
>   `created` DATETIME NOT NULL ,
>   `modified` DATETIME NOT NULL ,
>   PRIMARY KEY (`id`) ,
>   CONSTRAINT `fk_Links_Users`
>     FOREIGN KEY (`user_id` )
>     REFERENCES `Linked`.`Users` (`id` )
>     ON DELETE NO ACTION
>     ON UPDATE NO ACTION)
> ENGINE = InnoDB;
>
> SHOW WARNINGS;
> CREATE INDEX fk_Links_Users ON `Linked`.`Links` (`user_id` ASC) ;
>
> SHOW WARNINGS;
> CREATE INDEX IDX_Url ON `Linked`.`Links` (`url` ASC) ;
>
> SHOW WARNINGS;
>
> Thanks
> Maxus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to