RoleGuid and UserGuid

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/12/2008 7:09:06 PM
Gravatar
Total Posts 45

RoleGuid and UserGuid

What are RoleGuid and UserGuid used for in mp_UserRoles table? I'm assuming that RoleID and UserID are the columns that are used for joins.

8/12/2008 7:32:06 PM
Gravatar
Total Posts 18439

Re: RoleGuid and UserGuid

Hi,

The main purpose of the alternate primary keys is to make data migration scenarios possible and avoid integer key clashes. For example if I want to combine data from multiple mojoportal sites into one site the rows will get new integer ids on the way into the db because of the auto increment interger primary key columns, but it will be possible to write queries to re-establish correct relationships by updating parent ids based on the guids.

For other tables there are some differnet reasons for guids as alternate primary keys. I plan to implement a content versioning system for example and many features will be able to keep history of content there and they will join on their guids rather than their integer ids. This enables many tables to join to the contentversion table because no guids will ever clash whereas aut increment integer ids are bound to clash.

Similarly, I plan to implement a comment system, content rating, tagging, etc using these guids so I can implement it once and share it across features. Each feature instance will retrieve its own stuff by its guid.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.