I am developing a module for integrating an open source ajax chat into EE. For this purpose I want to rely on the EE authorization system to log users into the chat and define their access rights. To accomplish this, I need three additional tables, one that assigns a predefined role to each registered user, a table containing a list of chat rooms, and a table that defines who has access to which room.
Now, implementing the tables is easy enough, but I ran into a problem: the exp_member table in EE relies on the MyISAM engine. This means that I can’t use foreign keys in my table to define a relationship between users and roles (this is only possible with the innoDB engine). This also means that I can’t ensure consistency in my new tables when users are removed from the exp_members table.
I could write a small extension that on removing a user in EE also removes the entries for that user in the chat tables, but then I would have to deal with an extention AND a module.
I could also write a cron job to execute a periodical integrity check and remove users from the chat tables that have been removed from the exp_members table.
Neither approach is particularly attractive to me, so I am wondering:
is it possible to implement the extention as part of the chat module? Are there any other ways to ensure the integrity of the chat tables?
Thank you for your help,
Franco
Ok, that’s interesting, thank you.
So how does EE ensure consistency across tables, if it doesn’t rely on innoDB? My understanding is that MyISAM tables don’t support foreign keys, so it may be difficult to make sure that related tables don’t get out to sync. Or is there some other way to achieve consistency in MySQL without relying on foreign key?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.