diff --git a/resources/sql/quickstart.sql b/resources/sql/quickstart.sql index bf8f115841..afe0b33d01 100644 --- a/resources/sql/quickstart.sql +++ b/resources/sql/quickstart.sql @@ -1,5 +1,4 @@ -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_audit` DEFAULT CHARACTER SET utf8; - +CREATE DATABASE `{$NAMESPACE}_audit` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_audit`; CREATE TABLE `audit_comment` ( @@ -16,6 +15,7 @@ CREATE TABLE `audit_comment` ( KEY `targetPHID` (`targetPHID`,`actorPHID`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `audit_inlinecomment` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -34,8 +34,50 @@ CREATE TABLE `audit_inlinecomment` ( KEY `authorPHID` (`authorPHID`,`commitPHID`,`auditCommentID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_chatlog` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_cache` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_cache`; + +CREATE TABLE `cache_general` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `cacheKeyHash` char(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `cacheKey` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `cacheFormat` varchar(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `cacheData` longblob NOT NULL, + `cacheCreated` int(10) unsigned NOT NULL, + `cacheExpires` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_cacheKeyHash` (`cacheKeyHash`), + KEY `key_cacheCreated` (`cacheCreated`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `cache_markupcache` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `cacheKey` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `cacheData` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `metadata` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `cacheKey` (`cacheKey`), + KEY `dateCreated` (`dateCreated`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_calendar` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_calendar`; + +CREATE TABLE `calendar_holiday` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `day` date NOT NULL, + `name` varchar(50) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `day` (`day`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_chatlog` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_chatlog`; CREATE TABLE `chatlog_event` ( @@ -50,8 +92,8 @@ CREATE TABLE `chatlog_event` ( KEY `channel` (`channel`,`epoch`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_conduit` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_conduit` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_conduit`; CREATE TABLE `conduit_certificatetoken` ( @@ -65,6 +107,7 @@ CREATE TABLE `conduit_certificatetoken` ( UNIQUE KEY `token` (`token`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `conduit_connectionlog` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `client` varchar(255) DEFAULT NULL, @@ -76,6 +119,7 @@ CREATE TABLE `conduit_connectionlog` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `conduit_methodcalllog` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `connectionID` bigint(20) unsigned DEFAULT NULL, @@ -87,8 +131,47 @@ CREATE TABLE `conduit_methodcalllog` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_countdown` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_config` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_config`; + +CREATE TABLE `config_entry` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `namespace` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `configKey` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `value` longtext NOT NULL, + `isDeleted` tinyint(1) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_phid` (`phid`), + UNIQUE KEY `key_name` (`namespace`,`configKey`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `config_transaction` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `editPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commentPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `commentVersion` int(10) unsigned NOT NULL, + `transactionType` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `oldValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `newValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `contentSource` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_phid` (`phid`), + KEY `key_object` (`objectPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_countdown` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_countdown`; CREATE TABLE `countdown_timer` ( @@ -101,8 +184,8 @@ CREATE TABLE `countdown_timer` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_daemon` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_daemon` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_daemon`; CREATE TABLE `daemon_log` ( @@ -113,9 +196,12 @@ CREATE TABLE `daemon_log` ( `argv` varchar(512) NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) + `status` varchar(8) NOT NULL, + PRIMARY KEY (`id`), + KEY `status` (`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `daemon_logevent` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `logID` int(10) unsigned NOT NULL, @@ -126,8 +212,8 @@ CREATE TABLE `daemon_logevent` ( KEY `logID` (`logID`,`epoch`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_differential` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_differential` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_differential`; CREATE TABLE `differential_affectedpath` ( @@ -139,6 +225,7 @@ CREATE TABLE `differential_affectedpath` ( KEY `revisionID` (`revisionID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_auxiliaryfield` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `revisionPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -151,6 +238,7 @@ CREATE TABLE `differential_auxiliaryfield` ( KEY `name` (`name`,`value`(64)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_changeset` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `diffID` int(10) unsigned NOT NULL, @@ -170,6 +258,7 @@ CREATE TABLE `differential_changeset` ( KEY `diffID` (`diffID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_changeset_parse_cache` ( `id` int(10) unsigned NOT NULL, `cache` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -178,6 +267,7 @@ CREATE TABLE `differential_changeset_parse_cache` ( KEY `dateCreated` (`dateCreated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_comment` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `revisionID` int(10) unsigned NOT NULL, @@ -193,6 +283,7 @@ CREATE TABLE `differential_comment` ( KEY `revisionID` (`revisionID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_commit` ( `revisionID` int(10) unsigned NOT NULL, `commitPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -200,6 +291,7 @@ CREATE TABLE `differential_commit` ( UNIQUE KEY `commitPHID` (`commitPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_diff` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `revisionID` int(10) unsigned DEFAULT NULL, @@ -213,6 +305,7 @@ CREATE TABLE `differential_diff` ( `unitStatus` int(10) unsigned NOT NULL, `lineCount` int(10) unsigned NOT NULL, `branch` varchar(255) DEFAULT NULL, + `bookmark` varchar(255) DEFAULT NULL, `parentRevisionID` int(10) unsigned DEFAULT NULL, `arcanistProjectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `creationMethod` varchar(255) DEFAULT NULL, @@ -224,6 +317,7 @@ CREATE TABLE `differential_diff` ( KEY `revisionID` (`revisionID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_diffproperty` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `diffID` int(10) unsigned NOT NULL, @@ -235,6 +329,7 @@ CREATE TABLE `differential_diffproperty` ( UNIQUE KEY `diffID` (`diffID`,`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_hunk` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `changesetID` int(10) unsigned NOT NULL, @@ -249,6 +344,7 @@ CREATE TABLE `differential_hunk` ( KEY `changesetID` (`changesetID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_inlinecomment` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `revisionID` int(10) unsigned NOT NULL, @@ -268,6 +364,7 @@ CREATE TABLE `differential_inlinecomment` ( KEY `revisionID` (`revisionID`,`authorPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_relationship` ( `revisionID` int(10) unsigned NOT NULL, `relation` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -278,9 +375,11 @@ CREATE TABLE `differential_relationship` ( KEY `objectPHID` (`objectPHID`,`relation`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_revision` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(255) NOT NULL, + `originalTitle` varchar(255) NOT NULL, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `status` varchar(32) NOT NULL, `summary` longtext NOT NULL, @@ -301,6 +400,7 @@ CREATE TABLE `differential_revision` ( KEY `authorPHID` (`authorPHID`,`status`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `differential_revisionhash` ( `revisionID` int(10) unsigned NOT NULL, `type` char(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -309,9 +409,10 @@ CREATE TABLE `differential_revisionhash` ( KEY `revisionID` (`revisionID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edge` ( `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `seq` int(10) unsigned NOT NULL, @@ -320,6 +421,7 @@ CREATE TABLE `edge` ( KEY `src` (`src`,`type`,`dateCreated`,`seq`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edgedata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -327,8 +429,7 @@ CREATE TABLE `edgedata` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_draft` DEFAULT CHARACTER SET utf8; - +CREATE DATABASE `{$NAMESPACE}_draft` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_draft`; CREATE TABLE `draft` ( @@ -336,14 +437,15 @@ CREATE TABLE `draft` ( `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `draftKey` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `draft` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `metadata` longtext, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `authorPHID` (`authorPHID`,`draftKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_drydock` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_drydock` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_drydock`; CREATE TABLE `drydock_lease` ( @@ -356,10 +458,13 @@ CREATE TABLE `drydock_lease` ( `attributes` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, + `taskID` int(10) unsigned DEFAULT NULL, + `resourceType` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `phid` (`phid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `drydock_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `resourceID` int(10) unsigned DEFAULT NULL, @@ -372,6 +477,7 @@ CREATE TABLE `drydock_log` ( KEY `epoch` (`epoch`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `drydock_resource` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -388,8 +494,46 @@ CREATE TABLE `drydock_resource` ( UNIQUE KEY `phid` (`phid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_feed` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_fact` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_fact`; + +CREATE TABLE `fact_aggregate` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `factType` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `valueX` bigint(20) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `factType` (`factType`,`objectPHID`), + KEY `factType_2` (`factType`,`valueX`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `fact_cursor` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `position` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `fact_raw` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `factType` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `objectA` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `valueX` bigint(20) NOT NULL, + `valueY` bigint(20) NOT NULL, + `epoch` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `objectPHID` (`objectPHID`), + KEY `factType` (`factType`,`epoch`), + KEY `factType_2` (`factType`,`objectA`,`epoch`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_feed` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_feed`; CREATE TABLE `feed_storydata` ( @@ -406,6 +550,17 @@ CREATE TABLE `feed_storydata` ( UNIQUE KEY `phid` (`phid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `feed_storynotification` ( + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `primaryObjectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `chronologicalKey` bigint(20) unsigned NOT NULL, + `hasViewed` tinyint(1) NOT NULL, + UNIQUE KEY `userPHID` (`userPHID`,`chronologicalKey`), + KEY `userPHID_2` (`userPHID`,`hasViewed`,`primaryObjectPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE `feed_storyreference` ( `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `chronologicalKey` bigint(20) unsigned NOT NULL, @@ -413,13 +568,13 @@ CREATE TABLE `feed_storyreference` ( KEY `chronologicalKey` (`chronologicalKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_file` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_file` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_file`; CREATE TABLE `edge` ( `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `seq` int(10) unsigned NOT NULL, @@ -428,12 +583,14 @@ CREATE TABLE `edge` ( KEY `src` (`src`,`type`,`dateCreated`,`seq`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edgedata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `file` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -448,27 +605,28 @@ CREATE TABLE `file` ( `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `secretKey` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `contentHash` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `metadata` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `phid` (`phid`), KEY `authorPHID` (`authorPHID`), KEY `contentHash` (`contentHash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `file_imagemacro` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `filePHID` varchar(64) NOT NULL, `name` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `isDisabled` tinyint(1) NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) + UNIQUE KEY `name` (`name`), + UNIQUE KEY `key_phid` (`phid`), + KEY `key_disabled` (`isDisabled`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE TABLE `file_proxyimage` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `uri` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `filePHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `uri` (`uri`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `file_storageblob` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -478,6 +636,7 @@ CREATE TABLE `file_storageblob` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `file_transformedfile` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `originalPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -490,8 +649,48 @@ CREATE TABLE `file_transformedfile` ( KEY `transformedPHID` (`transformedPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_flag` DEFAULT CHARACTER SET utf8; +CREATE TABLE `macro_transaction` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `editPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commentPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `commentVersion` int(10) unsigned NOT NULL, + `transactionType` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `oldValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `newValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `contentSource` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_phid` (`phid`), + KEY `key_object` (`objectPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `macro_transaction_comment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `transactionPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `editPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commentVersion` int(10) unsigned NOT NULL, + `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `contentSource` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `isDeleted` tinyint(1) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_phid` (`phid`), + UNIQUE KEY `key_version` (`transactionPHID`,`commentVersion`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_flag` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_flag`; CREATE TABLE `flag` ( @@ -509,8 +708,57 @@ CREATE TABLE `flag` ( KEY `objectPHID` (`objectPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_herald` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_harbormaster` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_harbormaster`; + +CREATE TABLE `edge` ( + `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, + `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `seq` int(10) unsigned NOT NULL, + `dataID` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`src`,`type`,`dst`), + KEY `src` (`src`,`type`,`dateCreated`,`seq`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `edgedata` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `harbormaster_object` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `name` varchar(255) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `harbormaster_scratchtable` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `data` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `data` (`data`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `lisk_counter` ( + `counterName` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `counterValue` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`counterName`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_herald` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_herald`; CREATE TABLE `herald_action` ( @@ -522,6 +770,7 @@ CREATE TABLE `herald_action` ( KEY `ruleID` (`ruleID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `herald_condition` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ruleID` int(10) unsigned NOT NULL, @@ -532,6 +781,7 @@ CREATE TABLE `herald_condition` ( KEY `ruleID` (`ruleID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `herald_rule` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, @@ -548,6 +798,7 @@ CREATE TABLE `herald_rule` ( KEY `IDX_RULE_TYPE` (`ruleType`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `herald_ruleapplied` ( `ruleID` int(10) unsigned NOT NULL, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -555,6 +806,7 @@ CREATE TABLE `herald_ruleapplied` ( KEY `phid` (`phid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `herald_ruleedit` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `ruleID` int(10) unsigned NOT NULL, @@ -567,12 +819,14 @@ CREATE TABLE `herald_ruleedit` ( KEY `ruleID` (`ruleID`,`dateCreated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `herald_savedheader` ( `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `header` varchar(255) NOT NULL, PRIMARY KEY (`phid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `herald_transcript` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -593,13 +847,13 @@ CREATE TABLE `herald_transcript` ( KEY `garbageCollected` (`garbageCollected`,`time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_maniphest` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_maniphest` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_maniphest`; CREATE TABLE `edge` ( `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `seq` int(10) unsigned NOT NULL, @@ -608,12 +862,14 @@ CREATE TABLE `edge` ( KEY `src` (`src`,`type`,`dateCreated`,`seq`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edgedata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `maniphest_savedquery` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -627,6 +883,7 @@ CREATE TABLE `maniphest_savedquery` ( KEY `userPHID_2` (`userPHID`,`isDefault`,`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `maniphest_task` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -637,6 +894,7 @@ CREATE TABLE `maniphest_task` ( `status` int(10) unsigned NOT NULL, `priority` int(10) unsigned NOT NULL, `title` text NOT NULL, + `originalTitle` text NOT NULL, `description` longtext NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, @@ -655,6 +913,7 @@ CREATE TABLE `maniphest_task` ( KEY `priority_2` (`priority`,`subpriority`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `maniphest_taskauxiliarystorage` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `taskPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -666,6 +925,7 @@ CREATE TABLE `maniphest_taskauxiliarystorage` ( UNIQUE KEY `taskPHID` (`taskPHID`,`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `maniphest_taskproject` ( `taskPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `projectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -673,6 +933,7 @@ CREATE TABLE `maniphest_taskproject` ( UNIQUE KEY `taskPHID` (`taskPHID`,`projectPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `maniphest_tasksubscriber` ( `taskPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `subscriberPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -680,6 +941,7 @@ CREATE TABLE `maniphest_tasksubscriber` ( UNIQUE KEY `taskPHID` (`taskPHID`,`subscriberPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `maniphest_touch` ( `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `taskID` int(10) unsigned NOT NULL, @@ -687,6 +949,7 @@ CREATE TABLE `maniphest_touch` ( PRIMARY KEY (`userPHID`,`taskID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `maniphest_transaction` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `taskID` int(10) unsigned NOT NULL, @@ -697,15 +960,14 @@ CREATE TABLE `maniphest_transaction` ( `comments` longtext CHARACTER SET utf8 COLLATE utf8_bin, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, - `cache` longtext CHARACTER SET utf8 COLLATE utf8_bin, `metadata` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `contentSource` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `taskID` (`taskID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_meta_data` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_meta_data` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_meta_data`; CREATE TABLE `patch_status` ( @@ -714,15 +976,246 @@ CREATE TABLE `patch_status` ( PRIMARY KEY (`patch`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -INSERT INTO `patch_status` VALUES ('phabricator:000.project.sql',1),('phabricator:0000.legacy.sql',1),('phabricator:001.maniphest_projects.sql',1),('phabricator:002.oauth.sql',1),('phabricator:003.more_oauth.sql',1),('phabricator:004.daemonrepos.sql',1),('phabricator:005.workers.sql',1),('phabricator:006.repository.sql',1),('phabricator:007.daemonlog.sql',1),('phabricator:008.repoopt.sql',1),('phabricator:009.repo_summary.sql',1),('phabricator:010.herald.sql',1),('phabricator:011.badcommit.sql',1),('phabricator:012.dropphidtype.sql',1),('phabricator:013.commitdetail.sql',1),('phabricator:014.shortcuts.sql',1),('phabricator:015.preferences.sql',1),('phabricator:016.userrealnameindex.sql',1),('phabricator:017.sessionkeys.sql',1),('phabricator:018.owners.sql',1),('phabricator:019.arcprojects.sql',1),('phabricator:020.pathcapital.sql',1),('phabricator:021.xhpastview.sql',1),('phabricator:022.differentialcommit.sql',1),('phabricator:023.dxkeys.sql',1),('phabricator:024.mlistkeys.sql',1),('phabricator:025.commentopt.sql',1),('phabricator:026.diffpropkey.sql',1),('phabricator:027.metamtakeys.sql',1),('phabricator:028.systemagent.sql',1),('phabricator:029.cursors.sql',1),('phabricator:030.imagemacro.sql',1),('phabricator:031.workerrace.sql',1),('phabricator:032.viewtime.sql',1),('phabricator:033.privtest.sql',1),('phabricator:034.savedheader.sql',1),('phabricator:035.proxyimage.sql',1),('phabricator:036.mailkey.sql',1),('phabricator:037.setuptest.sql',1),('phabricator:038.admin.sql',1),('phabricator:039.userlog.sql',1),('phabricator:040.transform.sql',1),('phabricator:041.heraldrepetition.sql',1),('phabricator:042.commentmetadata.sql',1),('phabricator:043.pastebin.sql',1),('phabricator:044.countdown.sql',1),('phabricator:045.timezone.sql',1),('phabricator:046.conduittoken.sql',1),('phabricator:047.projectstatus.sql',1),('phabricator:048.relationshipkeys.sql',1),('phabricator:049.projectowner.sql',1),('phabricator:050.taskdenormal.sql',1),('phabricator:051.projectfilter.sql',1),('phabricator:052.pastelanguage.sql',1),('phabricator:053.feed.sql',1),('phabricator:054.subscribers.sql',1),('phabricator:055.add_author_to_files.sql',1),('phabricator:056.slowvote.sql',1),('phabricator:057.parsecache.sql',1),('phabricator:058.missingkeys.sql',1),('phabricator:059.engines.php',1),('phabricator:060.phriction.sql',1),('phabricator:061.phrictioncontent.sql',1),('phabricator:062.phrictionmenu.sql',1),('phabricator:063.pasteforks.sql',1),('phabricator:064.subprojects.sql',1),('phabricator:065.sshkeys.sql',1),('phabricator:066.phrictioncontent.sql',1),('phabricator:067.preferences.sql',1),('phabricator:068.maniphestauxiliarystorage.sql',1),('phabricator:069.heraldxscript.sql',1),('phabricator:070.differentialaux.sql',1),('phabricator:071.contentsource.sql',1),('phabricator:072.blamerevert.sql',1),('phabricator:073.reposymbols.sql',1),('phabricator:074.affectedpath.sql',1),('phabricator:075.revisionhash.sql',1),('phabricator:076.indexedlanguages.sql',1),('phabricator:077.originalemail.sql',1),('phabricator:078.nametoken.sql',1),('phabricator:079.nametokenindex.php',1),('phabricator:080.filekeys.sql',1),('phabricator:081.filekeys.php',1),('phabricator:082.xactionkey.sql',1),('phabricator:083.dxviewtime.sql',1),('phabricator:084.pasteauthorkey.sql',1),('phabricator:085.packagecommitrelationship.sql',1),('phabricator:086.formeraffil.sql',1),('phabricator:087.phrictiondelete.sql',1),('phabricator:088.audit.sql',1),('phabricator:089.projectwiki.sql',1),('phabricator:090.forceuniqueprojectnames.php',1),('phabricator:091.uniqueslugkey.sql',1),('phabricator:092.dropgithubnotification.sql',1),('phabricator:093.gitremotes.php',1),('phabricator:094.phrictioncolumn.sql',1),('phabricator:095.directory.sql',1),('phabricator:096.filename.sql',1),('phabricator:097.heraldruletypes.sql',1),('phabricator:098.heraldruletypemigration.php',1),('phabricator:099.drydock.sql',1),('phabricator:100.projectxaction.sql',1),('phabricator:101.heraldruleapplied.sql',1),('phabricator:102.heraldcleanup.php',1),('phabricator:103.heraldedithistory.sql',1),('phabricator:104.searchkey.sql',1),('phabricator:105.mimetype.sql',1),('phabricator:106.chatlog.sql',1),('phabricator:107.oauthserver.sql',1),('phabricator:108.oauthscope.sql',1),('phabricator:109.oauthclientphidkey.sql',1),('phabricator:110.commitaudit.sql',1),('phabricator:111.commitauditmigration.php',1),('phabricator:112.oauthaccesscoderedirecturi.sql',1),('phabricator:113.lastreviewer.sql',1),('phabricator:114.auditrequest.sql',1),('phabricator:115.prepareutf8.sql',1),('phabricator:116.utf8-backup-first-expect-wait.sql',1),('phabricator:117.repositorydescription.php',1),('phabricator:118.auditinline.sql',1),('phabricator:119.filehash.sql',1),('phabricator:120.noop.sql',1),('phabricator:121.drydocklog.sql',1),('phabricator:122.flag.sql',1),('phabricator:123.heraldrulelog.sql',1),('phabricator:124.subpriority.sql',1),('phabricator:125.ipv6.sql',1),('phabricator:126.edges.sql',1),('phabricator:127.userkeybody.sql',1),('phabricator:128.phabricatorcom.sql',1),('phabricator:129.savedquery.sql',1),('phabricator:130.denormalrevisionquery.sql',1),('phabricator:131.migraterevisionquery.php',1),('phabricator:132.phame.sql',1),('phabricator:133.imagemacro.sql',1),('phabricator:134.emptysearch.sql',1),('phabricator:135.datecommitted.sql',1),('phabricator:136.sex.sql',1),('phabricator:137.auditmetadata.sql',1),('phabricator:db.audit',1),('phabricator:db.chatlog',1),('phabricator:db.conduit',1),('phabricator:db.countdown',1),('phabricator:db.daemon',1),('phabricator:db.differential',1),('phabricator:db.draft',1),('phabricator:db.drydock',1),('phabricator:db.feed',1),('phabricator:db.file',1),('phabricator:db.flag',1),('phabricator:db.herald',1),('phabricator:db.maniphest',1),('phabricator:db.metamta',1),('phabricator:db.meta_data',1),('phabricator:db.oauth_server',1),('phabricator:db.owners',1),('phabricator:db.pastebin',1),('phabricator:db.phame',1),('phabricator:db.phid',1),('phabricator:db.phriction',1),('phabricator:db.project',1),('phabricator:db.repository',1),('phabricator:db.search',1),('phabricator:db.slowvote',1),('phabricator:db.timeline',1),('phabricator:db.user',1),('phabricator:db.worker',1),('phabricator:db.xhpastview',1); - -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_metamta` DEFAULT CHARACTER SET utf8; +INSERT INTO `patch_status` (`patch`, `applied`) VALUES +('phabricator:000.project.sql', 1), +('phabricator:0000.legacy.sql', 1), +('phabricator:001.maniphest_projects.sql', 1), +('phabricator:002.oauth.sql', 1), +('phabricator:003.more_oauth.sql', 1), +('phabricator:004.daemonrepos.sql', 1), +('phabricator:005.workers.sql', 1), +('phabricator:006.repository.sql', 1), +('phabricator:007.daemonlog.sql', 1), +('phabricator:008.repoopt.sql', 1), +('phabricator:009.repo_summary.sql', 1), +('phabricator:010.herald.sql', 1), +('phabricator:011.badcommit.sql', 1), +('phabricator:012.dropphidtype.sql', 1), +('phabricator:013.commitdetail.sql', 1), +('phabricator:014.shortcuts.sql', 1), +('phabricator:015.preferences.sql', 1), +('phabricator:016.userrealnameindex.sql', 1), +('phabricator:017.sessionkeys.sql', 1), +('phabricator:018.owners.sql', 1), +('phabricator:019.arcprojects.sql', 1), +('phabricator:020.pathcapital.sql', 1), +('phabricator:021.xhpastview.sql', 1), +('phabricator:022.differentialcommit.sql', 1), +('phabricator:023.dxkeys.sql', 1), +('phabricator:024.mlistkeys.sql', 1), +('phabricator:025.commentopt.sql', 1), +('phabricator:026.diffpropkey.sql', 1), +('phabricator:027.metamtakeys.sql', 1), +('phabricator:028.systemagent.sql', 1), +('phabricator:029.cursors.sql', 1), +('phabricator:030.imagemacro.sql', 1), +('phabricator:031.workerrace.sql', 1), +('phabricator:032.viewtime.sql', 1), +('phabricator:033.privtest.sql', 1), +('phabricator:034.savedheader.sql', 1), +('phabricator:035.proxyimage.sql', 1), +('phabricator:036.mailkey.sql', 1), +('phabricator:037.setuptest.sql', 1), +('phabricator:038.admin.sql', 1), +('phabricator:039.userlog.sql', 1), +('phabricator:040.transform.sql', 1), +('phabricator:041.heraldrepetition.sql', 1), +('phabricator:042.commentmetadata.sql', 1), +('phabricator:043.pastebin.sql', 1), +('phabricator:044.countdown.sql', 1), +('phabricator:045.timezone.sql', 1), +('phabricator:046.conduittoken.sql', 1), +('phabricator:047.projectstatus.sql', 1), +('phabricator:048.relationshipkeys.sql', 1), +('phabricator:049.projectowner.sql', 1), +('phabricator:050.taskdenormal.sql', 1), +('phabricator:051.projectfilter.sql', 1), +('phabricator:052.pastelanguage.sql', 1), +('phabricator:053.feed.sql', 1), +('phabricator:054.subscribers.sql', 1), +('phabricator:055.add_author_to_files.sql', 1), +('phabricator:056.slowvote.sql', 1), +('phabricator:057.parsecache.sql', 1), +('phabricator:058.missingkeys.sql', 1), +('phabricator:059.engines.php', 1), +('phabricator:060.phriction.sql', 1), +('phabricator:061.phrictioncontent.sql', 1), +('phabricator:062.phrictionmenu.sql', 1), +('phabricator:063.pasteforks.sql', 1), +('phabricator:064.subprojects.sql', 1), +('phabricator:065.sshkeys.sql', 1), +('phabricator:066.phrictioncontent.sql', 1), +('phabricator:067.preferences.sql', 1), +('phabricator:068.maniphestauxiliarystorage.sql', 1), +('phabricator:069.heraldxscript.sql', 1), +('phabricator:070.differentialaux.sql', 1), +('phabricator:071.contentsource.sql', 1), +('phabricator:072.blamerevert.sql', 1), +('phabricator:073.reposymbols.sql', 1), +('phabricator:074.affectedpath.sql', 1), +('phabricator:075.revisionhash.sql', 1), +('phabricator:076.indexedlanguages.sql', 1), +('phabricator:077.originalemail.sql', 1), +('phabricator:078.nametoken.sql', 1), +('phabricator:079.nametokenindex.php', 1), +('phabricator:080.filekeys.sql', 1), +('phabricator:081.filekeys.php', 1), +('phabricator:082.xactionkey.sql', 1), +('phabricator:083.dxviewtime.sql', 1), +('phabricator:084.pasteauthorkey.sql', 1), +('phabricator:085.packagecommitrelationship.sql', 1), +('phabricator:086.formeraffil.sql', 1), +('phabricator:087.phrictiondelete.sql', 1), +('phabricator:088.audit.sql', 1), +('phabricator:089.projectwiki.sql', 1), +('phabricator:090.forceuniqueprojectnames.php', 1), +('phabricator:091.uniqueslugkey.sql', 1), +('phabricator:092.dropgithubnotification.sql', 1), +('phabricator:093.gitremotes.php', 1), +('phabricator:094.phrictioncolumn.sql', 1), +('phabricator:095.directory.sql', 1), +('phabricator:096.filename.sql', 1), +('phabricator:097.heraldruletypes.sql', 1), +('phabricator:098.heraldruletypemigration.php', 1), +('phabricator:099.drydock.sql', 1), +('phabricator:100.projectxaction.sql', 1), +('phabricator:101.heraldruleapplied.sql', 1), +('phabricator:102.heraldcleanup.php', 1), +('phabricator:103.heraldedithistory.sql', 1), +('phabricator:104.searchkey.sql', 1), +('phabricator:105.mimetype.sql', 1), +('phabricator:106.chatlog.sql', 1), +('phabricator:107.oauthserver.sql', 1), +('phabricator:108.oauthscope.sql', 1), +('phabricator:109.oauthclientphidkey.sql', 1), +('phabricator:110.commitaudit.sql', 1), +('phabricator:111.commitauditmigration.php', 1), +('phabricator:112.oauthaccesscoderedirecturi.sql', 1), +('phabricator:113.lastreviewer.sql', 1), +('phabricator:114.auditrequest.sql', 1), +('phabricator:115.prepareutf8.sql', 1), +('phabricator:116.utf8-backup-first-expect-wait.sql', 1), +('phabricator:117.repositorydescription.php', 1), +('phabricator:118.auditinline.sql', 1), +('phabricator:119.filehash.sql', 1), +('phabricator:120.noop.sql', 1), +('phabricator:121.drydocklog.sql', 1), +('phabricator:122.flag.sql', 1), +('phabricator:123.heraldrulelog.sql', 1), +('phabricator:124.subpriority.sql', 1), +('phabricator:125.ipv6.sql', 1), +('phabricator:126.edges.sql', 1), +('phabricator:127.userkeybody.sql', 1), +('phabricator:128.phabricatorcom.sql', 1), +('phabricator:129.savedquery.sql', 1), +('phabricator:130.denormalrevisionquery.sql', 1), +('phabricator:131.migraterevisionquery.php', 1), +('phabricator:132.phame.sql', 1), +('phabricator:133.imagemacro.sql', 1), +('phabricator:134.emptysearch.sql', 1), +('phabricator:135.datecommitted.sql', 1), +('phabricator:136.sex.sql', 1), +('phabricator:137.auditmetadata.sql', 1), +('phabricator:138.notification.sql', 1358377808), +('phabricator:20121209.pholioxactions.sql', 1358377847), +('phabricator:20121209.xmacroadd.sql', 1358377849), +('phabricator:20121209.xmacromigrate.php', 1358377849), +('phabricator:20121209.xmacromigratekey.sql', 1358377850), +('phabricator:20121220.generalcache.sql', 1358377851), +('phabricator:20121226.config.sql', 1358377852), +('phabricator:20130101.confxaction.sql', 1358377853), +('phabricator:20130102.metamtareceivedmailmessageidhash.sql', 1358377854), +('phabricator:20130103.filemetadata.sql', 1358377855), +('phabricator:daemonstatus.sql', 1358377823), +('phabricator:daemonstatuskey.sql', 1358377828), +('phabricator:daemontaskarchive.sql', 1358377838), +('phabricator:db.audit', 1), +('phabricator:db.cache', 1358377804), +('phabricator:db.calendar', 1358377802), +('phabricator:db.chatlog', 1), +('phabricator:db.conduit', 1), +('phabricator:db.config', 1358377852), +('phabricator:db.countdown', 1), +('phabricator:db.daemon', 1), +('phabricator:db.differential', 1), +('phabricator:db.draft', 1), +('phabricator:db.drydock', 1), +('phabricator:db.fact', 1358377804), +('phabricator:db.feed', 1), +('phabricator:db.file', 1), +('phabricator:db.flag', 1), +('phabricator:db.harbormaster', 1358377803), +('phabricator:db.herald', 1), +('phabricator:db.maniphest', 1), +('phabricator:db.metamta', 1), +('phabricator:db.meta_data', 1), +('phabricator:db.oauth_server', 1), +('phabricator:db.owners', 1), +('phabricator:db.pastebin', 1), +('phabricator:db.phame', 1), +('phabricator:db.phid', 1), +('phabricator:db.pholio', 1358377807), +('phabricator:db.phriction', 1), +('phabricator:db.ponder', 1358377805), +('phabricator:db.project', 1), +('phabricator:db.repository', 1), +('phabricator:db.search', 1), +('phabricator:db.slowvote', 1), +('phabricator:db.timeline', 1), +('phabricator:db.user', 1), +('phabricator:db.worker', 1), +('phabricator:db.xhpastview', 1), +('phabricator:db.xhprof', 1358377806), +('phabricator:differentialbookmarks.sql', 1358377817), +('phabricator:draft-metadata.sql', 1358377832), +('phabricator:dropfileproxyimage.sql', 1358377843), +('phabricator:drydockresoucetype.sql', 1358377840), +('phabricator:drydocktaskid.sql', 1358377839), +('phabricator:edgetype.sql', 1358377829), +('phabricator:emailtable.sql', 1358377810), +('phabricator:emailtableport.sql', 1358377811), +('phabricator:emailtableremove.sql', 1358377811), +('phabricator:fact-raw.sql', 1358377825), +('phabricator:harbormasterobject.sql', 1358377817), +('phabricator:holidays.sql', 1358377808), +('phabricator:ldapinfo.sql', 1358377814), +('phabricator:liskcounters-task.sql', 1358377844), +('phabricator:liskcounters.php', 1358377842), +('phabricator:liskcounters.sql', 1358377841), +('phabricator:maniphestxcache.sql', 1358377819), +('phabricator:markupcache.sql', 1358377818), +('phabricator:migrate-differential-dependencies.php', 1358377820), +('phabricator:migrate-maniphest-dependencies.php', 1358377820), +('phabricator:migrate-maniphest-revisions.php', 1358377822), +('phabricator:migrate-project-edges.php', 1358377824), +('phabricator:owners-exclude.sql', 1358377846), +('phabricator:pastepolicy.sql', 1358377831), +('phabricator:phameblog.sql', 1358377821), +('phabricator:phamedomain.sql', 1358377833), +('phabricator:phameoneblog.sql', 1358377837), +('phabricator:phamepolicy.sql', 1358377836), +('phabricator:phiddrop.sql', 1358377812), +('phabricator:pholio.sql', 1358377846), +('phabricator:policy-project.sql', 1358377827), +('phabricator:ponder-comments.sql', 1358377830), +('phabricator:ponder-mailkey-populate.php', 1358377835), +('phabricator:ponder-mailkey.sql', 1358377834), +('phabricator:ponder.sql', 1358377826), +('phabricator:repository-lint.sql', 1358377843), +('phabricator:statustxt.sql', 1358377837), +('phabricator:symbolcontexts.sql', 1358377823), +('phabricator:testdatabase.sql', 1358377813), +('phabricator:threadtopic.sql', 1358377815), +('phabricator:userstatus.sql', 1358377809), +('phabricator:usertranslation.sql', 1358377816), +('phabricator:xhprof.sql', 1358377832); +CREATE DATABASE `{$NAMESPACE}_metamta` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_metamta`; CREATE TABLE `edge` ( `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `seq` int(10) unsigned NOT NULL, @@ -731,12 +1224,14 @@ CREATE TABLE `edge` ( KEY `src` (`src`,`type`,`dateCreated`,`seq`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edgedata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `metamta_mail` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `parameters` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -752,6 +1247,7 @@ CREATE TABLE `metamta_mail` ( KEY `relatedPHID` (`relatedPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `metamta_mailinglist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -766,6 +1262,7 @@ CREATE TABLE `metamta_mailinglist` ( UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `metamta_receivedmail` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `headers` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -776,13 +1273,15 @@ CREATE TABLE `metamta_receivedmail` ( `message` longtext CHARACTER SET utf8 COLLATE utf8_bin, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, + `messageIDHash` char(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`), KEY `relatedPHID` (`relatedPHID`), - KEY `authorPHID` (`authorPHID`) + KEY `authorPHID` (`authorPHID`), + KEY `key_messageIDHash` (`messageIDHash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_oauth_server` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_oauth_server` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_oauth_server`; CREATE TABLE `oauth_server_oauthclientauthorization` ( @@ -798,6 +1297,7 @@ CREATE TABLE `oauth_server_oauthclientauthorization` ( UNIQUE KEY `userPHID` (`userPHID`,`clientPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `oauth_server_oauthserveraccesstoken` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `token` varchar(32) NOT NULL, @@ -809,6 +1309,7 @@ CREATE TABLE `oauth_server_oauthserveraccesstoken` ( UNIQUE KEY `token` (`token`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `oauth_server_oauthserverauthorizationcode` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `code` varchar(32) NOT NULL, @@ -822,6 +1323,7 @@ CREATE TABLE `oauth_server_oauthserverauthorizationcode` ( UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `oauth_server_oauthserverclient` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -836,8 +1338,8 @@ CREATE TABLE `oauth_server_oauthserverclient` ( KEY `creatorPHID` (`creatorPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_owners` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_owners` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_owners`; CREATE TABLE `owners_owner` ( @@ -849,10 +1351,12 @@ CREATE TABLE `owners_owner` ( KEY `userPHID` (`userPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `owners_package` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `name` varchar(255) NOT NULL, + `originalName` varchar(255) NOT NULL, `description` text NOT NULL, `primaryOwnerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `auditingEnabled` tinyint(1) NOT NULL DEFAULT '0', @@ -861,17 +1365,19 @@ CREATE TABLE `owners_package` ( UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `owners_path` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `packageID` int(10) unsigned NOT NULL, `repositoryPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `path` varchar(255) NOT NULL, + `excluded` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `packageID` (`packageID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_pastebin` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_pastebin` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_pastebin`; CREATE TABLE `pastebin_paste` ( @@ -884,15 +1390,54 @@ CREATE TABLE `pastebin_paste` ( `dateModified` int(10) unsigned NOT NULL, `language` varchar(64) NOT NULL, `parentPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`id`), KEY `parentPHID` (`parentPHID`), KEY `authorPHID` (`authorPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_phame` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_phame` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_phame`; +CREATE TABLE `edge` ( + `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, + `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `seq` int(10) unsigned NOT NULL, + `dataID` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`src`,`type`,`dst`), + KEY `src` (`src`,`type`,`dateCreated`,`seq`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `edgedata` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `phame_blog` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `description` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `domain` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `configData` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `creatorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `editPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `joinPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + UNIQUE KEY `domain` (`domain`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE `phame_post` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -905,30 +1450,117 @@ CREATE TABLE `phame_post` ( `datePublished` int(10) unsigned NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, + `blogPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `phid` (`phid`), UNIQUE KEY `phameTitle` (`bloggerPHID`,`phameTitle`), - KEY `bloggerPosts` (`bloggerPHID`,`visibility`,`datePublished`,`id`) + KEY `bloggerPosts` (`bloggerPHID`,`visibility`,`datePublished`,`id`), + KEY `instancePosts` (`visibility`,`datePublished`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_phid` DEFAULT CHARACTER SET utf8; -USE `{$NAMESPACE}_phid`; +CREATE DATABASE `{$NAMESPACE}_pholio` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_pholio`; -CREATE TABLE `phid` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `phidType` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, - `parentPHID` varchar(64) DEFAULT NULL, - `ownerPHID` varchar(64) DEFAULT NULL, +CREATE TABLE `edge` ( + `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `seq` int(10) unsigned NOT NULL, + `dataID` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`src`,`type`,`dst`), + KEY `src` (`src`,`type`,`dateCreated`,`seq`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `edgedata` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `pholio_image` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mockID` int(10) unsigned NOT NULL, + `filePHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `name` varchar(128) NOT NULL, + `description` longtext NOT NULL, + `sequence` int(10) unsigned NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `dateModified` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`) + KEY `mockID` (`mockID`,`sequence`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_phriction` DEFAULT CHARACTER SET utf8; +CREATE TABLE `pholio_mock` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `name` varchar(128) NOT NULL, + `originalName` varchar(128) NOT NULL, + `description` longtext NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `coverPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `mailKey` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + KEY `authorPHID` (`authorPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `pholio_transaction` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `editPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commentPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `commentVersion` int(10) unsigned NOT NULL, + `transactionType` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `oldValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `newValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `contentSource` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_phid` (`phid`), + KEY `key_object` (`objectPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `pholio_transaction_comment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `transactionPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `editPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commentVersion` int(10) unsigned NOT NULL, + `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `contentSource` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `isDeleted` tinyint(1) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `mockID` int(10) unsigned DEFAULT NULL, + `imageID` int(10) unsigned DEFAULT NULL, + `x` int(10) unsigned DEFAULT NULL, + `y` int(10) unsigned DEFAULT NULL, + `width` int(10) unsigned DEFAULT NULL, + `height` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `key_phid` (`phid`), + UNIQUE KEY `key_version` (`transactionPHID`,`commentVersion`), + UNIQUE KEY `key_draft` (`authorPHID`,`mockID`,`transactionPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_phriction` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_phriction`; CREATE TABLE `phriction_content` ( @@ -950,6 +1582,7 @@ CREATE TABLE `phriction_content` ( KEY `slug` (`slug`(255)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `phriction_document` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -963,13 +1596,13 @@ CREATE TABLE `phriction_document` ( UNIQUE KEY `depth` (`depth`,`slug`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_project` DEFAULT CHARACTER SET utf8; -USE `{$NAMESPACE}_project`; +CREATE DATABASE `{$NAMESPACE}_ponder` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_ponder`; CREATE TABLE `edge` ( `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `seq` int(10) unsigned NOT NULL, @@ -978,12 +1611,86 @@ CREATE TABLE `edge` ( KEY `src` (`src`,`type`,`dateCreated`,`seq`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edgedata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `ponder_answer` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `questionID` int(10) unsigned NOT NULL, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `voteCount` int(10) NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `content` longtext NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `contentSource` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + KEY `questionID` (`questionID`), + KEY `authorPHID` (`authorPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `ponder_comment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `targetPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `content` longtext NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `authorPHID` (`authorPHID`), + KEY `targetPHID` (`targetPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `ponder_question` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `voteCount` int(10) NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `content` longtext NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `contentSource` varchar(255) DEFAULT NULL, + `heat` float NOT NULL, + `answerCount` int(10) unsigned NOT NULL, + `mailKey` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + KEY `authorPHID` (`authorPHID`), + KEY `heat` (`heat`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_project` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_project`; + +CREATE TABLE `edge` ( + `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, + `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `seq` int(10) unsigned NOT NULL, + `dataID` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`src`,`type`,`dst`), + KEY `src` (`src`,`type`,`dateCreated`,`seq`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `edgedata` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE `project` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, @@ -994,12 +1701,16 @@ CREATE TABLE `project` ( `status` varchar(32) NOT NULL, `subprojectPHIDs` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `phrictionSlug` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `viewPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `editPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `joinPolicy` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), UNIQUE KEY `phid` (`phid`), UNIQUE KEY `phrictionSlug` (`phrictionSlug`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `project_affiliation` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `projectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1013,6 +1724,7 @@ CREATE TABLE `project_affiliation` ( KEY `userPHID` (`userPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `project_profile` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `projectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1024,6 +1736,7 @@ CREATE TABLE `project_profile` ( UNIQUE KEY `projectPHID` (`projectPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `project_subproject` ( `projectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `subprojectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1031,6 +1744,7 @@ CREATE TABLE `project_subproject` ( UNIQUE KEY `projectPHID` (`projectPHID`,`subprojectPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `project_transaction` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `projectID` int(10) unsigned NOT NULL, @@ -1044,13 +1758,13 @@ CREATE TABLE `project_transaction` ( KEY `projectID` (`projectID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_repository` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_repository` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_repository`; CREATE TABLE `edge` ( `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `seq` int(10) unsigned NOT NULL, @@ -1059,12 +1773,14 @@ CREATE TABLE `edge` ( KEY `src` (`src`,`type`,`dateCreated`,`seq`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edgedata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1080,6 +1796,7 @@ CREATE TABLE `repository` ( UNIQUE KEY `phid` (`phid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_arcanistproject` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1092,6 +1809,7 @@ CREATE TABLE `repository_arcanistproject` ( UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_auditrequest` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `auditorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1103,12 +1821,26 @@ CREATE TABLE `repository_auditrequest` ( KEY `auditorPHID` (`auditorPHID`,`auditStatus`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_badcommit` ( `fullCommitName` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `description` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`fullCommitName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `repository_branch` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repositoryID` int(10) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `lintCommit` varchar(40) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `repositoryID` (`repositoryID`,`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE `repository_commit` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `repositoryID` int(10) unsigned NOT NULL, @@ -1125,6 +1857,7 @@ CREATE TABLE `repository_commit` ( KEY `authorPHID` (`authorPHID`,`auditStatus`,`epoch`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_commitdata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `commitID` int(10) unsigned NOT NULL, @@ -1136,6 +1869,7 @@ CREATE TABLE `repository_commitdata` ( KEY `authorName` (`authorName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_filesystem` ( `repositoryID` int(10) unsigned NOT NULL, `parentID` int(10) unsigned NOT NULL, @@ -1147,6 +1881,22 @@ CREATE TABLE `repository_filesystem` ( KEY `repositoryID` (`repositoryID`,`svnCommit`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `repository_lintmessage` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `branchID` int(10) unsigned NOT NULL, + `path` varchar(512) NOT NULL, + `line` int(10) unsigned NOT NULL, + `code` varchar(32) NOT NULL, + `severity` varchar(16) NOT NULL, + `name` varchar(255) NOT NULL, + `description` text NOT NULL, + PRIMARY KEY (`id`), + KEY `branchID` (`branchID`,`path`(64)), + KEY `branchID_2` (`branchID`,`code`,`path`(64)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE `repository_path` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `path` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1155,6 +1905,7 @@ CREATE TABLE `repository_path` ( UNIQUE KEY `pathHash` (`pathHash`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_pathchange` ( `repositoryID` int(10) unsigned NOT NULL, `pathID` int(10) unsigned NOT NULL, @@ -1169,6 +1920,7 @@ CREATE TABLE `repository_pathchange` ( KEY `repositoryID` (`repositoryID`,`pathID`,`commitSequence`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_shortcut` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, @@ -1178,6 +1930,7 @@ CREATE TABLE `repository_shortcut` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_summary` ( `repositoryID` int(10) unsigned NOT NULL, `size` int(10) unsigned NOT NULL, @@ -1186,8 +1939,10 @@ CREATE TABLE `repository_summary` ( PRIMARY KEY (`repositoryID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `repository_symbol` ( `arcanistProjectID` int(10) unsigned NOT NULL, + `symbolContext` varchar(128) NOT NULL DEFAULT '', `symbolName` varchar(128) NOT NULL, `symbolType` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `symbolLanguage` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1196,8 +1951,8 @@ CREATE TABLE `repository_symbol` ( KEY `symbolName` (`symbolName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_search` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_search` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_search`; CREATE TABLE `search_document` ( @@ -1210,6 +1965,7 @@ CREATE TABLE `search_document` ( KEY `documentCreated` (`documentCreated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `search_documentfield` ( `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `phidType` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1220,6 +1976,7 @@ CREATE TABLE `search_documentfield` ( FULLTEXT KEY `corpus` (`corpus`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE `search_documentrelationship` ( `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `relatedPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1231,6 +1988,7 @@ CREATE TABLE `search_documentrelationship` ( KEY `relation` (`relation`,`relatedPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `search_query` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `query` varchar(255) NOT NULL, @@ -1242,8 +2000,8 @@ CREATE TABLE `search_query` ( UNIQUE KEY `queryKey` (`queryKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_slowvote` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_slowvote` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_slowvote`; CREATE TABLE `slowvote_choice` ( @@ -1258,6 +2016,7 @@ CREATE TABLE `slowvote_choice` ( KEY `authorPHID` (`authorPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `slowvote_comment` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `pollID` int(10) unsigned NOT NULL, @@ -1269,6 +2028,7 @@ CREATE TABLE `slowvote_comment` ( UNIQUE KEY `pollID` (`pollID`,`authorPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `slowvote_option` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `pollID` int(10) unsigned NOT NULL, @@ -1279,6 +2039,7 @@ CREATE TABLE `slowvote_option` ( KEY `pollID` (`pollID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `slowvote_poll` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `question` varchar(255) NOT NULL, @@ -1293,8 +2054,8 @@ CREATE TABLE `slowvote_poll` ( UNIQUE KEY `phid` (`phid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_timeline` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_timeline` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_timeline`; CREATE TABLE `timeline_cursor` ( @@ -1303,6 +2064,7 @@ CREATE TABLE `timeline_cursor` ( PRIMARY KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `timeline_event` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `type` char(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1312,19 +2074,20 @@ CREATE TABLE `timeline_event` ( KEY `type` (`type`,`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `timeline_eventdata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `eventData` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_user` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_user` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_user`; CREATE TABLE `edge` ( `src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, - `type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` int(10) unsigned NOT NULL, `dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `dateCreated` int(10) unsigned NOT NULL, `seq` int(10) unsigned NOT NULL, @@ -1333,12 +2096,14 @@ CREATE TABLE `edge` ( KEY `src` (`src`,`type`,`dateCreated`,`seq`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `edgedata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `phabricator_session` ( `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1348,13 +2113,14 @@ CREATE TABLE `phabricator_session` ( UNIQUE KEY `sessionKey` (`sessionKey`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `userName` varchar(64) NOT NULL, `realName` varchar(128) NOT NULL, - `email` varchar(255) NOT NULL, `sex` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `translation` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `passwordSalt` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `passwordHash` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `dateCreated` int(10) unsigned NOT NULL, @@ -1370,11 +2136,37 @@ CREATE TABLE `user` ( `timezoneIdentifier` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `userName` (`userName`), - UNIQUE KEY `email` (`email`), UNIQUE KEY `phid` (`phid`), KEY `realName` (`realName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `user_email` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `address` varchar(128) NOT NULL, + `isVerified` tinyint(1) NOT NULL DEFAULT '0', + `isPrimary` tinyint(1) NOT NULL DEFAULT '0', + `verificationCode` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `address` (`address`), + KEY `userPHID` (`userPHID`,`isPrimary`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `user_ldapinfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `userID` int(10) unsigned NOT NULL, + `ldapUsername` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `userID` (`userID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE `user_log` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `actorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, @@ -1396,6 +2188,7 @@ CREATE TABLE `user_log` ( KEY `session` (`session`,`dateCreated`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `user_nametoken` ( `token` varchar(255) NOT NULL, `userID` int(10) unsigned NOT NULL, @@ -1403,6 +2196,7 @@ CREATE TABLE `user_nametoken` ( KEY `userID` (`userID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `user_oauthinfo` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userID` int(10) unsigned NOT NULL, @@ -1421,6 +2215,7 @@ CREATE TABLE `user_oauthinfo` ( UNIQUE KEY `oauthProvider` (`oauthProvider`,`oauthUID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `user_preferences` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1429,6 +2224,7 @@ CREATE TABLE `user_preferences` ( UNIQUE KEY `userPHID` (`userPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `user_profile` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1441,6 +2237,7 @@ CREATE TABLE `user_profile` ( UNIQUE KEY `userPHID` (`userPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `user_sshkey` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, @@ -1456,12 +2253,35 @@ CREATE TABLE `user_sshkey` ( KEY `userPHID` (`userPHID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_worker` DEFAULT CHARACTER SET utf8; +CREATE TABLE `user_status` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `userPHID` varchar(64) NOT NULL, + `dateFrom` int(10) unsigned NOT NULL, + `dateTo` int(10) unsigned NOT NULL, + `status` tinyint(3) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `description` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + KEY `userPHID_dateFrom` (`userPHID`,`dateTo`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE DATABASE `{$NAMESPACE}_worker` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_worker`; -CREATE TABLE `worker_task` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, +CREATE TABLE `lisk_counter` ( + `counterName` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `counterValue` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`counterName`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `lisk_counter` (`counterName`, `counterValue`) VALUES +('worker_activetask', 2); + +CREATE TABLE `worker_activetask` ( + `id` int(10) unsigned NOT NULL, `taskClass` varchar(255) NOT NULL, `leaseOwner` varchar(255) DEFAULT NULL, `leaseExpires` int(10) unsigned DEFAULT NULL, @@ -1474,14 +2294,31 @@ CREATE TABLE `worker_task` ( KEY `leaseOwner` (`leaseOwner`(16)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `worker_archivetask` ( + `id` int(10) unsigned NOT NULL, + `taskClass` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `leaseOwner` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `leaseExpires` int(10) unsigned DEFAULT NULL, + `failureCount` int(10) unsigned NOT NULL, + `dataID` int(10) unsigned NOT NULL, + `result` int(10) unsigned NOT NULL, + `duration` bigint(20) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `dateCreated` (`dateCreated`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + CREATE TABLE `worker_taskdata` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_xhpastview` DEFAULT CHARACTER SET utf8; +CREATE DATABASE `{$NAMESPACE}_xhpastview` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `{$NAMESPACE}_xhpastview`; CREATE TABLE `xhpastview_parsetree` ( @@ -1494,3 +2331,21 @@ CREATE TABLE `xhpastview_parsetree` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE `{$NAMESPACE}_xhprof` /*!40100 DEFAULT CHARACTER SET utf8 */; +USE `{$NAMESPACE}_xhprof`; + +CREATE TABLE `xhprof_sample` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `filePHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `sampleRate` int(11) NOT NULL, + `usTotal` bigint(20) unsigned NOT NULL, + `hostname` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `requestPath` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `controller` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `dateCreated` bigint(20) unsigned NOT NULL, + `dateModified` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `filePHID` (`filePHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8;