Wednesday, November 3, 2010

Re: How do I map legacy _field_ names to better suited (read Cake-like) ones?

the legacy app will remain. sadly... Changing the schema is out of the
question. also sadly...

On Wed, Nov 3, 2010 at 9:31 PM, cricket <zijn.digital@gmail.com> wrote:
> On Wed, Nov 3, 2010 at 10:01 AM, Enno Weichert
> <enno.weichert@googlemail.com> wrote:
>> As mentioned in my previous post I have a pretty ugly legacy database
>> to work with.
>> Examples: contact_id is contact, contactid, kontakt, kontaktid etc.
>> In one table "ext" is actually the group_id field...
>>
>> I want to map these field names so I won't have to use them anymore in
>> the application except for the model.
>> The problem is I cannot use views on the database (mysql) side so I'll
>> have to do this in the model.
>>
>> However, I cannot wrap my mind around the thing.
>> $_schema seems to get overwritten by whatever is in the table and I
>> cannot see which callback would work so I can do this properly in the
>> model.
>>
>> I cannot believe I'm the first one encountering this problem but I
>> couldn't find anything on the web :-/
>>
>> Mind you: this isn't about table names, foreign keys or primary keys
>> that part was pretty straight forward and worked out pretty well!
>
> I don't know how to answer your specific question but could you change
> the DB schema? I've run into this issue a number of times and simply
> imported the data from the old DB to new. Of course, if there will
> remain legacy code that must interact with the DB this is a
> non-starter.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> 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
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: