views:

18

answers:

1

Hi, Got a question about Entity Framework and MyIsam tables.

My production database consists of MyIsam tables only. Often with a primary key like UserId and then a secondary KeyId that is auto incrementary.

Since secondary auto incremantary keys are not allowed in InnoDb, and there will be ALOT of work to get rid of them before converting, I'm thinking about using MyIsam tables with Entity Framework instead.

The question is, how do I set up this? With no foreign keys there will be no relationships when adding the tables to the EF model. I've tried adding the associations manually but always with some errors. Is this even possible when using a secondary auto increment key?

I would be very grateful if someone could try helping me.

Thanks

/Andreas

A: 

Apparantly this wasn't hard at all. I think i misunderstood how to use referential constraints. Anyway, for future reference and people finding this question:

Just add an association between the entities and then add a referential constraint using the desired entity keys, without even thinking about the secondary auto increment key. It all works out anyway..

Andreas