Friday 28 June 2013

How to edit "System Tables" in Kentico Site Manager

Kentico provides a good solution to manage system table schemas, views and stored procedures. There is an interface under the Development tab in the System tables section. I always add custom fields to the User tables through this interface to collect more member information.


Unfortunately, it seems not all system tables are on the list. if you cannot find the system table on the list, there is a little trick you can do. Go to database and open the cms_class table. Find the class of the table you want to show and then update the field ClassShowAsSystemTable to 1. I take DiscountCoupon table as an example

UPDATE CMS_Class
SET ClassShowAsSystemTable = 1
WHERE ClassName = 'ecommerce.discountcoupon'

Now, you can find Ecommerce - Discount coupon table is on the list now. Bravo!!


Usually, you can find the corresponding provider class to set or get the new field data in the API. For example,
DiscountCouponInfoProvider.Get("fieldname");
DiscountCouponInfoProvider.Set("fieldname", "fieldvalue");
UserInfoProvider.Get("fieldname");
UserInfoProvider.Set("fieldname", "fieldvalue")

Once you add or update fields in system tables, you can publish the changes to other Kentico instances through content staging. This makes deployment much easier! Unfortunately, content staging does not support views and stored procedures yet. Hopefully, they would be supported in the future! :)