If while upgrading SocialEngine, you receive an error with a message similar to the following:
"Core (4.x.x) Query failed with error: Mysqli statement execute error : Unknown column 'levels' in 'engine4_core_pages"
a query from the version 4.0.5 upgrade script was not executed correctly and will need to be executed manually. Before making any changes to your SocialEngine database it's strongly suggested that you make a backup of your database.
Using a database management tool like phpMyAdmin,connect to your SocialEngine database and run the following SQL query to create the missing column:
ALTER TABLE `engine4_core_pages` ADD COLUMN `levels` text default NULL AFTER `layout` ;