CREATE TABLE {$NAMESPACE}_semistructured.semistructured_objectinstance (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
  phid VARBINARY(64) NOT NULL,
  dateCreated INT UNSIGNED NOT NULL,
  dateModified INT UNSIGNED NOT NULL,

  classPHID VARBINARY(64) NOT NULL,
  name VARCHAR(255) NOT NULL COLLATE {$COLLATE_SORT},
  description LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT},
  status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT},
  rawData LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT},

  UNIQUE KEY `key_phid` (phid),
  KEY `classPHID` (classPHID)
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};

CREATE TABLE {$NAMESPACE}_semistructured.semistructured_objectinstancetransaction
  LIKE {$NAMESPACE}_file.file_transaction;
CREATE TABLE {$NAMESPACE}_semistructured.semistructured_objectinstancetransaction_comment
  LIKE {$NAMESPACE}_file.file_transaction_comment;
