Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Best Practices: Table/Stored Procedure locationBest Practices: Table/Stored Procedure location
Previous
 
Next
New Post
2/24/2011 4:41 PM
 
When you create a module, do you put the tables and procedures in the DNN database, or do you put it in your own separate database?

If you put it in the DNN database(not modifying DNN tables/procs), will this affect future upgrades?

Thanks
 
New Post
2/24/2011 11:00 PM
 
In almost all cases a module developer will install a custom module's tables, stored procedures and other database objects in the DNN database. Proper attention to object naming is important. In addition to supporting the {databaseOwner} and {objectQualifier} tokens in your module's SQL scripts, you should prefix all custom database object names with characters unique to your company and particular module. For example, I would use WESNet_EventAThon_Events for a custom table and WESNet_EventAThon_Events_GetAll for a stored procedure rather than Events and GetAllEvents respectively to avoid (as much as possible) conflicts with core and other third party objects. If you are making use of ModuleSettings and TabModuleSettings, please use similar naming conventions for settings keys.

Also, be very wary of creating foreign key relationships between columns of your custom tables and core tables. A FK constraint on the DNN Modules table ModuleID column is unfortunately a requirement that's hard to avoid but a FK constraint on the DNN Users table UserID column is considered a bad practice and is expected to cause problems with forthcoming upgrades to soft-deleted user management.

Another evil to avoid is direct manipulation of core table data in SQL stored procedures. This was especially driven home to developers who had directly accessed the ModuleTitle column of the core Modules table. That column was moved to the TabModules table in DNN 5.5.0 causing several well known modules to break - I must admit that I was one of the guilty developers in my Forge ePrayer project. Access to core data should be only made through the public API's which are much less likely to see breaking changes than the database schema.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/24/2011 11:04 PM
 
It is very common for module developers to use the same database. Just make sure you prefix your database objects with a unique name. For example, create a table called "mymodule_Posts" instead of just "Posts". The same should apply to stored procedures, views, functions, indexes and keys.

Will Morgenweck
VP, Product Management
DotNetNuke Corp.
 
New Post
2/25/2011 9:12 AM
 
Thanks Wes. That was an excellent explanation.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Best Practices: Table/Stored Procedure locationBest Practices: Table/Stored Procedure location


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out