Hi

I receive from a 3rd party, a CSV of data with a Unique field "code",
which is a varchar of 5 characters or so, e.g. TR34 or XE288

I need to turn this into a table that will work with Cake well, so
lets call it "codes" and then I am not sure what to do about setting a
primary key?

I am thinking I should set it a new (extra field) id, and assign that
Primary Key in MySQL. Assigning UNIQUE Key to code field. Is that best
practise, and for Cake?

(to explain more: I have a table "changes", and it needs to have an
association here - "code" hasMany "changes" so the join is on code_id
as Foreign Key. )

But given that the data is 3rd party, in the future I may well get a
updated CSV with lots of changes to all these codes, and I am unsure
of how I could then merge that in easily into my MySQL database? e.g.
wouldnt this mean lots of queries rather than a simple upload of CSV
data?

I would be very grateful for any help on this, as I'd like to do it
the best way from the start :)

I asked on IRc, but got no response, unfortunately.

thanks in advance

Luke


--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to