Custom Page Type and database table

David Pearson asked on February 25, 2019 21:06

When a custom page type (custom.someitem) is created the corresponding database table (table name custom.someitem) is created, is this correct?

If a page of type custom.someitem is deleted that corresponding record in the database table custom.someitem should have be deleted?

If above is correct, I have a custom table and Page tree out of sync on a website I inherited.

What is the best way to sync those?

I am tempted to create a custom table that uses the existing table so we can delete records not listed in the tree. Then have the customer reenter the records in the tree. This way I can stage the corrections to qa and production. Is there another option?

Correct Answer

Brenden Kehren answered on February 26, 2019 01:40

When creating a custom page type, with a code name of mycustom.pagetype, Kentico will create a cooresponding table of mycustom_pagetype. Custom tables follow the same format depending on what version you're using. Newer versions use this format whereas older versions prepended customtable_ to the code name.

Regarding syncing the two environments, I'd suggest exporting and importing the individual custom table(s) and page types. Be sure when importing the custom table(s) you aren't importing the data.

As a last resort, if you're not able to import them and there are ghost records or ghost tables, you might want to try to manually create either a record stating there is a table there in the cms_class table or get the schema from the other environment and run the create sql on the database missing the table. Again, these are last resort items and require some knowledge of Kentico's structure and SQL.

0 votesVote for this answer Unmark Correct answer

Recent Answers


David Pearson answered on February 26, 2019 16:28

Thanks Brenden for the insight on tables as they relate to Custom Page Types. I will move the data management function to Custom table, then delete the pages. I have the customer well train on editing custom table data now.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.