Thursday, April 2, 2009

Re: New to CakepHp.. question

This is a very very very bad design decision. User data != internal
system data. Use another column for your "serial", and leave User.id
to cake.

BUT, if you really have to use it as a primary key, you could try
leaving it named serial_number or whatever and customizing your model
to use that field as primary key, but I'm not sure how this will work.

On Apr 2, 9:48 am, vanushv <van...@gmail.com> wrote:
> The serial will be entered manually by an operator
>
> On Apr 2, 5:15 pm, John Andersen <j.andersen...@gmail.com> wrote:
>
> > My question is, when are you going to enter the user serial?
> > Is it done manually by you or can it be done automatically?
> > If automatically, then ensure that you have the new user serial
> > available when a user is being registered!
> > Enjoy,
> >    John
>
> > On Apr 2, 8:17 am, vanushv <van...@gmail.com> wrote:
>
> > > Hey i'm trying set up a fairly simple webapp and so far I've used the
> > > bake script and it worked pretty good to establish a base for me
>
> > > In my database there is a table of users; each user has a serial
> > > number. i want the serial number to be a primary key -> so i renamed
> > > the serial column to 'id'. But.. when Adding new users I want to be
> > > able to enter the user serial (id). When i set everything up with bake
> > > and tried to add a new user it failed because the primary key (id) is
> > > empty - (i didn't set an auto_increment on it).
>
> > > Anyone have any ideas?
>
> > > VaNuSh
--~--~---------~--~----~------------~-------~--~----~
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: