Re: Database design question

2011-08-20 Thread WebbedIT
My gut instinct is screaming that you should not be creating multiple tables as that goes against database normalisation and results in duplicate tables, models, controllers and views. Why would a small add not have a value for size, location and user_id? - I would expect by the very fact you're c

Re: Database-Design for making a Comment a parent of another Comment

2011-01-20 Thread Amit Badkas
Hi, I think you need to try Tree behavior, please have a look at http://book.cakephp.org/view/1339/Tree Hope this helps. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Thu, Jan 20, 2011 at 1:14 PM, josef corley wrote: > Howdy. ^^ > > I'm a noob at this so, please bear w

Re: Database Design Question

2010-07-08 Thread duderion
cricket was right :D ty On Jul 8, 9:56 pm, duderion wrote: > hi guys, > > thanks alot for all your help > > i could solve the problem like > this:http://book.cakephp.org/view/851/Multiple-relations-to-the-same-model > > tx alot :D > duderion > > On 6 Jul., 19:42, bladefarm wrote: > > > > > hi p

Re: Database Design Question

2010-07-08 Thread duderion
hi guys, thanks alot for all your help i could solve the problem like this: http://book.cakephp.org/view/851/Multiple-relations-to-the-same-model tx alot :D duderion On 6 Jul., 19:42, bladefarm wrote: > hi pips! > i need ur help. > i'v got 2 models: prospects and programs. > prospects saves re

Re: Database Design Question

2010-07-07 Thread bladefarm
hi pips! i need ur help. i'v got 2 models: prospects and programs. prospects saves records of prospects for one or more programs while programs have records of the different disciplines offered. the prospects model looks like this: create table prospects( ... , ... , program_first_id int(11

Re: Database Design Question

2010-07-06 Thread cricket
On Tue, Jul 6, 2010 at 4:26 AM, dtemes wrote: > I would not use cascade delete on sender_id, once a mail is in your > box it's yours and it can contain important information that should > not be "stolen" from you even if the user that sent it is not there > any more. Good point! Check out the ne

Re: Database Design Question

2010-07-06 Thread dtemes
I would not use cascade delete on sender_id, once a mail is in your box it's yours and it can contain important information that should not be "stolen" from you even if the user that sent it is not there any more. On 5 jul, 20:52, cricket wrote: > On Mon, Jul 5, 2010 at 10:17 AM, duderion wrote:

Re: Database Design Question

2010-07-05 Thread cricket
On Mon, Jul 5, 2010 at 10:17 AM, duderion wrote: > Hi Guys > > i have a question about cake compatible database design: > > i have a table "mails" and a table "users" > > my table mail references 2 users from the users-table as Sender, > Recipient > > but then, i have 2 foreign keys in it, and i d

Re: Database design

2009-11-01 Thread Robert P
John Andersen has it right with the 3 Controller, 4 Model approach. jacmoe almost got there, but saw something shiny and wandered off the path. On Oct 31, 3:50 am, John Andersen wrote: > First of all - I suggest you drop the table_singular_name_id format > for your tables primary key and use the

Re: Database Design Advice Needed - Multiple Companies having Accounting, Production and CRM components

2009-10-31 Thread FrederickD
You have quite an ambitious project. What you are wanting to create is an integrated ERP system. Now you have the individual pieces but want them integrated. Is this system feasible in CakePHP? Absolutely! One database with multiple tables would be fine, IMHO. (Even when developing on a mainframe

Re: Database design

2009-10-30 Thread jacmoe
First: Database names are plural: students, courses, assignments, marks. The models would then be Student, Course, Assignment and Mark. The id of each database should be just 'id'. Because that's what CakePhp likes, and because it's convention to name *foreign keys* like this: tablename_id - s

Re: Database design

2009-10-30 Thread Jonathon Musters
Other thing depending on requirements is this will weight the test scores equally u may have need that if result is only a smaller percent of the course total grade On 10/30/09, John Andersen wrote: > > First of all - I suggest you drop the table_singular_name_id format > for your tables prima

Re: Database design

2009-10-30 Thread John Andersen
First of all - I suggest you drop the table_singular_name_id format for your tables primary key and use the CakePHP expected primary key, which is just named "id" - nothing else! That will make your life easier! Playing with your tables and relationships: Student hasAndBelongsToMay Course - and v

Re: Database design

2009-10-30 Thread Patrick Talmadge
Jack, You will need another table to tie it all together. Something like: Students_Courses student_id course_id assignment_id mark_id I'm new to CakePHP so this might not be the best way to accomplish this via Cake. Patrick On Fri, Oct 30, 2009 at 6:11 AM, japaternoster wrote: > >

Re: Database design

2009-05-28 Thread harpax
Thanks for that hint with the condition. I edited my models accordingly and it works as expected regards, harpax On 27 Mai, 15:27, Martin Westin wrote: > I would choose separate tables for comments, shoutbox and guestbook. > The reason is that one day soon you might come up with an idea to > ex

Re: Database design

2009-05-27 Thread Martin Westin
I would choose separate tables for comments, shoutbox and guestbook. The reason is that one day soon you might come up with an idea to expand the guestbook and then you will curse being locked in with the other models. For flexibility and reuse of code there is nothing stopping you from Creating

Re: Database design

2009-05-27 Thread Eric Silva
First, sorry my bad English... Well, you could have a field "type" that reference the entity that has the commentary. Pattern Single Table. Braindead wrote: > Well, my problem is not directly related to CakePHP, but as it's about > database design maybe I'll get some good answers. > > On my p

Re: Database design

2009-05-27 Thread brightsto...@googlemail.com
we do this with an type column. On May 27, 9:22 am, Braindead wrote: > Well, my problem is not directly related to CakePHP, but as it's about > database design maybe I'll get some good answers. > > On my page I have news, downloads and users. These three can be > commented. Additionally I have a

Re: Database design

2009-05-27 Thread brightsto...@googlemail.com
we do this with an type column. On May 27, 9:22 am, Braindead wrote: > Well, my problem is not directly related to CakePHP, but as it's about > database design maybe I'll get some good answers. > > On my page I have news, downloads and users. These three can be > commented. Additionally I have a

Re: Database design

2009-05-27 Thread harpax
Hello group, I have a similar question: I got 2 models, that are almost identical - the only difference is, that they have a belongsTo field, that is linked to different models. Controllers and views are all the same, so I think to really use two models is not very DRY. The models post_reminder

Re: Database design . Beginner having trouble.

2008-12-13 Thread gearvOsh
If I believe what you are saying, something like this would work (not sure what fields you need): // all the tenants tenants - id - name // all the expenses expenses - id - cost // relating a tenant to an expense = multiple tenants possible on an expense tenantExpenseRelation - id - tenant_id -

Re: Database design for local information specific site

2008-10-02 Thread Gonzalo Servat
On Thu, Oct 2, 2008 at 5:13 PM, ORCC <[EMAIL PROTECTED]> wrote: > [..snip..] > > Id City_Id Property Value > 11 "greeting" "HELLO" > 22 "greeting" "HOLA" > 33 "greeting" "CIAO" > 41 "contact""[EMAIL PROTECTED]" > 52

Re: Database design for local information specific site

2008-10-02 Thread ORCC
I suggest you to: - Create a single table Cities (id,name). For example IdName 1 New York 2 Madrid 3 Roma - Create a single table called Properties (id,city_id, property, value) and place in that table All the properties for each city. For instance: Id City_Id Property Value

Re: Database design

2008-01-27 Thread RichardAtHome
How do you determine if an image is invalid? You may be able to apply this criteria to your SELECT statement without any additional fields. On Jan 27, 2:50 pm, Takuo SHIONO <[EMAIL PROTECTED]> wrote: > Hello, > > If you do not want to keep unnecessary fields for almost 50% of images, > you can u

Re: Database design

2008-01-27 Thread Takuo SHIONO
Hello, If you do not want to keep unnecessary fields for almost 50% of images, you can use image_link table, which contains 3 fields(image_id, next_id, previous_id). You maintain this table in afterSave function only when you edit or add valid images. You can define the HASONE relationship be

Re: Database design

2008-01-27 Thread AD7six
On Jan 27, 11:33 am, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > Hello AD, > > Wont this query be slow? No. > Lets say that i have first valid image at index 1 > and the next one at the index 1000. How would this query perform? SELECT * from images WHERE status = 1 AND id > $thisOne ORDE

Re: Database design

2008-01-27 Thread Novice Programmer
Hello Shiono, When i tried to add the two fields, it seemed like an overhead to me because almost 50% of the images would be invalid, so adding two fields to database design will lead to addition of these fields in these invalid images as well and hence occupy more space in database. I want to avo

Re: Database design

2008-01-27 Thread Novice Programmer
Hello AD, Wont this query be slow? Lets say that i have first valid image at index 1 and the next one at the index 1000. How would this query perform? Thanks. On 1/27/08, AD7six <[EMAIL PROTECTED]> wrote: > > > > > On Jan 26, 8:33 pm, "Novice Programmer" <[EMAIL PROTECTED]> > wrote: > > Though

Re: Database design

2008-01-27 Thread AD7six
On Jan 26, 8:33 pm, "Novice Programmer" <[EMAIL PROTECTED]> wrote: > Though this is less of a database question. but i am still posting it here > since I think we can discuss the design as well.. :). > > I am maintaining a adresses of images stored on my filesystem in a database. > I have design

Re: Database design

2008-01-27 Thread Takuo SHIONO
Hello, I often use solution 1. I think this solution can be applied in almost all cases. However I have another solution. How about this: 1. add 2 fields (prev_valid_index and next_valid_index) in table. 2. update these fields in afterSave function. 3. show image with the next/previous link acc

Re: Database design considerations

2008-01-25 Thread John David Anderson (_psychic_)
On Jan 25, 2008, at 3:11 PM, judouk wrote: > > ///sorry, gmail let me post it first before I'd finished and now > that I've had the time to rethink what I was typing, I think I've > solved my own problem ! > > > CREATE TABLE jobs ( > id int(10) not null auto_increment, > typeofjob varch

RE: database design

2007-07-16 Thread Gould, Adrian
You can use the module code as the PK, but if it has characters in as well, it may provide a few more headaches for you in the end. Personally I stick with ID as it is easier to remember what cake is up to. so [omitting the likes of created and modified and other details): modules (id, title,.

Re: database design

2007-07-15 Thread wralph
I would go with an id field that is an auto-increment and a code field for storing your code numbers. Winston --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to ca

Re: database design advice

2006-08-11 Thread SupaPhreak
Ok an update on this for anybody that cares (if anybody cares ;) ). One mistake I made cakewise was having the join table divisions_dances misnamed it should be dances_divisions (alphebetical order). Dbdesigner had added (and insists that they be there) some ids to the join table that really aren'