Re: Main diference between INT and CHAR (uniqid) primary keys

2012-01-14 Thread euromark
UUIDs need way more "disk space". one might add that speed can also be an issue. having tables with a lot of foreign keys can be slowed down quite a bit, even with indexing. we have a project with uuids and tables with 1 records get really really slow. on the other hand UUIDs are very handy if

Re: Main diference between INT and CHAR (uniqid) primary keys

2012-01-14 Thread jeremyharris
UUIDs are entirely unique while autoincrement ids are unique just for that table. The benefit of UUIDs would be for things like merging tables, merging other data, migrating the data elsewhere, etc. With UUIDs you guarantee there won't be conflicts. It's a matter of preference and depends on y

Main diference between INT and CHAR (uniqid) primary keys

2012-01-14 Thread Thiago Belem
een INT and CHAR (uniqid) primary keys? I know that uniqid keys would be more "safe" since you can't predict the next or another valid ID but, besides that... there's any other diference? Should I use it on every model or just the critical ones, like the Users table? -- Ou

Re: Composite Primary Keys

2011-03-17 Thread Jeremy Burns | Class Outfit
ar 17, 2011, at 17:23, hill180 wrote: > >> From what I have read, I know that Cakephp does not support composite >> primary keys. And later the posts go into tags, but I need a push in the >> right directions. >> >> I have Tickets 1-100 that go out for each da

Re: Composite Primary Keys

2011-03-17 Thread Ryan Schmidt
On Mar 17, 2011, at 17:23, hill180 wrote: > From what I have read, I know that Cakephp does not support composite primary > keys. And later the posts go into tags, but I need a push in the right > directions. > > I have Tickets 1-100 that go out for each day. > > T

Composite Primary Keys

2011-03-17 Thread hill180
>From what I have read, I know that Cakephp does not support composite primary >keys. And later the posts go into tags, but I need a push in the right >directions. I have Tickets 1-100 that go out for each day. The user buys a ticket for a day and the system will process the pa

Model Associations on legacy tables with no primary keys

2009-09-28 Thread reesylou
of it is because the tables have no primary keys defined, and part because the foreign keys are a little odd. Currently, my models are as follows: PHP Code array ( foreignKey => false, conditions => array (’ScheduledDate.mode

char primary keys and HABTM saves

2009-09-09 Thread hellfish
Hi, Does anyone know if cake core has any problems saving HABTM tables using text keys instead of numeric? I have and edit method in a controller that is supposed to save data to it's main table and 3 HABTM. Two of them work just as expected, first removing all of the rows in the table and then

Composite Primary Keys

2008-09-18 Thread Germano
I work in a company with a legacy database designed using relations with composite primary keys and change the database is not an option... Cake does not support an array of keys by default to set model`s $primaryKey. Is there any plugin or update in sight

Re: Postgres + cake bake model + primary keys = trouble in test fixtures

2008-09-02 Thread jpt2
On Sep 2, 7:58 am, jpt2 <[EMAIL PROTECTED]> wrote: > > The 'indexes' part looked a bit suspicious but I ran the test anyway > athttp://forcetrak.dev/app/webroot/test.php?case=models%5Crank.test.php... > and got this: > Note that the URL I mention here is local only, and not internet accessible..

Postgres + cake bake model + primary keys = trouble in test fixtures

2008-09-02 Thread jpt2
Currently using cake_1.2.0.7296-rc2 and postgres 8.2.5 I have a table that looks like this: CREATE TABLE ranks ( id serial NOT NULL, code character varying(1) NOT NULL, description character varying(15) NOT NULL, CONSTRAINT ranks_pkey PRIMARY KEY (id) ) WITH (OIDS=FALSE); ALTER TABLE ran

Re: newbie how to update a row with 2 primary keys

2008-04-18 Thread .
nvm. i got it thx On Fri, Apr 18, 2008 at 2:16 AM, . <[EMAIL PROTECTED]> wrote: > for habtm tables in general, how would you handle updates? or deletes? > > > On Thu, Apr 17, 2008 at 7:47 AM, Baz <[EMAIL PROTECTED]> wrote: > > > > > But wait... > > > > isn't food_categories with only 2 columns a

Re: newbie how to update a row with 2 primary keys

2008-04-18 Thread .
for habtm tables in general, how would you handle updates? or deletes? On Thu, Apr 17, 2008 at 7:47 AM, Baz <[EMAIL PROTECTED]> wrote: > > But wait... > > isn't food_categories with only 2 columns a HABTM table? > > Am I missing something here? > > > > --~--~-~--~~~--

Re: newbie how to update a row with 2 primary keys

2008-04-17 Thread Baz
But wait... isn't food_categories with only 2 columns a HABTM table? Am I missing something here? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@goog

Re: newbie how to update a row with 2 primary keys

2008-04-17 Thread grigri
CakePHP does not support composite primary keys. This has been discussed at length. Just add an auto-incrementing column to your table and make that the primary key [ change your primary key index to a unique index first ]. > How do I delete a row? I cannot seem to do $this->FoodCategor

Re: newbie how to update a row with 2 primary keys

2008-04-17 Thread Adam Royle
do $this->FoodCategory->del($id) > > On Wed, Apr 16, 2008 at 2:33 PM, Baz <[EMAIL PROTECTED]> wrote: > > I don't follow. > > > This table (if we're talking about Cake standards and conventions) is a > > HABTM table. You don't update this manual

Re: newbie how to update a row with 2 primary keys

2008-04-17 Thread .
llow. > > This table (if we're talking about Cake standards and conventions) is a > HABTM table. You don't update this manually. Also, these tables don't have > primary keys. > > You would rather change the associated Models. So do a read on your Food > table

Re: newbie how to update a row with 2 primary keys

2008-04-16 Thread Baz
I don't follow. This table (if we're talking about Cake standards and conventions) is a HABTM table. You don't update this manually. Also, these tables don't have primary keys. You would rather change the associated Models. So do a read on your Food table for food_

newbie how to update a row with 2 primary keys

2008-04-16 Thread .
I have a table foods_categories with columns: food_id and category_id (the primary keys are food_id and category_id) Let's say I insert the values (1,2) into this table. Let's say I want to update the row to (1,3). How would I update this row? Normally, if I implement the table with t

Re: Help With Using 2 Primary Keys

2008-03-07 Thread Darren884
Hi is this the correct way to relate data like this? I switched them around and it still doesn't work the way I need it to. On Mar 7, 8:19 pm, Walker Hamilton <[EMAIL PROTECTED]> wrote: > you need to read this: > > http://book.cakephp.org(especially the models part). > > Your belongsTo and hasOne

Re: Help With Using 2 Primary Keys

2008-03-07 Thread Walker Hamilton
you need to read this: http://book.cakephp.org (especially the models part). Your belongsTo and hasOne forum keys are wrong. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, s

Help With Using 2 Primary Keys

2008-03-07 Thread Darren884
I have a Thread modeal with associated models ForumUser and ForumCategory: var $hasOne = array('ForumUser' => array('className' => 'ForumUser', 'conditions' => '', 'order' => '',

Re: Primary Keys

2008-02-15 Thread villas
It seems like the idea of having more meaningful primary keys doesn't have any obstacles. I'll continue with that. Thanks everyone! On Feb 15, 9:12 pm, nate <[EMAIL PROTECTED]> wrote: > You can use any kind ofprimarykey you want, so long as it doesn't > include more

Re: Primary Keys

2008-02-15 Thread nate
ained on a trigger. > > That's an idea that I hadn't considered. > > However, I'd only consider this route if someone confirms that my user- > friendly primary keys are not recommended in Cake for some reason. --~--~-~--~~~---~--~~ You

Re: Primary Keys

2008-02-15 Thread Adam Royle
gger. > > That's an idea that I hadn't considered. > > However, I'd only consider this route if someone confirms that my user- > friendly primary keys are not recommended in Cake for some reason. --~--~-~--~~~---~--~~ You received this message b

Re: Primary Keys

2008-02-15 Thread villas
> You could set up a "shadow" field in the table to store the human > readable form of theprimarykey, maintained on a trigger. That's an idea that I hadn't considered. However, I'd only consider this route if someone confirms that my user- friendly primary keys

Re: Primary Keys

2008-02-15 Thread duncan_m
You could set up a "shadow" field in the table to store the human readable form of the primary key, maintained on a trigger. Your users get their pretty field values and don't need to join and cakePHP still happily works with its expected "id" integer field..? Dunc. --~--~-~--~~-

Re: Primary Keys

2008-02-15 Thread Dardo Sordi Bogado
unenlightened. Hence my desire for primary keys > which are meaningful. > > From your answer it seems that Cake would have no problem with my > idea. One of my doubts was whether anyone would propose the > following: > >

Re: Primary Keys

2008-02-15 Thread Adam Royle
ly straightforward to anyone knowing SQL, it can be quite tricky > for those who are unenlightened. Hence my desire for primary keys > which are meaningful. > > From your answer it seems that Cake would have no problem with my > idea. One of my doubts was whether anyone would propose the

Re: Primary Keys

2008-02-15 Thread villas
unenlightened. Hence my desire for primary keys which are meaningful. >From your answer it seems that Cake would have no problem with my idea. One of my doubts was whether anyone would propose the following: Contacts idLastnameContacttype_

Re: Primary Keys

2008-02-14 Thread Baz
't. But regardless of what your app. can and cannot do, this is not a CakePHP specific problem. As far as I am aware, your primary keys can be anything of your choosing. Obvious, if it's not auto-incrementing then you are personally going to have to manage how they get set when you add Cont

Primary Keys

2008-02-14 Thread villas
I notice that everyone using Cake seems to use autoincrementing integer primary keys. However this means you always have to join the code files for all queries and reports because the keys don't mean anything (unless you can memorize lots of numbers). In the past I have successfully used

Re: Composite Primary Keys

2007-11-09 Thread Martin Schapendonk
On 11/9/07, Mr-Yellow <[EMAIL PROTECTED]> wrote: > Nice to know I just spent months designing a massive properly > normalised and indexed database. > Only to findout Cake doesn't support properly designed databases. After designing the theoretical correct model, I always thought there was an addi

RE: Composite Primary Keys

2007-11-08 Thread Gould, Adrian
Ben From an academic standpoint [and yes best practice DB design] the us of composite FKs to create a PK is common. Many of my designs in the past used that idea, but with the introduction of so many QaD [Quick and Dirty] methods [aka Rapid Application Development] sometimes the best practic

Re: Composite Primary Keys

2007-11-08 Thread Mr-Yellow
Oh just to let you know. Yes I do know what a Unique Index is. We don't really need fanboys to come yell at us that it's 2007. The year doesn't change the fact that doing stuff on the DB engine is safer then in your software. Validation is still very important, but a properly setup database is be

Composite Primary Keys

2007-11-08 Thread Mr-Yellow
YaY!!! Nice to know I just spent months designing a massive properly normalised and indexed database. Only to findout Cake doesn't support properly designed databases. Lock this thread too, just to make sure discussion of their benefit is quashed and discovery of the feature hole is less obvious

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-11 Thread Albert Siersema
y changing any of the cake core code, but maybe inheriting something and overloading. But that seems pretty tough going. Also I feel my passing of array() keys had to be changed to something more intuitive (then again, cake makes extensive use of arrays). Might be we could abstract (primary) keys

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-10 Thread nate
The patches seem like they would work just fine, but that's just me looking at them, not having tested them. I'll take it on faith that they're well tested. However, if you search the Cake core for 'primaryKey,' you'll find that it is used in many other places, and IMO changing them all would be

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-10 Thread Albert Siersema
> In developing Cake, we've chosen to adhere to certain conventions in > order to keep things simple. That's what makes Cake work. The > decision not to allow the use of mutli-column primary keys is > reflective of the opinions inherent to the framework. Aha, that sound

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-10 Thread nate
complex SQL. In developing Cake, we've chosen to adhere to certain conventions in order to keep things simple. That's what makes Cake work. The decision not to allow the use of mutli-column primary keys is reflective of the opinions inherent to the framework. The rest of Josh's bulle

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-10 Thread loonatic
> Here's a bit of discussion that took place here a few weeks ago... >http://groups.google.com/group/cake-php/browse_thread/thread/d2bf4bb245201cb/015f0feefd9ff482?lnk=gst&q=composite&rnum=1#015f0feefd9ff482 Thats not really a discussion. "And Tony Marston is the last person I would be reading f

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-10 Thread Albert Siersema
(first off: this isn't meant as criticism or a way for me to point out there are shortcomings in the cakephp (RoR/ORM/... ) way, it's more of a 'live, discuss & learn' conversation for me) > Well, the first one was quite interesting in the way it condemned the >

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-09 Thread nate
Well, the first one was quite interesting in the way it condemned the use of primary keys altogether. I think it's way off base, but still interesting. The bottom line for me is that (a) it introduces needless complexity into the system, and (b) not only does the practice of using join

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-09 Thread Albert Siersema
nate wrote: > You're not out of luck, you just need to add a primary key. The reason > for this is that composite primary keys are a monumentally *bad* idea. Why exactly are they a bad idea ? They're used in many (serious) rdbms designs and are automatically constrained (which

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-09 Thread Brandon
Here's a bit of discussion that took place here a few weeks ago... http://groups.google.com/group/cake-php/browse_thread/thread/d2bf4bb245201cb/015f0feefd9ff482?lnk=gst&q=composite&rnum=1#015f0feefd9ff482 --~--~-~--~~~---~--~~ You received this message because you

Re: multi-column primary keys (like in lots of join tables/habtm)

2006-08-09 Thread nate
You're not out of luck, you just need to add a primary key. The reason for this is that composite primary keys are a monumentally *bad* idea. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP&

multi-column primary keys (like in lots of join tables/habtm)

2006-08-09 Thread Albert Siersema
It seems this one pops up almost as frequently as HABTM questions. If you've got a rdbms design where a join table looks likes this: CREATE TABLE authors_posts ( author_id INTEGER REFERENCES authors(id) ON DELETE CASCADE, post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE, type