
CREATE TABLE IF NOT EXISTS db_history (
    version varchar(10) NOT NULL,
    updateJSON mediumtext,
    prevVersion varchar(10) NOT NULL,
    nodeID bigint(20) unsigned DEFAULT NULL,
    prevNodeID bigint(20) unsigned DEFAULT NULL,
    PRIMARY KEY (prevNodeID, nodeID),
    INDEX USING BTREE (version),
    INDEX USING BTREE (prevVersion),
    KEY (nodeID)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS version_history (
    latch VARCHAR(32) NULL,
    origid BIGINT UNSIGNED NULL,
    destid BIGINT UNSIGNED NULL,
    weight DOUBLE NULL,
    seq BIGINT UNSIGNED NULL,
    linkid BIGINT UNSIGNED NULL,
    KEY (latch, origid, destid) USING HASH,
    KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH
  data_table='db_history'
  origid='prevNodeID'
  destid='nodeID';
