I don't know what your application is like, but I generally recommend
keeping your old table structure in tact as much as you can as to not
break application functionality.  If the old ID field was never referenced
from within your application, then this might not be a problem.  But to
avoid major code re-writes, I suggest keeping the old ID field for
pre-existing records and relying on the new primary key ID field for new
ones -- at least until you decide to change all necessary application
functionality to reference the new ID.

--
Steve - Web Applications Developer
http://www.sdwebsystems.com


On Tue, May 9, 2006 12:47 pm, [EMAIL PROTECTED] said:
> Yup! Got it..
>
> Thanks guys, to all of you, for REALLY fast help!
> :)
>
> -afan
>
>
>
>
>> Yeah, pretty much, but I would keep cust_id around and start over with a
>> true autoincrement from 1.
>>
>> On 5/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>>>
>>> and this would be, in other words, the solution 2, right?
>>>
>>>
>>>
>>> > If you really want to change the customer ID, then you can always
>>> copy
>>> the
>>> > entire table to another table with a primary key set.  Then simply
>>> > reference that primary key field and forget the prior one.
>>> >
>>> > --
>>> > Steve - Web Applications Developer
>>> > http://www.sdwebsystems.com
>>> >
>>> >
>>> > On Tue, May 9, 2006 9:33 am, [EMAIL PROTECTED] said:
>>> >> hi to all,
>>> >> I have to redo a web site of one company and the structure of the
>>> >> current
>>> >> db is a little mess.
>>> >> one of them is customer id number. right now, customer table use as
>>> >> primary key cust_id column varchar(50) PRIMARY KEY (no auto
>>> increment).
>>> >> I
>>> >> really have no idea why previous developer made cust_id with letter
>>> C
>>> on
>>> >> the beggining of a number, and the number is made from date,
>>> (mdyHis)
>>> >> ?!?!
>>> >>
>>> >> What do you suggest to do:
>>> >> 1. take off letter C and keep the numbers, change cust_id to integer
>>> NOT
>>> >> NULL, add one customer with number 20000000 and then apply
>>> >> auto_increment?
>>> >> 2. replace current Cxxxxxxxxxx with INT numbers and replace the
>>> cust_id
>>> >> in
>>> >> every other table where cust_id is foreign key?
>>> >> 3. something else?
>>> >>
>>> >> Thanks for any help!
>>> >>
>>> >> -afan


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to