Hi
i make an N:N Relation, which shows, wich Courses (like modules) are available in different Workshops. Currently, i have 2 Courses (30,31) in Workshop 4. Whenn i press the update / save button without changing any values, scriptcase do the following:
(pdo-mysql): delete from CourseWorkshopLnk where WorkshopId = 4
(pdo-mysql): insert into CourseWorkshopLnk (id, CourseId, WorkshopId) values (NULL, '31', 4)
(pdo-mysql): insert into CourseWorkshopLnk (id, CourseId, WorkshopId) values (NULL, '30', 4)
It delete’s EVERY record in the “middle” table and then insert every record again.
BUT i have other relations to this “middle” table. If a Course is available in a workshop, i have a table with course details, which describes the Room Number and Time for the specific Course in the workshop. Means, i have a Detailstable which has a relation to the id of CourseWorkshopLnk. So long, so good. But when scriptcase everytime delete and reinsert the records, my relation get lost. Why? How can i prevent scriptcase delete existing relations.
YES, of course, when the user removes a Course from the workshop, the details like time and place can also deleted. I defined this in the relation (ON DELETE => CASCADE).
I think this is a bug in scriptcase. Scriptcase should only delete or update things in the middle table when things changed.
Or what other’s think about that?
Best regards
Steve