Adding columns to post tables and changing code

rated by 0 users
This post has 3 Replies | 2 Followers

Alex Gadea
Not Ranked
Posts 21
Points 270
By: Alex Gadea
Posted: Thu, Aug 30 2007 5:29 AM

I need to add several new columns to the post tables to handle some of our site specifics.  I am assuming this will require code changes if I am to both display the new columns and make them searchable (I'd like them to be queryable through the SearchQuery object).  What objects do I need to focus on in order to make this change?  What are the community's best practices when making such a change? 

 Thanks,

Alex

 
  • Post Points: 20 |
afscrome
Top 10 Contributor
Posts 2,705
Points 39,825
TelligentSupportTeam
By: afscrome
Posted: Thu, Aug 30 2007 5:52 PM In reply to

Have a look at extended attributres - these requrie no changes to the database and you can effectively make custom columns.  For example, if you have a look at the database, you'll see there are no columns for any of the video settings for forum posts (e.g. VideoURL, Video ImageURL).  If you look in the source code, (Posts.cs, line 286 onwards for 2007 SP2 SDK), you'll see that they are set through extended attributes. 

 
  • Post Points: 20 |
Alex Gadea
Not Ranked
Posts 21
Points 270
By: Alex Gadea
Posted: Thu, Aug 30 2007 7:16 PM In reply to

My main concern is how performant this solution will be for a large system (our beta blog already has 300 posts in one week).  Without indexing in the database, extended attributes are unusable if they need to be constantly searched which our extended columns will need to be. I am planning to use extended attributes in other parts of the system but really need to know what to modify for values that need to have their own columns in the db.

Thanks,

Alex

 
  • Post Points: 20 |
afscrome
Top 10 Contributor
Posts 2,705
Points 39,825
TelligentSupportTeam
By: afscrome
Posted: Fri, Aug 31 2007 2:54 AM In reply to

If you have a look in your current posts table, you should see that a lot of the posts (forum posts & blog posts) all use extended attributes.  If you're worried about the performance, CS has a very strong Caching API which you could also have a look at.

 
  • Post Points: 5 |
Page 1 of 1 (4 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com