Sunday, July 31, 2011

newbie question about weird legacy database schema

here's the current schema of my database

/* First, create our thread table: */
CREATE TABLE thread (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
dat_id INT,
title VARCHAR(50),
body TEXT,
created DATETIME DEFAULT NULL,
modified DATETIME DEFAULT NULL
);

CREATE TABLE dat_001 (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
thread_id INT,
title VARCHAR(50),
body TEXT,
created DATETIME DEFAULT NULL,
modified DATETIME DEFAULT NULL
);

CREATE TABLE dat_002 (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
thread_id INT,
title VARCHAR(50),
body TEXT,
created DATETIME DEFAULT NULL,
modified DATETIME DEFAULT NULL
);

and so on


I know that this is not exactly how the cakephp database would be but
i am a newbie at this and i would like to know
how do i code this kinda relationship on cakephp. how do I do 1 to
many relationship in cakephp.
I know i can do this in codeigniter and that's what i used to use but
I have to start workin on cakephp and i have found it to be quite good
but run into this kinda problem
so if anyone can help guide me toward to right way of doing this
please let me know.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


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

No comments: