public function createOrUpdateTable($class)
{
$classId = $class->getId();
$table = "object_metadata_" . $classId;
$this->db->query("CREATE TABLE IF NOT EXISTS `" . $table . "` (\n `o_id` int(11) NOT NULL default '0',\n `dest_id` int(11) NOT NULL default '0',\n\t `type` VARCHAR(50) NOT NULL DEFAULT '',\n `fieldname` varchar(71) NOT NULL,\n `column` varchar(190) NOT NULL,\n `data` text,\n `ownertype` ENUM('object','fieldcollection','localizedfield','objectbrick') NOT NULL DEFAULT 'object',\n `ownername` VARCHAR(70) NOT NULL DEFAULT '',\n `position` VARCHAR(70) NOT NULL DEFAULT '0',\n PRIMARY KEY (`o_id`, `dest_id`, `type`, `fieldname`, `column`, `ownertype`, `ownername`, `position`),\n INDEX `o_id` (`o_id`),\n INDEX `dest_id` (`dest_id`),\n INDEX `fieldname` (`fieldname`),\n INDEX `column` (`column`),\n INDEX `ownertype` (`ownertype`),\n INDEX `ownername` (`ownername`),\n INDEX `position` (`position`)\n\t\t) DEFAULT CHARSET=utf8mb4;");
}