diff --git a/resources/sql/init/initialize.sql b/resources/sql/init/initialize.sql deleted file mode 100644 index f2aa6e598f..0000000000 --- a/resources/sql/init/initialize.sql +++ /dev/null @@ -1,2001 +0,0 @@ --- MySQL dump 10.13 Distrib 5.5.10, for osx10.6 (i386) --- --- Host: localhost Database: phabricator_conduit --- ------------------------------------------------------ --- Server version 5.5.10 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Current Database: `phabricator_conduit` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_conduit` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_conduit`; - --- --- Table structure for table `conduit_connectionlog` --- - -DROP TABLE IF EXISTS `conduit_connectionlog`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `conduit_connectionlog` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `client` varchar(255) DEFAULT NULL, - `clientVersion` varchar(255) DEFAULT NULL, - `clientDescription` varchar(255) DEFAULT NULL, - `username` varchar(255) DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `conduit_connectionlog` --- - -LOCK TABLES `conduit_connectionlog` WRITE; -/*!40000 ALTER TABLE `conduit_connectionlog` DISABLE KEYS */; -/*!40000 ALTER TABLE `conduit_connectionlog` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `conduit_methodcalllog` --- - -DROP TABLE IF EXISTS `conduit_methodcalllog`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `conduit_methodcalllog` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `connectionID` bigint(20) unsigned DEFAULT NULL, - `method` varchar(255) NOT NULL, - `error` varchar(255) NOT NULL, - `duration` bigint(20) unsigned NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `conduit_methodcalllog` --- - -LOCK TABLES `conduit_methodcalllog` WRITE; -/*!40000 ALTER TABLE `conduit_methodcalllog` DISABLE KEYS */; -INSERT INTO `conduit_methodcalllog` VALUES (1,NULL,'daemon.log','',4569,1304349508,1304349508),(2,NULL,'daemon.log','',2335,1304349508,1304349508),(3,NULL,'daemon.log','',2463,1304349508,1304349508),(4,NULL,'daemon.log','',4507,1304349546,1304349546),(5,NULL,'daemon.log','',3366,1304349546,1304349546); -/*!40000 ALTER TABLE `conduit_methodcalllog` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_daemon` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_daemon` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_daemon`; - --- --- Table structure for table `daemon_log` --- - -DROP TABLE IF EXISTS `daemon_log`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `daemon_log` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `daemon` varchar(255) NOT NULL, - `host` varchar(255) NOT NULL, - `pid` int(10) unsigned NOT NULL, - `argv` varchar(512) NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `daemon_log` --- - -LOCK TABLES `daemon_log` WRITE; -/*!40000 ALTER TABLE `daemon_log` DISABLE KEYS */; -/*!40000 ALTER TABLE `daemon_log` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `daemon_logevent` --- - -DROP TABLE IF EXISTS `daemon_logevent`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `daemon_logevent` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `logID` int(10) unsigned NOT NULL, - `logType` varchar(4) NOT NULL, - `message` longblob NOT NULL, - `epoch` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `logID` (`logID`,`epoch`) -) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `daemon_logevent` --- - -LOCK TABLES `daemon_logevent` WRITE; -/*!40000 ALTER TABLE `daemon_logevent` DISABLE KEYS */; -INSERT INTO `daemon_logevent` VALUES (1,7,'INIT','',1304349508),(2,9,'INIT','',1304349508),(3,10,'INIT','',1304349508),(4,6,'INIT','',1304349546),(5,8,'INIT','',1304349546); -/*!40000 ALTER TABLE `daemon_logevent` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_differential` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_differential` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_differential`; - --- --- Table structure for table `differential_changeset` --- - -DROP TABLE IF EXISTS `differential_changeset`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_changeset` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `diffID` int(10) unsigned NOT NULL, - `oldFile` varchar(255) DEFAULT NULL, - `fileName` varchar(255) NOT NULL, - `awayPaths` longblob, - `changeType` int(10) unsigned NOT NULL, - `fileType` int(10) unsigned NOT NULL, - `metadata` longblob, - `oldProperties` longblob, - `newProperties` longblob, - `addLines` int(10) unsigned NOT NULL, - `delLines` int(10) unsigned NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `diffID` (`diffID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_changeset` --- - -LOCK TABLES `differential_changeset` WRITE; -/*!40000 ALTER TABLE `differential_changeset` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_changeset` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_changeset_parse_cache` --- - -DROP TABLE IF EXISTS `differential_changeset_parse_cache`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_changeset_parse_cache` ( - `id` int(10) unsigned NOT NULL, - `cache` longblob NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_changeset_parse_cache` --- - -LOCK TABLES `differential_changeset_parse_cache` WRITE; -/*!40000 ALTER TABLE `differential_changeset_parse_cache` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_changeset_parse_cache` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_comment` --- - -DROP TABLE IF EXISTS `differential_comment`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_comment` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `revisionID` int(10) unsigned NOT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `action` varchar(64) NOT NULL, - `content` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `cache` longblob, - PRIMARY KEY (`id`), - KEY `revisionID` (`revisionID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_comment` --- - -LOCK TABLES `differential_comment` WRITE; -/*!40000 ALTER TABLE `differential_comment` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_comment` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_commit` --- - -DROP TABLE IF EXISTS `differential_commit`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_commit` ( - `revisionID` int(10) unsigned NOT NULL, - `commitPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - PRIMARY KEY (`revisionID`,`commitPHID`), - UNIQUE KEY `commitPHID` (`commitPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_commit` --- - -LOCK TABLES `differential_commit` WRITE; -/*!40000 ALTER TABLE `differential_commit` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_commit` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_diff` --- - -DROP TABLE IF EXISTS `differential_diff`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_diff` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `revisionID` int(10) unsigned DEFAULT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `sourceMachine` varchar(255) DEFAULT NULL, - `sourcePath` varchar(255) DEFAULT NULL, - `sourceControlSystem` varchar(64) DEFAULT NULL, - `sourceControlBaseRevision` varchar(255) DEFAULT NULL, - `sourceControlPath` varchar(255) DEFAULT NULL, - `lintStatus` int(10) unsigned NOT NULL, - `unitStatus` int(10) unsigned NOT NULL, - `lineCount` int(10) unsigned NOT NULL, - `branch` varchar(255) DEFAULT NULL, - `parentRevisionID` int(10) unsigned DEFAULT NULL, - `arcanistProjectPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `creationMethod` varchar(255) DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `description` varchar(255) DEFAULT NULL, - `repositoryUUID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `revisionID` (`revisionID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_diff` --- - -LOCK TABLES `differential_diff` WRITE; -/*!40000 ALTER TABLE `differential_diff` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_diff` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_diffproperty` --- - -DROP TABLE IF EXISTS `differential_diffproperty`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_diffproperty` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `diffID` int(10) unsigned NOT NULL, - `name` varchar(255) NOT NULL, - `data` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `diffID` (`diffID`,`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_diffproperty` --- - -LOCK TABLES `differential_diffproperty` WRITE; -/*!40000 ALTER TABLE `differential_diffproperty` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_diffproperty` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_hunk` --- - -DROP TABLE IF EXISTS `differential_hunk`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_hunk` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `changesetID` int(10) unsigned NOT NULL, - `changes` longblob, - `oldOffset` int(10) unsigned NOT NULL, - `oldLen` int(10) unsigned NOT NULL, - `newOffset` int(10) unsigned NOT NULL, - `newLen` int(10) unsigned NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `changesetID` (`changesetID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_hunk` --- - -LOCK TABLES `differential_hunk` WRITE; -/*!40000 ALTER TABLE `differential_hunk` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_hunk` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_inlinecomment` --- - -DROP TABLE IF EXISTS `differential_inlinecomment`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_inlinecomment` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `revisionID` int(10) unsigned NOT NULL, - `commentID` int(10) unsigned DEFAULT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `changesetID` int(10) unsigned NOT NULL, - `isNewFile` tinyint(1) NOT NULL, - `lineNumber` int(10) unsigned NOT NULL, - `lineLength` int(10) unsigned NOT NULL, - `content` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `cache` longblob, - PRIMARY KEY (`id`), - KEY `changesetID` (`changesetID`), - KEY `commentID` (`commentID`), - KEY `revisionID` (`revisionID`,`authorPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_inlinecomment` --- - -LOCK TABLES `differential_inlinecomment` WRITE; -/*!40000 ALTER TABLE `differential_inlinecomment` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_inlinecomment` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_relationship` --- - -DROP TABLE IF EXISTS `differential_relationship`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_relationship` ( - `revisionID` int(10) unsigned NOT NULL, - `relation` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `objectPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `sequence` int(10) unsigned NOT NULL, - `reasonPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - PRIMARY KEY (`revisionID`,`relation`,`objectPHID`), - KEY `objectPHID` (`objectPHID`,`relation`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_relationship` --- - -LOCK TABLES `differential_relationship` WRITE; -/*!40000 ALTER TABLE `differential_relationship` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_relationship` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_revision` --- - -DROP TABLE IF EXISTS `differential_revision`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_revision` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `status` varchar(32) NOT NULL, - `summary` longtext NOT NULL, - `testPlan` text NOT NULL, - `revertPlan` text NOT NULL, - `blameRevision` varchar(255) NOT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `dateCommitted` int(10) unsigned DEFAULT NULL, - `lineCount` int(10) unsigned DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `attached` longtext NOT NULL, - `unsubscribed` longblob NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`), - KEY `authorPHID` (`authorPHID`,`status`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_revision` --- - -LOCK TABLES `differential_revision` WRITE; -/*!40000 ALTER TABLE `differential_revision` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_revision` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `differential_viewtime` --- - -DROP TABLE IF EXISTS `differential_viewtime`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `differential_viewtime` ( - `viewerPHID` varchar(64) NOT NULL, - `objectPHID` varchar(64) NOT NULL, - `viewTime` int(10) unsigned NOT NULL, - PRIMARY KEY (`viewerPHID`,`objectPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `differential_viewtime` --- - -LOCK TABLES `differential_viewtime` WRITE; -/*!40000 ALTER TABLE `differential_viewtime` DISABLE KEYS */; -/*!40000 ALTER TABLE `differential_viewtime` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_directory` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_directory` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_directory`; - --- --- Table structure for table `directory_category` --- - -DROP TABLE IF EXISTS `directory_category`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `directory_category` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `sequence` int(10) unsigned NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `directory_category` --- - -LOCK TABLES `directory_category` WRITE; -/*!40000 ALTER TABLE `directory_category` DISABLE KEYS */; -INSERT INTO `directory_category` VALUES (2,'Documentation',9000,1295318729,1304349639),(4,'Workflow',0,1295321164,1304349630),(5,'Utilities',100,1295321217,1295321217),(6,'Internals',2000,1295888559,1295888569); -/*!40000 ALTER TABLE `directory_category` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `directory_item` --- - -DROP TABLE IF EXISTS `directory_item`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `directory_item` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `description` text NOT NULL, - `href` varchar(255) NOT NULL, - `categoryID` int(10) unsigned NOT NULL, - `sequence` int(10) unsigned NOT NULL, - `imagePHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `directory_item` --- - -LOCK TABLES `directory_item` WRITE; -/*!40000 ALTER TABLE `directory_item` DISABLE KEYS */; -INSERT INTO `directory_item` VALUES (1,'Repositories','Configure tracked source code repositories.','/repository/',6,500,NULL,1304349659,1304349947),(5,'libphutil Docs','Soothing prose; seductive poetry.','http://phabricator.com/docs/libphutil/',2,300,'',1295312416,1304349695),(12,'Files','Blob store for Pokemon pictures.','/file/',5,100,'',1295321244,1304349844),(13,'Differential','Make code.','/differential/',4,100,'',1295321263,1304350150),(14,'PHID Manager','Manage PHIDs.','/phid/',6,400,'',1295762315,1304349943),(15,'People','User directory. Sort of a social utility.','/people/',5,400,'',1295830520,1304349833),(16,'Conduit Console','Web console for Conduit API.','/conduit/',6,100,'',1295888593,1304349910),(17,'MetaMTA','Yo dawg, we heard you like MTAs.','/mail/',6,300,'',1296006261,1304349936),(18,'XHProf','PHP profiling tool.','/xhprof/',6,600,NULL,1296684238,1304349951),(20,'Maniphest','Do meta-work instead of work.','/maniphest/',4,300,NULL,1297190663,1304349876),(21,'Arcanist Docs','Words have never been so finely crafted.','http://phabricator.com/docs/arcanist/',2,200,NULL,1304349712,1304349712),(22,'Phabricator Ducks','Oops, that should say \"Docs\".','http://phabricator.com/docs/phabricator/',2,100,NULL,1304349728,1304349728),(23,'Javelin Docs','O, what noble scribe hath penned these words?','http://phabricator.com/docs/javelin/',2,400,NULL,1304349746,1304349746),(24,'UI Examples','A gallery of modern art.','/uiexample/',2,500,NULL,1304349763,1304349769),(25,'Diffusion','Look at code.','/diffusion/',4,200,NULL,1304349788,1304349873),(26,'Herald','Watch for danger.','/herald/',4,400,NULL,1304349817,1304349817),(30,'Preferences','You are a snowflake princess.','/preferences/',5,600,NULL,1304350225,1304350307),(27,'Owners','Adopt today!','/owners/',5,500,NULL,1304349896,1304349896),(28,'Daemon Console','Offline process management.','/daemon/',6,200,NULL,1304349927,1304349927),(29,'XHPAST','XHP AST generator.','/xhpast/',6,700,NULL,1304350140,1304350140),(31,'Project','Group stuff into big piles.','/project/',5,500,NULL,1304350290,1304350299); -/*!40000 ALTER TABLE `directory_item` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_draft` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_draft` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_draft`; - --- --- Table structure for table `draft` --- - -DROP TABLE IF EXISTS `draft`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `draft` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `draftKey` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `draft` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `authorPHID` (`authorPHID`,`draftKey`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `draft` --- - -LOCK TABLES `draft` WRITE; -/*!40000 ALTER TABLE `draft` DISABLE KEYS */; -/*!40000 ALTER TABLE `draft` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_file` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_file` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_file`; - --- --- Table structure for table `file` --- - -DROP TABLE IF EXISTS `file`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `file` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(255) DEFAULT NULL, - `mimeType` varchar(255) DEFAULT NULL, - `byteSize` bigint(20) unsigned NOT NULL, - `storageEngine` varchar(32) NOT NULL, - `storageFormat` varchar(32) NOT NULL, - `storageHandle` varchar(255) NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `file` --- - -LOCK TABLES `file` WRITE; -/*!40000 ALTER TABLE `file` DISABLE KEYS */; -INSERT INTO `file` VALUES (1,'PHID-FILE-4d61229816cfe6f2b2a3','avatar','image/png; charset=binary\n',959,'blob','raw','1',1304350408,1304350408); -/*!40000 ALTER TABLE `file` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `file_imagemacro` --- - -DROP TABLE IF EXISTS `file_imagemacro`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `file_imagemacro` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `filePHID` varchar(64) NOT NULL, - `name` varchar(255) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `file_imagemacro` --- - -LOCK TABLES `file_imagemacro` WRITE; -/*!40000 ALTER TABLE `file_imagemacro` DISABLE KEYS */; -/*!40000 ALTER TABLE `file_imagemacro` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `file_storageblob` --- - -DROP TABLE IF EXISTS `file_storageblob`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `file_storageblob` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `data` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `file_storageblob` --- - -LOCK TABLES `file_storageblob` WRITE; -/*!40000 ALTER TABLE `file_storageblob` DISABLE KEYS */; -INSERT INTO `file_storageblob` VALUES (1,'PNG\r\n\Z\n\0\0\0\rIHDR\0\0\02\0\0\02\0\0\0]\0\0\0tRNS\0}\0\0C\"X\0\0tIDATxv@Ot%h4Q .,$NNnY3S/Gߵtn~.c[!X0^Pok<ζ)a(Ѱ{Ptiny_D,z#)Xxw^L0XgZvXAKU\nrUfQ}5T& #bMJ{] CX8ݹ=7Dѵ>QwMN7E`ЌЛ Z ]Qr3B7aG\"߈yU%UyQ&4aik`\nN\"VRjdm4tB\Z]?xT\0W!HB|ɿ&~6HɂI1ov牵c\r1yw,Ţ7ratpT Hiy Ν)Swz^9Dο&ˇ\nwfa~ wACR3+\rkk \nE6)̙)Ȓoh}:Q0 {L#p Yv.mgxQEɋC{K1o;|x%5aч11Sź>c3A9B! #\"<RECTT>BC&{wx>\0\r1(+,\'CWqJ~\0\0\0UH5\0\0\0\0IENDB`',1304350408,1304350408); -/*!40000 ALTER TABLE `file_storageblob` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_herald` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_herald` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_herald`; - --- --- Table structure for table `herald_action` --- - -DROP TABLE IF EXISTS `herald_action`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `herald_action` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ruleID` int(10) unsigned NOT NULL, - `action` varchar(255) NOT NULL, - `target` text NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `herald_action` --- - -LOCK TABLES `herald_action` WRITE; -/*!40000 ALTER TABLE `herald_action` DISABLE KEYS */; -/*!40000 ALTER TABLE `herald_action` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `herald_condition` --- - -DROP TABLE IF EXISTS `herald_condition`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `herald_condition` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `ruleID` int(10) unsigned NOT NULL, - `fieldName` varchar(255) NOT NULL, - `fieldCondition` varchar(255) NOT NULL, - `value` text NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `herald_condition` --- - -LOCK TABLES `herald_condition` WRITE; -/*!40000 ALTER TABLE `herald_condition` DISABLE KEYS */; -/*!40000 ALTER TABLE `herald_condition` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `herald_rule` --- - -DROP TABLE IF EXISTS `herald_rule`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `herald_rule` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `contentType` varchar(255) NOT NULL, - `mustMatchAll` tinyint(1) NOT NULL, - `configVersion` int(10) unsigned NOT NULL DEFAULT '1', - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `authorPHID` (`authorPHID`,`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `herald_rule` --- - -LOCK TABLES `herald_rule` WRITE; -/*!40000 ALTER TABLE `herald_rule` DISABLE KEYS */; -/*!40000 ALTER TABLE `herald_rule` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `herald_transcript` --- - -DROP TABLE IF EXISTS `herald_transcript`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `herald_transcript` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `time` int(10) unsigned NOT NULL, - `host` varchar(255) NOT NULL, - `psth` varchar(255) NOT NULL, - `duration` float NOT NULL, - `objectPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `dryRun` tinyint(1) NOT NULL, - `objectTranscript` longblob NOT NULL, - `ruleTranscripts` longblob NOT NULL, - `conditionTranscripts` longblob NOT NULL, - `applyTranscripts` longblob NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`), - KEY `objectPHID` (`objectPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `herald_transcript` --- - -LOCK TABLES `herald_transcript` WRITE; -/*!40000 ALTER TABLE `herald_transcript` DISABLE KEYS */; -/*!40000 ALTER TABLE `herald_transcript` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_maniphest` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_maniphest` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_maniphest`; - --- --- Table structure for table `maniphest_task` --- - -DROP TABLE IF EXISTS `maniphest_task`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `maniphest_task` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `ownerPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `ccPHIDs` text, - `attached` longtext NOT NULL, - `status` int(10) unsigned NOT NULL, - `priority` int(10) unsigned NOT NULL, - `title` text NOT NULL, - `description` longtext NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `projectPHIDs` longblob NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `maniphest_task` --- - -LOCK TABLES `maniphest_task` WRITE; -/*!40000 ALTER TABLE `maniphest_task` DISABLE KEYS */; -/*!40000 ALTER TABLE `maniphest_task` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `maniphest_touch` --- - -DROP TABLE IF EXISTS `maniphest_touch`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `maniphest_touch` ( - `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `taskID` int(10) unsigned NOT NULL, - `touchedAt` int(10) unsigned NOT NULL, - PRIMARY KEY (`userPHID`,`taskID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `maniphest_touch` --- - -LOCK TABLES `maniphest_touch` WRITE; -/*!40000 ALTER TABLE `maniphest_touch` DISABLE KEYS */; -/*!40000 ALTER TABLE `maniphest_touch` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `maniphest_transaction` --- - -DROP TABLE IF EXISTS `maniphest_transaction`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `maniphest_transaction` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `taskID` int(10) unsigned NOT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `transactionType` varchar(16) NOT NULL, - `oldValue` longblob, - `newValue` longblob, - `comments` longblob, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `cache` longblob, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `maniphest_transaction` --- - -LOCK TABLES `maniphest_transaction` WRITE; -/*!40000 ALTER TABLE `maniphest_transaction` DISABLE KEYS */; -/*!40000 ALTER TABLE `maniphest_transaction` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_meta_data` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_meta_data` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_meta_data`; - --- --- Table structure for table `schema_version` --- - -DROP TABLE IF EXISTS `schema_version`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `schema_version` ( - `version` int(11) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `schema_version` --- - -LOCK TABLES `schema_version` WRITE; -/*!40000 ALTER TABLE `schema_version` DISABLE KEYS */; -INSERT INTO `schema_version` VALUES (33); -/*!40000 ALTER TABLE `schema_version` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_metamta` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_metamta` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_metamta`; - --- --- Table structure for table `metamta_mail` --- - -DROP TABLE IF EXISTS `metamta_mail`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `metamta_mail` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `parameters` longblob NOT NULL, - `status` varchar(255) NOT NULL, - `message` text, - `retryCount` int(10) unsigned NOT NULL, - `nextRetry` int(10) unsigned NOT NULL, - `relatedPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `status` (`status`,`nextRetry`), - KEY `relatedPHID` (`relatedPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `metamta_mail` --- - -LOCK TABLES `metamta_mail` WRITE; -/*!40000 ALTER TABLE `metamta_mail` DISABLE KEYS */; -/*!40000 ALTER TABLE `metamta_mail` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `metamta_mailinglist` --- - -DROP TABLE IF EXISTS `metamta_mailinglist`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `metamta_mailinglist` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(255) NOT NULL, - `email` varchar(255) NOT NULL, - `uri` varchar(255) DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`), - UNIQUE KEY `email` (`email`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `metamta_mailinglist` --- - -LOCK TABLES `metamta_mailinglist` WRITE; -/*!40000 ALTER TABLE `metamta_mailinglist` DISABLE KEYS */; -/*!40000 ALTER TABLE `metamta_mailinglist` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_owners` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_owners` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_owners`; - --- --- Table structure for table `owners_owner` --- - -DROP TABLE IF EXISTS `owners_owner`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `owners_owner` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `packageID` int(10) unsigned NOT NULL, - `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `packageID` (`packageID`,`userPHID`), - KEY `userPHID` (`userPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `owners_owner` --- - -LOCK TABLES `owners_owner` WRITE; -/*!40000 ALTER TABLE `owners_owner` DISABLE KEYS */; -/*!40000 ALTER TABLE `owners_owner` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `owners_package` --- - -DROP TABLE IF EXISTS `owners_package`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `owners_package` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(255) NOT NULL, - `description` text NOT NULL, - `primaryOwnerPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `owners_package` --- - -LOCK TABLES `owners_package` WRITE; -/*!40000 ALTER TABLE `owners_package` DISABLE KEYS */; -/*!40000 ALTER TABLE `owners_package` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `owners_path` --- - -DROP TABLE IF EXISTS `owners_path`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `owners_path` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `packageID` int(10) unsigned NOT NULL, - `repositoryPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `path` varchar(255) NOT NULL, - PRIMARY KEY (`id`), - KEY `packageID` (`packageID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `owners_path` --- - -LOCK TABLES `owners_path` WRITE; -/*!40000 ALTER TABLE `owners_path` DISABLE KEYS */; -/*!40000 ALTER TABLE `owners_path` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_phid` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_phid` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_phid`; - --- --- Table structure for table `phid` --- - -DROP TABLE IF EXISTS `phid`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `phid` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `phidType` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `parentPHID` varchar(64) DEFAULT NULL, - `ownerPHID` varchar(64) DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `phid` --- - -LOCK TABLES `phid` WRITE; -/*!40000 ALTER TABLE `phid` DISABLE KEYS */; -INSERT INTO `phid` VALUES (1,'PHID-FILE-4d61229816cfe6f2b2a3','FILE',NULL,NULL,1304350408,1304350408); -/*!40000 ALTER TABLE `phid` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_project` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_project` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_project`; - --- --- Table structure for table `project` --- - -DROP TABLE IF EXISTS `project`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `project` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `project` --- - -LOCK TABLES `project` WRITE; -/*!40000 ALTER TABLE `project` DISABLE KEYS */; -/*!40000 ALTER TABLE `project` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `project_affiliation` --- - -DROP TABLE IF EXISTS `project_affiliation`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `project_affiliation` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `projectPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `role` varchar(255) NOT NULL, - `status` varchar(32) NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `projectPHID` (`projectPHID`,`userPHID`), - KEY `userPHID` (`userPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `project_affiliation` --- - -LOCK TABLES `project_affiliation` WRITE; -/*!40000 ALTER TABLE `project_affiliation` DISABLE KEYS */; -/*!40000 ALTER TABLE `project_affiliation` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `project_profile` --- - -DROP TABLE IF EXISTS `project_profile`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `project_profile` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `projectPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `blurb` longtext NOT NULL, - `profileImagePHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `projectPHID` (`projectPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `project_profile` --- - -LOCK TABLES `project_profile` WRITE; -/*!40000 ALTER TABLE `project_profile` DISABLE KEYS */; -/*!40000 ALTER TABLE `project_profile` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_repository` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_repository` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_repository`; - --- --- Table structure for table `repository` --- - -DROP TABLE IF EXISTS `repository`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(255) NOT NULL, - `callsign` varchar(32) NOT NULL, - `description` text, - `versionControlSystem` varchar(32) NOT NULL, - `details` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `uuid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `callsign` (`callsign`), - UNIQUE KEY `phid` (`phid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository` --- - -LOCK TABLES `repository` WRITE; -/*!40000 ALTER TABLE `repository` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_arcanistproject` --- - -DROP TABLE IF EXISTS `repository_arcanistproject`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_arcanistproject` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `name` varchar(255) NOT NULL, - `repositoryID` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_arcanistproject` --- - -LOCK TABLES `repository_arcanistproject` WRITE; -/*!40000 ALTER TABLE `repository_arcanistproject` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_arcanistproject` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_badcommit` --- - -DROP TABLE IF EXISTS `repository_badcommit`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_badcommit` ( - `fullCommitName` varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `description` longblob NOT NULL, - PRIMARY KEY (`fullCommitName`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_badcommit` --- - -LOCK TABLES `repository_badcommit` WRITE; -/*!40000 ALTER TABLE `repository_badcommit` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_badcommit` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_commit` --- - -DROP TABLE IF EXISTS `repository_commit`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_commit` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `repositoryID` int(10) unsigned NOT NULL, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `commitIdentifier` varchar(40) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `epoch` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `phid` (`phid`), - UNIQUE KEY `repositoryID` (`repositoryID`,`commitIdentifier`(16)), - KEY `repositoryID_2` (`repositoryID`,`epoch`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_commit` --- - -LOCK TABLES `repository_commit` WRITE; -/*!40000 ALTER TABLE `repository_commit` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_commit` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_commitdata` --- - -DROP TABLE IF EXISTS `repository_commitdata`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_commitdata` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `commitID` int(10) unsigned NOT NULL, - `authorName` varchar(255) NOT NULL, - `commitMessage` longblob NOT NULL, - `commitDetails` longblob NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `commitID` (`commitID`), - KEY `authorName` (`authorName`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_commitdata` --- - -LOCK TABLES `repository_commitdata` WRITE; -/*!40000 ALTER TABLE `repository_commitdata` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_commitdata` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_filesystem` --- - -DROP TABLE IF EXISTS `repository_filesystem`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_filesystem` ( - `repositoryID` int(10) unsigned NOT NULL, - `parentID` int(10) unsigned NOT NULL, - `svnCommit` int(10) unsigned NOT NULL, - `pathID` int(10) unsigned NOT NULL, - `existed` tinyint(1) NOT NULL, - `fileType` int(10) unsigned NOT NULL, - PRIMARY KEY (`repositoryID`,`parentID`,`pathID`,`svnCommit`), - KEY `repositoryID` (`repositoryID`,`svnCommit`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_filesystem` --- - -LOCK TABLES `repository_filesystem` WRITE; -/*!40000 ALTER TABLE `repository_filesystem` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_filesystem` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_githubnotification` --- - -DROP TABLE IF EXISTS `repository_githubnotification`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_githubnotification` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `repositoryPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `remoteAddress` varchar(32) NOT NULL, - `payload` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - KEY `repositoryPHID` (`repositoryPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_githubnotification` --- - -LOCK TABLES `repository_githubnotification` WRITE; -/*!40000 ALTER TABLE `repository_githubnotification` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_githubnotification` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_path` --- - -DROP TABLE IF EXISTS `repository_path`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_path` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `path` varchar(512) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `path` (`path`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_path` --- - -LOCK TABLES `repository_path` WRITE; -/*!40000 ALTER TABLE `repository_path` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_path` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_pathchange` --- - -DROP TABLE IF EXISTS `repository_pathchange`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_pathchange` ( - `repositoryID` int(10) unsigned NOT NULL, - `pathID` int(10) unsigned NOT NULL, - `commitID` int(10) unsigned NOT NULL, - `targetPathID` int(10) unsigned DEFAULT NULL, - `targetCommitID` int(10) unsigned DEFAULT NULL, - `changeType` int(10) unsigned NOT NULL, - `fileType` int(10) unsigned NOT NULL, - `isDirect` tinyint(1) NOT NULL, - `commitSequence` int(10) unsigned NOT NULL, - PRIMARY KEY (`commitID`,`pathID`), - KEY `repositoryID` (`repositoryID`,`pathID`,`commitSequence`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_pathchange` --- - -LOCK TABLES `repository_pathchange` WRITE; -/*!40000 ALTER TABLE `repository_pathchange` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_pathchange` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_shortcut` --- - -DROP TABLE IF EXISTS `repository_shortcut`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_shortcut` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(255) NOT NULL, - `href` varchar(255) NOT NULL, - `description` varchar(255) NOT NULL, - `sequence` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_shortcut` --- - -LOCK TABLES `repository_shortcut` WRITE; -/*!40000 ALTER TABLE `repository_shortcut` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_shortcut` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `repository_summary` --- - -DROP TABLE IF EXISTS `repository_summary`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `repository_summary` ( - `repositoryID` int(10) unsigned NOT NULL, - `size` int(10) unsigned NOT NULL, - `lastCommitID` int(10) unsigned NOT NULL, - `epoch` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`repositoryID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `repository_summary` --- - -LOCK TABLES `repository_summary` WRITE; -/*!40000 ALTER TABLE `repository_summary` DISABLE KEYS */; -/*!40000 ALTER TABLE `repository_summary` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_search` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_search` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_search`; - --- --- Table structure for table `search_document` --- - -DROP TABLE IF EXISTS `search_document`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `search_document` ( - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `documentType` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `documentTitle` varchar(255) NOT NULL, - `documentCreated` int(10) unsigned NOT NULL, - `documentModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`phid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `search_document` --- - -LOCK TABLES `search_document` WRITE; -/*!40000 ALTER TABLE `search_document` DISABLE KEYS */; -/*!40000 ALTER TABLE `search_document` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `search_documentfield` --- - -DROP TABLE IF EXISTS `search_documentfield`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `search_documentfield` ( - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `phidType` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `field` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `auxPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `corpus` text, - KEY `phid` (`phid`), - FULLTEXT KEY `corpus` (`corpus`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `search_documentfield` --- - -LOCK TABLES `search_documentfield` WRITE; -/*!40000 ALTER TABLE `search_documentfield` DISABLE KEYS */; -/*!40000 ALTER TABLE `search_documentfield` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `search_documentrelationship` --- - -DROP TABLE IF EXISTS `search_documentrelationship`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `search_documentrelationship` ( - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `relatedPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `relation` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `relatedType` varchar(4) NOT NULL, - `relatedTime` int(10) unsigned NOT NULL, - KEY `phid` (`phid`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `search_documentrelationship` --- - -LOCK TABLES `search_documentrelationship` WRITE; -/*!40000 ALTER TABLE `search_documentrelationship` DISABLE KEYS */; -/*!40000 ALTER TABLE `search_documentrelationship` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `search_query` --- - -DROP TABLE IF EXISTS `search_query`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `search_query` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `query` varchar(255) NOT NULL, - `parameters` text NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `search_query` --- - -LOCK TABLES `search_query` WRITE; -/*!40000 ALTER TABLE `search_query` DISABLE KEYS */; -/*!40000 ALTER TABLE `search_query` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_timeline` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_timeline` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_timeline`; - --- --- Table structure for table `timeline_cursor` --- - -DROP TABLE IF EXISTS `timeline_cursor`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `timeline_cursor` ( - `name` varchar(255) NOT NULL, - `position` int(10) unsigned NOT NULL, - PRIMARY KEY (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `timeline_cursor` --- - -LOCK TABLES `timeline_cursor` WRITE; -/*!40000 ALTER TABLE `timeline_cursor` DISABLE KEYS */; -INSERT INTO `timeline_cursor` VALUES ('cmittask',0); -/*!40000 ALTER TABLE `timeline_cursor` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `timeline_event` --- - -DROP TABLE IF EXISTS `timeline_event`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `timeline_event` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `type` char(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `dataID` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `dataID` (`dataID`), - KEY `type` (`type`,`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `timeline_event` --- - -LOCK TABLES `timeline_event` WRITE; -/*!40000 ALTER TABLE `timeline_event` DISABLE KEYS */; -/*!40000 ALTER TABLE `timeline_event` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `timeline_eventdata` --- - -DROP TABLE IF EXISTS `timeline_eventdata`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `timeline_eventdata` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `eventData` longblob NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `timeline_eventdata` --- - -LOCK TABLES `timeline_eventdata` WRITE; -/*!40000 ALTER TABLE `timeline_eventdata` DISABLE KEYS */; -/*!40000 ALTER TABLE `timeline_eventdata` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_user` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_user` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_user`; - --- --- Table structure for table `phabricator_session` --- - -DROP TABLE IF EXISTS `phabricator_session`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `phabricator_session` ( - `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `type` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `sessionKey` varchar(40) NOT NULL, - `sessionStart` int(10) unsigned NOT NULL, - PRIMARY KEY (`userPHID`,`type`), - UNIQUE KEY `sessionKey` (`sessionKey`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `phabricator_session` --- - -LOCK TABLES `phabricator_session` WRITE; -/*!40000 ALTER TABLE `phabricator_session` DISABLE KEYS */; -/*!40000 ALTER TABLE `phabricator_session` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `user` --- - -DROP TABLE IF EXISTS `user`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `userName` varchar(64) NOT NULL, - `realName` varchar(128) NOT NULL, - `email` varchar(255) NOT NULL, - `passwordSalt` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `passwordHash` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `profileImagePHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `consoleEnabled` tinyint(1) NOT NULL, - `consoleVisible` tinyint(1) NOT NULL, - `consoleTab` varchar(64) NOT NULL, - `conduitCertificate` varchar(255) NOT NULL, - `isSystemAgent` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`id`), - UNIQUE KEY `userName` (`userName`), - UNIQUE KEY `email` (`email`), - UNIQUE KEY `phid` (`phid`), - KEY `realName` (`realName`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `user` --- - -LOCK TABLES `user` WRITE; -/*!40000 ALTER TABLE `user` DISABLE KEYS */; -/*!40000 ALTER TABLE `user` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `user_oauthinfo` --- - -DROP TABLE IF EXISTS `user_oauthinfo`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user_oauthinfo` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `userID` int(10) unsigned NOT NULL, - `oauthProvider` varchar(255) NOT NULL, - `oauthUID` varchar(255) NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - `accountURI` varchar(255) DEFAULT NULL, - `accountName` varchar(255) DEFAULT NULL, - `token` varchar(255) DEFAULT NULL, - `tokenExpires` int(10) unsigned DEFAULT NULL, - `tokenScope` varchar(255) DEFAULT NULL, - `tokenStatus` varchar(255) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `userID` (`userID`,`oauthProvider`), - UNIQUE KEY `oauthProvider` (`oauthProvider`,`oauthUID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `user_oauthinfo` --- - -LOCK TABLES `user_oauthinfo` WRITE; -/*!40000 ALTER TABLE `user_oauthinfo` DISABLE KEYS */; -/*!40000 ALTER TABLE `user_oauthinfo` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `user_preferences` --- - -DROP TABLE IF EXISTS `user_preferences`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user_preferences` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `preferences` longblob NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `userPHID` (`userPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `user_preferences` --- - -LOCK TABLES `user_preferences` WRITE; -/*!40000 ALTER TABLE `user_preferences` DISABLE KEYS */; -/*!40000 ALTER TABLE `user_preferences` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `user_profile` --- - -DROP TABLE IF EXISTS `user_profile`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `user_profile` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, - `title` varchar(255) NOT NULL, - `blurb` text NOT NULL, - `profileImagePHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `userPHID` (`userPHID`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `user_profile` --- - -LOCK TABLES `user_profile` WRITE; -/*!40000 ALTER TABLE `user_profile` DISABLE KEYS */; -/*!40000 ALTER TABLE `user_profile` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_worker` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_worker` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_worker`; - --- --- Table structure for table `worker_task` --- - -DROP TABLE IF EXISTS `worker_task`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `worker_task` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `taskClass` varchar(255) NOT NULL, - `leaseOwner` varchar(255) DEFAULT NULL, - `leaseExpires` int(10) unsigned DEFAULT NULL, - `failureCount` int(10) unsigned NOT NULL, - `dataID` int(10) unsigned DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `dataID` (`dataID`), - KEY `taskClass` (`taskClass`), - KEY `leaseExpires` (`leaseExpires`), - KEY `leaseOwner` (`leaseOwner`(16)) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `worker_task` --- - -LOCK TABLES `worker_task` WRITE; -/*!40000 ALTER TABLE `worker_task` DISABLE KEYS */; -/*!40000 ALTER TABLE `worker_task` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `worker_taskdata` --- - -DROP TABLE IF EXISTS `worker_taskdata`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `worker_taskdata` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `data` longblob NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `worker_taskdata` --- - -LOCK TABLES `worker_taskdata` WRITE; -/*!40000 ALTER TABLE `worker_taskdata` DISABLE KEYS */; -/*!40000 ALTER TABLE `worker_taskdata` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Current Database: `phabricator_xhpastview` --- - -CREATE DATABASE /*!32312 IF NOT EXISTS*/ `phabricator_xhpastview` /*!40100 DEFAULT CHARACTER SET latin1 */; - -USE `phabricator_xhpastview`; - --- --- Table structure for table `xhpastview_parsetree` --- - -DROP TABLE IF EXISTS `xhpastview_parsetree`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `xhpastview_parsetree` ( - `id` int(10) unsigned NOT NULL AUTO_INCREMENT, - `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, - `input` longblob NOT NULL, - `stdout` longblob NOT NULL, - `dateCreated` int(10) unsigned NOT NULL, - `dateModified` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `xhpastview_parsetree` --- - -LOCK TABLES `xhpastview_parsetree` WRITE; -/*!40000 ALTER TABLE `xhpastview_parsetree` DISABLE KEYS */; -/*!40000 ALTER TABLE `xhpastview_parsetree` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2011-05-02 8:36:07 diff --git a/resources/sql/patches/000.project.sql b/resources/sql/patches/000.project.sql index 2f4cf2c89a..6013c6c30d 100644 --- a/resources/sql/patches/000.project.sql +++ b/resources/sql/patches/000.project.sql @@ -1,5 +1,5 @@ -create database phabricator_project; -create table phabricator_project.project ( + +create table {$NAMESPACE}_project.project ( id int unsigned not null auto_increment primary key, name varchar(255) not null, unique key (name), @@ -8,7 +8,7 @@ create table phabricator_project.project ( dateCreated int unsigned not null, dateModified int unsigned not null ); -create table phabricator_project.project_profile ( +create table {$NAMESPACE}_project.project_profile ( id int unsigned not null auto_increment primary key, projectPHID varchar(64) binary not null, unique key (projectPHID), @@ -17,7 +17,7 @@ create table phabricator_project.project_profile ( dateCreated int unsigned not null, dateModified int unsigned not null ); -create table phabricator_project.project_affiliation ( +create table {$NAMESPACE}_project.project_affiliation ( id int unsigned not null auto_increment primary key, projectPHID varchar(64) binary not null, userPHID varchar(64) binary not null, diff --git a/resources/sql/patches/0000.legacy.sql b/resources/sql/patches/0000.legacy.sql new file mode 100644 index 0000000000..031e472f0e --- /dev/null +++ b/resources/sql/patches/0000.legacy.sql @@ -0,0 +1,762 @@ + + + + + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + + + + + + + +USE `{$NAMESPACE}_conduit`; + + + + + +DROP TABLE IF EXISTS `conduit_connectionlog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `conduit_connectionlog` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `client` varchar(255) DEFAULT NULL, + `clientVersion` varchar(255) DEFAULT NULL, + `clientDescription` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `conduit_methodcalllog`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `conduit_methodcalllog` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `connectionID` bigint(20) unsigned DEFAULT NULL, + `method` varchar(255) NOT NULL, + `error` varchar(255) NOT NULL, + `duration` bigint(20) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_differential`; + + + + + +DROP TABLE IF EXISTS `differential_changeset`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_changeset` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `diffID` int(10) unsigned NOT NULL, + `oldFile` varchar(255) DEFAULT NULL, + `fileName` varchar(255) NOT NULL, + `awayPaths` longblob, + `changeType` int(10) unsigned NOT NULL, + `fileType` int(10) unsigned NOT NULL, + `metadata` longblob, + `oldProperties` longblob, + `newProperties` longblob, + `addLines` int(10) unsigned NOT NULL, + `delLines` int(10) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_changeset_parse_cache`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_changeset_parse_cache` ( + `id` int(10) unsigned NOT NULL, + `cache` longblob NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_comment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_comment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `revisionID` int(10) unsigned NOT NULL, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `action` varchar(64) NOT NULL, + `content` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `cache` longblob, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_diff`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_diff` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `revisionID` int(10) unsigned DEFAULT NULL, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `sourceMachine` varchar(255) DEFAULT NULL, + `sourcePath` varchar(255) DEFAULT NULL, + `sourceControlSystem` varchar(64) DEFAULT NULL, + `sourceControlBaseRevision` varchar(255) DEFAULT NULL, + `sourceControlpath` varchar(255) DEFAULT NULL, + `lintStatus` int(10) unsigned NOT NULL, + `unitStatus` int(10) unsigned NOT NULL, + `lineCount` int(10) unsigned NOT NULL, + `branch` varchar(255) DEFAULT NULL, + `parentRevisionID` int(10) unsigned DEFAULT NULL, + `arcanistProject` varchar(255) DEFAULT NULL, + `creationMethod` varchar(255) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `description` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_diffproperty`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_diffproperty` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `diffID` int(10) unsigned NOT NULL, + `name` varchar(255) NOT NULL, + `data` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_hunk`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_hunk` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `changesetID` int(10) unsigned NOT NULL, + `changes` longblob, + `oldOffset` int(10) unsigned NOT NULL, + `oldLen` int(10) unsigned NOT NULL, + `newOffset` int(10) unsigned NOT NULL, + `newLen` int(10) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_inlinecomment`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_inlinecomment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `revisionID` int(10) unsigned NOT NULL, + `commentID` int(10) unsigned DEFAULT NULL, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `changesetID` int(10) unsigned NOT NULL, + `isNewFile` tinyint(1) NOT NULL, + `lineNumber` int(10) unsigned NOT NULL, + `lineLength` int(10) unsigned NOT NULL, + `content` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `cache` longblob, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_relationship`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_relationship` ( + `revisionID` int(10) unsigned NOT NULL, + `relation` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `objectPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `sequence` int(10) unsigned NOT NULL, + `reasonPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + PRIMARY KEY (`revisionID`,`relation`,`objectPHID`), + KEY `objectPHID` (`objectPHID`,`relation`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `differential_revision`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `differential_revision` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `status` varchar(32) NOT NULL, + `summary` longtext NOT NULL, + `testPlan` text NOT NULL, + `revertPlan` text NOT NULL, + `blameRevision` varchar(255) NOT NULL, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `dateCommitted` int(10) unsigned DEFAULT NULL, + `lineCount` int(10) unsigned DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `attached` longtext NOT NULL, + `unsubscribed` longblob NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_draft`; + + + + + +DROP TABLE IF EXISTS `draft`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `draft` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `draftKey` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `draft` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `authorPHID` (`authorPHID`,`draftKey`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_file`; + + + + + +DROP TABLE IF EXISTS `file`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(255) DEFAULT NULL, + `mimeType` varchar(255) DEFAULT NULL, + `byteSize` bigint(20) unsigned NOT NULL, + `storageEngine` varchar(32) NOT NULL, + `storageFormat` varchar(32) NOT NULL, + `storageHandle` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `file_storageblob`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `file_storageblob` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `data` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_metamta`; + + + + + +DROP TABLE IF EXISTS `metamta_mail`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `metamta_mail` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parameters` longblob NOT NULL, + `status` varchar(255) NOT NULL, + `message` text, + `retryCount` int(10) unsigned NOT NULL, + `nextRetry` int(10) unsigned NOT NULL, + `relatedPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `metamta_mailinglist`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `metamta_mailinglist` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `uri` varchar(255) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_phid`; + + + + + +DROP TABLE IF EXISTS `phid`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `phid` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `phidType` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `parentPHID` varchar(64) DEFAULT NULL, + `ownerPHID` varchar(64) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `phid_type`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `phid_type` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `type` varchar(4) NOT NULL, + `name` varchar(255) NOT NULL, + `description` text, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `type` (`type`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_user`; + + + + + +DROP TABLE IF EXISTS `phabricator_session`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `phabricator_session` ( + `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `type` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `sessionKey` varchar(40) NOT NULL, + `sessionStart` int(10) unsigned NOT NULL, + PRIMARY KEY (`userPHID`,`type`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `user`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `userName` varchar(64) NOT NULL, + `realName` varchar(128) NOT NULL, + `email` varchar(255) NOT NULL, + `passwordSalt` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `passwordHash` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `facebookUID` bigint(20) unsigned DEFAULT NULL, + `profileImagePHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `consoleEnabled` tinyint(1) NOT NULL, + `consoleVisible` tinyint(1) NOT NULL, + `consoleTab` varchar(64) NOT NULL, + `conduitCertificate` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `userName` (`userName`), + UNIQUE KEY `email` (`email`), + UNIQUE KEY `facebookUID` (`facebookUID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `user_profile`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `user_profile` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `title` varchar(255) NOT NULL, + `blurb` text NOT NULL, + `profileImagePHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `userPHID` (`userPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_file`; + + + + + +DROP TABLE IF EXISTS `file`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(255) DEFAULT NULL, + `mimeType` varchar(255) DEFAULT NULL, + `byteSize` bigint(20) unsigned NOT NULL, + `storageEngine` varchar(32) NOT NULL, + `storageFormat` varchar(32) NOT NULL, + `storageHandle` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `file_storageblob`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `file_storageblob` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `data` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_repository`; + + + + + +DROP TABLE IF EXISTS `repository`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `repository` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `name` varchar(255) NOT NULL, + `callsign` varchar(32) NOT NULL, + `description` text, + `versionControlSystem` varchar(32) NOT NULL, + `details` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `callsign` (`callsign`), + UNIQUE KEY `phid` (`phid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `repository_githubnotification`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `repository_githubnotification` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repositoryPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `remoteAddress` varchar(32) NOT NULL, + `payload` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `repositoryPHID` (`repositoryPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_search`; + + + + + +DROP TABLE IF EXISTS `search_document`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `search_document` ( + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `documentType` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `documentTitle` varchar(255) NOT NULL, + `documentCreated` int(10) unsigned NOT NULL, + `documentModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`phid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `search_documentfield`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `search_documentfield` ( + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `phidType` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `field` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `auxPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `corpus` text, + KEY `phid` (`phid`), + FULLTEXT KEY `corpus` (`corpus`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `search_documentrelationship`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `search_documentrelationship` ( + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `relatedPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `relation` varchar(4) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `relatedType` varchar(4) NOT NULL, + `relatedTime` int(10) unsigned NOT NULL, + KEY `phid` (`phid`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `search_query`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `search_query` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `query` varchar(255) NOT NULL, + `parameters` text NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + + + +USE `{$NAMESPACE}_maniphest`; + + + + + +DROP TABLE IF EXISTS `maniphest_task`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `maniphest_task` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `ownerPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL, + `ccPHIDs` text, + `attached` longtext NOT NULL, + `status` int(10) unsigned NOT NULL, + `priority` int(10) unsigned NOT NULL, + `title` text NOT NULL, + `description` longtext NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `maniphest_touch`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `maniphest_touch` ( + `userPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `taskID` int(10) unsigned NOT NULL, + `touchedAt` int(10) unsigned NOT NULL, + PRIMARY KEY (`userPHID`,`taskID`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + + + + + +DROP TABLE IF EXISTS `maniphest_transaction`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `maniphest_transaction` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `taskID` int(10) unsigned NOT NULL, + `authorPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, + `transactionType` varchar(16) NOT NULL, + `oldValue` longblob, + `newValue` longblob, + `comments` longblob, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `cache` longblob, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; diff --git a/resources/sql/patches/001.maniphest_projects.sql b/resources/sql/patches/001.maniphest_projects.sql index 00facb8bc9..49d540e678 100644 --- a/resources/sql/patches/001.maniphest_projects.sql +++ b/resources/sql/patches/001.maniphest_projects.sql @@ -1,2 +1,2 @@ -alter table phabricator_maniphest.maniphest_task add projectPHIDs longblob not null; -update phabricator_maniphest.maniphest_task set projectPHIDs = '[]'; +alter table {$NAMESPACE}_maniphest.maniphest_task add projectPHIDs longblob not null; +update {$NAMESPACE}_maniphest.maniphest_task set projectPHIDs = '[]'; diff --git a/resources/sql/patches/002.oauth.sql b/resources/sql/patches/002.oauth.sql index 7cdaeb0a73..bacd1872a6 100644 --- a/resources/sql/patches/002.oauth.sql +++ b/resources/sql/patches/002.oauth.sql @@ -1,4 +1,4 @@ -create table phabricator_user.user_oauthinfo ( +create table {$NAMESPACE}_user.user_oauthinfo ( id int unsigned not null auto_increment primary key, userID int unsigned not null, oauthProvider varchar(255) not null, @@ -9,10 +9,10 @@ create table phabricator_user.user_oauthinfo ( dateModified int unsigned not null ); -insert into phabricator_user.user_oauthinfo +insert into {$NAMESPACE}_user.user_oauthinfo (userID, oauthProvider, oauthUID, dateCreated, dateModified) SELECT id, 'facebook', facebookUID, UNIX_TIMESTAMP(), UNIX_TIMESTAMP() - FROM phabricator_user.user + FROM {$NAMESPACE}_user.user WHERE facebookUID is not null; -alter table phabricator_user.user drop facebookUID; \ No newline at end of file +alter table {$NAMESPACE}_user.user drop facebookUID; \ No newline at end of file diff --git a/resources/sql/patches/003.more_oauth.sql b/resources/sql/patches/003.more_oauth.sql index 6a10199e0a..f6fdd02107 100644 --- a/resources/sql/patches/003.more_oauth.sql +++ b/resources/sql/patches/003.more_oauth.sql @@ -1,6 +1,6 @@ -alter table phabricator_user.user_oauthinfo add accountURI varchar(255); -alter table phabricator_user.user_oauthinfo add accountName varchar(255); -alter table phabricator_user.user_oauthinfo add token varchar(255); -alter table phabricator_user.user_oauthinfo add tokenExpires int unsigned; -alter table phabricator_user.user_oauthinfo add tokenScope varchar(255); -alter table phabricator_user.user_oauthinfo add tokenStatus varchar(255); +alter table {$NAMESPACE}_user.user_oauthinfo add accountURI varchar(255); +alter table {$NAMESPACE}_user.user_oauthinfo add accountName varchar(255); +alter table {$NAMESPACE}_user.user_oauthinfo add token varchar(255); +alter table {$NAMESPACE}_user.user_oauthinfo add tokenExpires int unsigned; +alter table {$NAMESPACE}_user.user_oauthinfo add tokenScope varchar(255); +alter table {$NAMESPACE}_user.user_oauthinfo add tokenStatus varchar(255); diff --git a/resources/sql/patches/004.daemonrepos.sql b/resources/sql/patches/004.daemonrepos.sql index 9108c92cb8..f3e472bc4b 100644 --- a/resources/sql/patches/004.daemonrepos.sql +++ b/resources/sql/patches/004.daemonrepos.sql @@ -1,4 +1,4 @@ -create table phabricator_repository.repository_commit ( +create table {$NAMESPACE}_repository.repository_commit ( id int unsigned not null auto_increment primary key, repositoryPHID varchar(64) binary not null, phid varchar(64) binary not null, @@ -8,21 +8,21 @@ create table phabricator_repository.repository_commit ( unique key (repositoryPHID, commitIdentifier) ); -create database phabricator_timeline; -create table phabricator_timeline.timeline_event ( + +create table {$NAMESPACE}_timeline.timeline_event ( id int unsigned not null auto_increment primary key, type char(4) binary not null, key (type, id) ); -create table phabricator_timeline.timeline_eventdata ( +create table {$NAMESPACE}_timeline.timeline_eventdata ( id int unsigned not null auto_increment primary key, eventID int unsigned not null, eventData longblob not null, unique key (eventID) ); -create table phabricator_timeline.timeline_cursor ( +create table {$NAMESPACE}_timeline.timeline_cursor ( name varchar(255) not null primary key, position int unsigned not null ); \ No newline at end of file diff --git a/resources/sql/patches/005.workers.sql b/resources/sql/patches/005.workers.sql index f3ddb00731..29d402f20f 100644 --- a/resources/sql/patches/005.workers.sql +++ b/resources/sql/patches/005.workers.sql @@ -1,6 +1,6 @@ -create database phabricator_worker; -create table phabricator_worker.worker_task ( + +create table {$NAMESPACE}_worker.worker_task ( id int unsigned not null auto_increment primary key, taskClass varchar(255) not null, leaseOwner varchar(255), @@ -12,7 +12,7 @@ create table phabricator_worker.worker_task ( key(leaseExpires) ); -create table phabricator_worker.worker_taskdata ( +create table {$NAMESPACE}_worker.worker_taskdata ( id int unsigned not null auto_increment primary key, taskID int unsigned not null, data longblob not null, diff --git a/resources/sql/patches/006.repository.sql b/resources/sql/patches/006.repository.sql index 0b95ef8280..b391925d11 100644 --- a/resources/sql/patches/006.repository.sql +++ b/resources/sql/patches/006.repository.sql @@ -1,4 +1,4 @@ -create table phabricator_repository.repository_commitdata ( +create table {$NAMESPACE}_repository.repository_commitdata ( id int unsigned not null auto_increment primary key, commitID int unsigned not null, authorName varchar(255) not null, @@ -7,17 +7,17 @@ create table phabricator_repository.repository_commitdata ( key (authorName) ); -ALTER TABLE phabricator_worker.worker_task drop priority; -ALTER TABLE phabricator_worker.worker_task drop key leaseOwner; -ALTER TABLE phabricator_worker.worker_task add key (leaseOwner(16)); +ALTER TABLE {$NAMESPACE}_worker.worker_task drop priority; +ALTER TABLE {$NAMESPACE}_worker.worker_task drop key leaseOwner; +ALTER TABLE {$NAMESPACE}_worker.worker_task add key (leaseOwner(16)); -create table phabricator_repository.repository_path ( +create table {$NAMESPACE}_repository.repository_path ( id int unsigned not null auto_increment primary key, - path varchar(512) binary not null, + path varchar(128) binary not null, unique key (path) ); -create table phabricator_repository.repository_pathchange ( +create table {$NAMESPACE}_repository.repository_pathchange ( repositoryID int unsigned NOT NULL, pathID int unsigned NOT NULL, commitID int unsigned NOT NULL, @@ -31,7 +31,7 @@ create table phabricator_repository.repository_pathchange ( key (repositoryID, pathID, commitSequence) ); -create table phabricator_repository.repository_filesystem ( +create table {$NAMESPACE}_repository.repository_filesystem ( repositoryID int unsigned not null, parentID int unsigned not null, svnCommit int unsigned not null, @@ -41,16 +41,16 @@ create table phabricator_repository.repository_filesystem ( primary key (repositoryID, parentID, svnCommit, pathID) ); -alter table phabricator_repository.repository_filesystem add key (repositoryID, svnCommit); +alter table {$NAMESPACE}_repository.repository_filesystem add key (repositoryID, svnCommit); -truncate phabricator_repository.repository_commit; -alter table phabricator_repository.repository_commit +truncate {$NAMESPACE}_repository.repository_commit; +alter table {$NAMESPACE}_repository.repository_commit change repositoryPHID repositoryID int unsigned not null; -alter table phabricator_repository.repository_commit drop key repositoryPHID; -alter table phabricator_repository.repository_commit add unique key +alter table {$NAMESPACE}_repository.repository_commit drop key repositoryPHID; +alter table {$NAMESPACE}_repository.repository_commit add unique key (repositoryID, commitIdentifier(16)); -alter table phabricator_repository.repository_commit add key +alter table {$NAMESPACE}_repository.repository_commit add key (repositoryID, epoch); -alter table phabricator_repository.repository_filesystem +alter table {$NAMESPACE}_repository.repository_filesystem add key (repositoryID, pathID, svnCommit); diff --git a/resources/sql/patches/007.daemonlog.sql b/resources/sql/patches/007.daemonlog.sql index e1526f1af0..15529ee848 100644 --- a/resources/sql/patches/007.daemonlog.sql +++ b/resources/sql/patches/007.daemonlog.sql @@ -1,6 +1,6 @@ -create database phabricator_daemon; -create table phabricator_daemon.daemon_log ( + +create table {$NAMESPACE}_daemon.daemon_log ( id int unsigned not null auto_increment primary key, daemon varchar(255) not null, host varchar(255) not null, @@ -10,7 +10,7 @@ create table phabricator_daemon.daemon_log ( dateModified int unsigned not null ); -create table phabricator_daemon.daemon_logevent ( +create table {$NAMESPACE}_daemon.daemon_logevent ( id int unsigned not null auto_increment primary key, logID int unsigned not null, logType varchar(4) not null, diff --git a/resources/sql/patches/008.repoopt.sql b/resources/sql/patches/008.repoopt.sql index d20b6084b5..996a3921fd 100644 --- a/resources/sql/patches/008.repoopt.sql +++ b/resources/sql/patches/008.repoopt.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_repository.repository_filesystem DROP PRIMARY KEY; -ALTER TABLE phabricator_repository.repository_filesystem +ALTER TABLE {$NAMESPACE}_repository.repository_filesystem DROP PRIMARY KEY; +ALTER TABLE {$NAMESPACE}_repository.repository_filesystem DROP KEY repositoryID_2; -ALTER TABLE phabricator_repository.repository_filesystem +ALTER TABLE {$NAMESPACE}_repository.repository_filesystem ADD PRIMARY KEY (repositoryID, parentID, pathID, svnCommit); diff --git a/resources/sql/patches/009.repo_summary.sql b/resources/sql/patches/009.repo_summary.sql index 5f767c4e29..c5ab4e3021 100644 --- a/resources/sql/patches/009.repo_summary.sql +++ b/resources/sql/patches/009.repo_summary.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_repository.`repository_summary` ( +CREATE TABLE {$NAMESPACE}_repository.`repository_summary` ( `repositoryID` int(10) unsigned NOT NULL, `size` int(10) unsigned NOT NULL, `lastCommitID` int(10) unsigned NOT NULL, diff --git a/resources/sql/patches/010.herald.sql b/resources/sql/patches/010.herald.sql index df061e360e..59deb29485 100644 --- a/resources/sql/patches/010.herald.sql +++ b/resources/sql/patches/010.herald.sql @@ -1,13 +1,13 @@ -CREATE DATABASE IF NOT EXISTS phabricator_herald; -CREATE TABLE phabricator_herald.herald_action ( + +CREATE TABLE {$NAMESPACE}_herald.herald_action ( id int unsigned not null auto_increment primary key, ruleID int unsigned not null, action varchar(255) not null, target text not null ); -CREATE TABLE phabricator_herald.herald_rule ( +CREATE TABLE {$NAMESPACE}_herald.herald_rule ( id int unsigned not null auto_increment primary key, name varchar(255) not null, authorPHID varchar(64) binary not null, @@ -19,7 +19,7 @@ CREATE TABLE phabricator_herald.herald_rule ( unique key (authorPHID, name) ); -CREATE TABLE phabricator_herald.herald_condition ( +CREATE TABLE {$NAMESPACE}_herald.herald_condition ( id int unsigned not null auto_increment primary key, ruleID int unsigned not null, fieldName varchar(255) not null, @@ -27,7 +27,7 @@ CREATE TABLE phabricator_herald.herald_condition ( value text not null ); -CREATE TABLE phabricator_herald.herald_transcript ( +CREATE TABLE {$NAMESPACE}_herald.herald_transcript ( id int unsigned not null auto_increment primary key, phid varchar(64) binary not null, time int unsigned not null, diff --git a/resources/sql/patches/011.badcommit.sql b/resources/sql/patches/011.badcommit.sql index be2e533b44..76a8255417 100644 --- a/resources/sql/patches/011.badcommit.sql +++ b/resources/sql/patches/011.badcommit.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_repository.repository_badcommit ( +CREATE TABLE {$NAMESPACE}_repository.repository_badcommit ( fullCommitName varchar(255) binary not null primary key, description longblob not null ); \ No newline at end of file diff --git a/resources/sql/patches/012.dropphidtype.sql b/resources/sql/patches/012.dropphidtype.sql index 53f08454d9..cdeabff24b 100644 --- a/resources/sql/patches/012.dropphidtype.sql +++ b/resources/sql/patches/012.dropphidtype.sql @@ -1 +1 @@ -DROP TABLE phabricator_phid.phid_type; +DROP TABLE {$NAMESPACE}_phid.phid_type; diff --git a/resources/sql/patches/013.commitdetail.sql b/resources/sql/patches/013.commitdetail.sql index 940a1717d4..5a4b34ca4e 100644 --- a/resources/sql/patches/013.commitdetail.sql +++ b/resources/sql/patches/013.commitdetail.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_repository.repository_commitdata +ALTER TABLE {$NAMESPACE}_repository.repository_commitdata ADD commitDetails LONGBLOB NOT NULL; diff --git a/resources/sql/patches/014.shortcuts.sql b/resources/sql/patches/014.shortcuts.sql index e4a3ff481c..8a443100b4 100644 --- a/resources/sql/patches/014.shortcuts.sql +++ b/resources/sql/patches/014.shortcuts.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_repository.repository_shortcut ( +CREATE TABLE {$NAMESPACE}_repository.repository_shortcut ( id int unsigned not null auto_increment primary key, name varchar(255) not null, href varchar(255) not null, diff --git a/resources/sql/patches/015.preferences.sql b/resources/sql/patches/015.preferences.sql index 08a6c71d8a..8c7c983e63 100644 --- a/resources/sql/patches/015.preferences.sql +++ b/resources/sql/patches/015.preferences.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_user.user_preferences ( +CREATE TABLE {$NAMESPACE}_user.user_preferences ( id int unsigned not null auto_increment primary key, userPHID varchar(64) binary not null, preferences longblob not null, diff --git a/resources/sql/patches/016.userrealnameindex.sql b/resources/sql/patches/016.userrealnameindex.sql index d077be9bdb..616f062869 100644 --- a/resources/sql/patches/016.userrealnameindex.sql +++ b/resources/sql/patches/016.userrealnameindex.sql @@ -1 +1 @@ -ALTER TABLE phabricator_user.user ADD key (realName); \ No newline at end of file +ALTER TABLE {$NAMESPACE}_user.user ADD key (realName); \ No newline at end of file diff --git a/resources/sql/patches/017.sessionkeys.sql b/resources/sql/patches/017.sessionkeys.sql index 9f55573728..3fd89b0614 100644 --- a/resources/sql/patches/017.sessionkeys.sql +++ b/resources/sql/patches/017.sessionkeys.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_user.user ADD UNIQUE KEY (phid); -ALTER TABLE phabricator_user.phabricator_session ADD UNIQUE KEY (sessionKey); +ALTER TABLE {$NAMESPACE}_user.user ADD UNIQUE KEY (phid); +ALTER TABLE {$NAMESPACE}_user.phabricator_session ADD UNIQUE KEY (sessionKey); diff --git a/resources/sql/patches/018.owners.sql b/resources/sql/patches/018.owners.sql index 0fa822c315..c5fe3b9251 100644 --- a/resources/sql/patches/018.owners.sql +++ b/resources/sql/patches/018.owners.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS phabricator_owners; -CREATE TABLE phabricator_owners.owners_package ( + +CREATE TABLE {$NAMESPACE}_owners.owners_package ( id int unsigned not null auto_increment primary key, phid varchar(64) binary not null, unique key(phid), @@ -10,7 +10,7 @@ CREATE TABLE phabricator_owners.owners_package ( primaryOwnerPHID varchar(64) binary ); -CREATE TABLE phabricator_owners.owners_owner ( +CREATE TABLE {$NAMESPACE}_owners.owners_owner ( id int unsigned not null auto_increment primary key, packageID int unsigned not null, userPHID varchar(64) binary not null, @@ -18,7 +18,7 @@ CREATE TABLE phabricator_owners.owners_owner ( KEY(userPHID) ); -CREATE TABLE phabricator_owners.owners_path ( +CREATE TABLE {$NAMESPACE}_owners.owners_path ( id int unsigned not null auto_increment primary key, packageID int unsigned not null, key(packageID), diff --git a/resources/sql/patches/019.arcprojects.sql b/resources/sql/patches/019.arcprojects.sql index 2f585a134a..e6e0405268 100644 --- a/resources/sql/patches/019.arcprojects.sql +++ b/resources/sql/patches/019.arcprojects.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_repository.repository_arcanistproject ( +CREATE TABLE {$NAMESPACE}_repository.repository_arcanistproject ( id int unsigned not null auto_increment primary key, phid varchar(64) binary not null, unique key(phid), @@ -7,11 +7,11 @@ CREATE TABLE phabricator_repository.repository_arcanistproject ( repositoryID int unsigned ); -ALTER TABLE phabricator_repository.repository +ALTER TABLE {$NAMESPACE}_repository.repository ADD uuid varchar(64) binary; -ALTER TABLE phabricator_differential.differential_diff +ALTER TABLE {$NAMESPACE}_differential.differential_diff CHANGE arcanistProject arcanistProjectPHID varchar(64) binary; -ALTER TABLE phabricator_differential.differential_diff +ALTER TABLE {$NAMESPACE}_differential.differential_diff ADD repositoryUUID varchar(64) binary; diff --git a/resources/sql/patches/020.pathcapital.sql b/resources/sql/patches/020.pathcapital.sql index fb91e61d9c..7c825ca5fb 100644 --- a/resources/sql/patches/020.pathcapital.sql +++ b/resources/sql/patches/020.pathcapital.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_differential.differential_diff +ALTER TABLE {$NAMESPACE}_differential.differential_diff CHANGE sourceControlpath sourceControlPath varchar(255); \ No newline at end of file diff --git a/resources/sql/patches/021.xhpastview.sql b/resources/sql/patches/021.xhpastview.sql index 44c45ddffe..bb517ed949 100644 --- a/resources/sql/patches/021.xhpastview.sql +++ b/resources/sql/patches/021.xhpastview.sql @@ -1,5 +1,5 @@ -CREATE DATABASE IF NOT EXISTS phabricator_xhpastview; -CREATE TABLE phabricator_xhpastview.xhpastview_parsetree ( + +CREATE TABLE {$NAMESPACE}_xhpastview.xhpastview_parsetree ( id int unsigned not null auto_increment primary key, authorPHID varchar(64) binary, input longblob not null, diff --git a/resources/sql/patches/022.differentialcommit.sql b/resources/sql/patches/022.differentialcommit.sql index ecf1b4f0ad..c7177c2be6 100644 --- a/resources/sql/patches/022.differentialcommit.sql +++ b/resources/sql/patches/022.differentialcommit.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_differential.differential_commit ( +CREATE TABLE {$NAMESPACE}_differential.differential_commit ( revisionID int unsigned not null, commitPHID varchar(64) binary not null, primary key (revisionID, commitPHID), diff --git a/resources/sql/patches/023.dxkeys.sql b/resources/sql/patches/023.dxkeys.sql index a5dd872ae9..c1644ef566 100644 --- a/resources/sql/patches/023.dxkeys.sql +++ b/resources/sql/patches/023.dxkeys.sql @@ -1,29 +1,29 @@ -ALTER TABLE phabricator_differential.differential_changeset +ALTER TABLE {$NAMESPACE}_differential.differential_changeset ADD KEY (diffID); -ALTER TABLE phabricator_differential.differential_comment +ALTER TABLE {$NAMESPACE}_differential.differential_comment ADD KEY (revisionID); -ALTER TABLE phabricator_differential.differential_diff +ALTER TABLE {$NAMESPACE}_differential.differential_diff ADD KEY (revisionID); -ALTER TABLE phabricator_differential.differential_inlinecomment +ALTER TABLE {$NAMESPACE}_differential.differential_inlinecomment ADD KEY (changesetID); -ALTER TABLE phabricator_differential.differential_inlinecomment +ALTER TABLE {$NAMESPACE}_differential.differential_inlinecomment ADD KEY (commentID); -ALTER TABLE phabricator_differential.differential_hunk +ALTER TABLE {$NAMESPACE}_differential.differential_hunk ADD KEY (changesetID); -ALTER TABLE phabricator_herald.herald_transcript +ALTER TABLE {$NAMESPACE}_herald.herald_transcript ADD KEY (objectPHID); -ALTER TABLE phabricator_differential.differential_revision +ALTER TABLE {$NAMESPACE}_differential.differential_revision ADD KEY (authorPHID, status); -ALTER TABLE phabricator_differential.differential_revision +ALTER TABLE {$NAMESPACE}_differential.differential_revision ADD UNIQUE KEY (phid); -ALTER TABLE phabricator_metamta.metamta_mailinglist +ALTER TABLE {$NAMESPACE}_metamta.metamta_mailinglist ADD UNIQUE KEY (phid); diff --git a/resources/sql/patches/024.mlistkeys.sql b/resources/sql/patches/024.mlistkeys.sql index 57e8099937..4ccf515d35 100644 --- a/resources/sql/patches/024.mlistkeys.sql +++ b/resources/sql/patches/024.mlistkeys.sql @@ -1,6 +1,6 @@ -ALTER TABLE phabricator_metamta.metamta_mailinglist +ALTER TABLE {$NAMESPACE}_metamta.metamta_mailinglist ADD UNIQUE KEY (email); -ALTER TABLE phabricator_metamta.metamta_mailinglist +ALTER TABLE {$NAMESPACE}_metamta.metamta_mailinglist ADD UNIQUE KEY (name); diff --git a/resources/sql/patches/025.commentopt.sql b/resources/sql/patches/025.commentopt.sql index 7a8fe45681..2c0ee9cd76 100644 --- a/resources/sql/patches/025.commentopt.sql +++ b/resources/sql/patches/025.commentopt.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_differential.differential_inlinecomment +ALTER TABLE {$NAMESPACE}_differential.differential_inlinecomment ADD KEY (revisionID, authorPHID); \ No newline at end of file diff --git a/resources/sql/patches/026.diffpropkey.sql b/resources/sql/patches/026.diffpropkey.sql index ed12a62f10..c4d3fb7ce5 100644 --- a/resources/sql/patches/026.diffpropkey.sql +++ b/resources/sql/patches/026.diffpropkey.sql @@ -1,3 +1,3 @@ -ALTER TABLE phabricator_differential.differential_diffproperty +ALTER TABLE {$NAMESPACE}_differential.differential_diffproperty ADD UNIQUE KEY (diffID, name); diff --git a/resources/sql/patches/027.metamtakeys.sql b/resources/sql/patches/027.metamtakeys.sql index a9a7c65c28..891876eff6 100644 --- a/resources/sql/patches/027.metamtakeys.sql +++ b/resources/sql/patches/027.metamtakeys.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_metamta.metamta_mail +ALTER TABLE {$NAMESPACE}_metamta.metamta_mail ADD KEY (status, nextRetry); -ALTER TABLE phabricator_metamta.metamta_mail +ALTER TABLE {$NAMESPACE}_metamta.metamta_mail ADD KEY (relatedPHID); diff --git a/resources/sql/patches/028.systemagent.sql b/resources/sql/patches/028.systemagent.sql index 5a837d4b60..bce57aa443 100644 --- a/resources/sql/patches/028.systemagent.sql +++ b/resources/sql/patches/028.systemagent.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_user.user +ALTER TABLE {$NAMESPACE}_user.user ADD isSystemAgent bool not null default 0; \ No newline at end of file diff --git a/resources/sql/patches/029.cursors.sql b/resources/sql/patches/029.cursors.sql index 0512e45e12..70b1a7b1b2 100644 --- a/resources/sql/patches/029.cursors.sql +++ b/resources/sql/patches/029.cursors.sql @@ -1,13 +1,13 @@ -ALTER TABLE phabricator_timeline.timeline_event +ALTER TABLE {$NAMESPACE}_timeline.timeline_event ADD dataID int unsigned; -ALTER TABLE phabricator_timeline.timeline_event +ALTER TABLE {$NAMESPACE}_timeline.timeline_event ADD UNIQUE KEY (dataID); -UPDATE phabricator_timeline.timeline_event e, - phabricator_timeline.timeline_eventdata d +UPDATE {$NAMESPACE}_timeline.timeline_event e, + {$NAMESPACE}_timeline.timeline_eventdata d SET e.dataID = d.id WHERE d.eventID = e.id; -ALTER TABLE phabricator_timeline.timeline_eventdata +ALTER TABLE {$NAMESPACE}_timeline.timeline_eventdata DROP eventID; diff --git a/resources/sql/patches/030.imagemacro.sql b/resources/sql/patches/030.imagemacro.sql index 8e90fc26d5..27bd28250d 100644 --- a/resources/sql/patches/030.imagemacro.sql +++ b/resources/sql/patches/030.imagemacro.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_file.`file_imagemacro` ( +CREATE TABLE {$NAMESPACE}_file.`file_imagemacro` ( `id` int unsigned NOT NULL auto_increment PRIMARY KEY, `filePHID` varchar(64) NOT NULL, `name` varchar(255) NOT NULL diff --git a/resources/sql/patches/031.workerrace.sql b/resources/sql/patches/031.workerrace.sql index e643068f23..23390460bd 100644 --- a/resources/sql/patches/031.workerrace.sql +++ b/resources/sql/patches/031.workerrace.sql @@ -1,13 +1,13 @@ -ALTER TABLE phabricator_worker.worker_task +ALTER TABLE {$NAMESPACE}_worker.worker_task ADD dataID int unsigned; -ALTER TABLE phabricator_worker.worker_task +ALTER TABLE {$NAMESPACE}_worker.worker_task ADD UNIQUE KEY (dataID); -UPDATE phabricator_worker.worker_task t, - phabricator_worker.worker_taskdata d +UPDATE {$NAMESPACE}_worker.worker_task t, + {$NAMESPACE}_worker.worker_taskdata d SET t.dataID = d.id WHERE d.taskID = t.id; -ALTER TABLE phabricator_worker.worker_taskdata +ALTER TABLE {$NAMESPACE}_worker.worker_taskdata DROP taskID; diff --git a/resources/sql/patches/032.viewtime.sql b/resources/sql/patches/032.viewtime.sql index 455e3d7809..2382b45ac3 100644 --- a/resources/sql/patches/032.viewtime.sql +++ b/resources/sql/patches/032.viewtime.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_differential.differential_viewtime ( +CREATE TABLE {$NAMESPACE}_differential.differential_viewtime ( viewerPHID varchar(64) not null, objectPHID varchar(64) not null, viewTime int unsigned not null, diff --git a/resources/sql/patches/034.savedheader.sql b/resources/sql/patches/034.savedheader.sql index 658ee371ad..d7425a5c3d 100644 --- a/resources/sql/patches/034.savedheader.sql +++ b/resources/sql/patches/034.savedheader.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_herald.herald_savedheader ( +CREATE TABLE {$NAMESPACE}_herald.herald_savedheader ( phid varchar(64) binary not null primary key, header varchar(255) not null ) ENGINE=InnoDB; \ No newline at end of file diff --git a/resources/sql/patches/035.proxyimage.sql b/resources/sql/patches/035.proxyimage.sql index b5533558d9..78564aa43d 100644 --- a/resources/sql/patches/035.proxyimage.sql +++ b/resources/sql/patches/035.proxyimage.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_file.file_proxyimage ( +CREATE TABLE {$NAMESPACE}_file.file_proxyimage ( id int unsigned not null primary key auto_increment, uri varchar(255) binary not null, unique key(uri), diff --git a/resources/sql/patches/036.mailkey.sql b/resources/sql/patches/036.mailkey.sql index 7831465365..6edf512a71 100644 --- a/resources/sql/patches/036.mailkey.sql +++ b/resources/sql/patches/036.mailkey.sql @@ -1,10 +1,10 @@ -ALTER TABLE phabricator_differential.differential_revision +ALTER TABLE {$NAMESPACE}_differential.differential_revision ADD mailKey VARCHAR(40) binary NOT NULL; -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD mailKey VARCHAR(40) binary NOT NULL; -CREATE TABLE phabricator_metamta.metamta_receivedmail ( +CREATE TABLE {$NAMESPACE}_metamta.metamta_receivedmail ( id int unsigned not null primary key auto_increment, headers longblob not null, bodies longblob not null, diff --git a/resources/sql/patches/038.admin.sql b/resources/sql/patches/038.admin.sql index a1fba5617c..3765901898 100644 --- a/resources/sql/patches/038.admin.sql +++ b/resources/sql/patches/038.admin.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_user.user +ALTER TABLE {$NAMESPACE}_user.user ADD isDisabled bool NOT NULL; -ALTER TABLE phabricator_user.user +ALTER TABLE {$NAMESPACE}_user.user ADD isAdmin bool NOT NULL; diff --git a/resources/sql/patches/039.userlog.sql b/resources/sql/patches/039.userlog.sql index cb5675ae80..cbe97d89ab 100644 --- a/resources/sql/patches/039.userlog.sql +++ b/resources/sql/patches/039.userlog.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_user.user_log ( +CREATE TABLE {$NAMESPACE}_user.user_log ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, actorPHID varchar(64) BINARY, key(actorPHID, dateCreated), @@ -14,14 +14,14 @@ CREATE TABLE phabricator_user.user_log ( key(dateCreated) ); -ALTER TABLE phabricator_user.user_log +ALTER TABLE {$NAMESPACE}_user.user_log ADD remoteAddr varchar(16) NOT NULL; -ALTER TABLE phabricator_user.user_log +ALTER TABLE {$NAMESPACE}_user.user_log ADD KEY (remoteAddr, dateCreated); -ALTER TABLE phabricator_user.user_log +ALTER TABLE {$NAMESPACE}_user.user_log ADD session varchar(40); -ALTER TABLE phabricator_user.user_log +ALTER TABLE {$NAMESPACE}_user.user_log ADD KEY (session, dateCreated); diff --git a/resources/sql/patches/040.transform.sql b/resources/sql/patches/040.transform.sql index 7bf6a62eba..0f35801d43 100644 --- a/resources/sql/patches/040.transform.sql +++ b/resources/sql/patches/040.transform.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_file.file_transformedfile ( +CREATE TABLE {$NAMESPACE}_file.file_transformedfile ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, originalPHID varchar(64) BINARY NOT NULL, transform varchar(255) BINARY NOT NULL, diff --git a/resources/sql/patches/041.heraldrepetition.sql b/resources/sql/patches/041.heraldrepetition.sql index ee97fd1d3a..57fae2dc72 100644 --- a/resources/sql/patches/041.heraldrepetition.sql +++ b/resources/sql/patches/041.heraldrepetition.sql @@ -1,7 +1,7 @@ -CREATE TABLE phabricator_herald.herald_ruleapplied ( +CREATE TABLE {$NAMESPACE}_herald.herald_ruleapplied ( ruleID int unsigned not null, phid varchar(64) binary not null, PRIMARY KEY(ruleID, phid) ) ENGINE=InnoDB; -ALTER TABLE phabricator_herald.herald_rule add repetitionPolicy int unsigned; +ALTER TABLE {$NAMESPACE}_herald.herald_rule add repetitionPolicy int unsigned; diff --git a/resources/sql/patches/042.commentmetadata.sql b/resources/sql/patches/042.commentmetadata.sql index 1b27799732..74ee1d6af2 100644 --- a/resources/sql/patches/042.commentmetadata.sql +++ b/resources/sql/patches/042.commentmetadata.sql @@ -1,11 +1,11 @@ -ALTER TABLE phabricator_differential.differential_comment +ALTER TABLE {$NAMESPACE}_differential.differential_comment ADD metadata LONGBLOB NOT NULL; -UPDATE phabricator_differential.differential_comment +UPDATE {$NAMESPACE}_differential.differential_comment SET metadata = '{}' WHERE metadata = ''; -ALTER TABLE phabricator_maniphest.maniphest_transaction +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_transaction ADD metadata LONGBLOB NOT NULL; -UPDATE phabricator_maniphest.maniphest_transaction +UPDATE {$NAMESPACE}_maniphest.maniphest_transaction SET metadata = '{}' WHERE metadata = ''; diff --git a/resources/sql/patches/043.pastebin.sql b/resources/sql/patches/043.pastebin.sql index 6df5f21b3b..5e62159474 100644 --- a/resources/sql/patches/043.pastebin.sql +++ b/resources/sql/patches/043.pastebin.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS phabricator_pastebin; -CREATE TABLE phabricator_pastebin.pastebin_paste ( + +CREATE TABLE {$NAMESPACE}_pastebin.pastebin_paste ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255) NOT NULL, phid VARCHAR(64) BINARY NOT NULL, @@ -9,9 +9,3 @@ CREATE TABLE phabricator_pastebin.pastebin_paste ( dateCreated INT UNSIGNED NOT NULL, dateModified INT UNSIGNED NOT NULL ); - -INSERT INTO phabricator_directory.directory_item - (name, description, href, categoryID, sequence, dateCreated, dateModified) -VALUES - ("Paste", "Mmm... tasty, delicious paste.", "/paste/", 5, 150, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); diff --git a/resources/sql/patches/044.countdown.sql b/resources/sql/patches/044.countdown.sql index 38354d2306..540ab236d0 100644 --- a/resources/sql/patches/044.countdown.sql +++ b/resources/sql/patches/044.countdown.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS phabricator_countdown; -CREATE TABLE phabricator_countdown.countdown_timer ( + +CREATE TABLE {$NAMESPACE}_countdown.countdown_timer ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255) NOT NULL, authorPHID VARCHAR(64) BINARY NOT NULL, @@ -8,9 +8,3 @@ CREATE TABLE phabricator_countdown.countdown_timer ( dateCreated INT UNSIGNED NOT NULL, dateModified INT UNSIGNED NOT NULL ); - -INSERT INTO phabricator_directory.directory_item - (name, description, href, categoryID, sequence, dateCreated, dateModified) -VALUES - ("Countdown", "Utilize the full capabilities of your ALU.", "/countdown/", 5, 350, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); diff --git a/resources/sql/patches/045.timezone.sql b/resources/sql/patches/045.timezone.sql index a7e317407a..b4a9b6684c 100644 --- a/resources/sql/patches/045.timezone.sql +++ b/resources/sql/patches/045.timezone.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_user.user +ALTER TABLE {$NAMESPACE}_user.user ADD timezoneIdentifier varchar(255) NOT NULL; diff --git a/resources/sql/patches/046.conduittoken.sql b/resources/sql/patches/046.conduittoken.sql index b48daea86e..1fb6bdeb24 100644 --- a/resources/sql/patches/046.conduittoken.sql +++ b/resources/sql/patches/046.conduittoken.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_conduit.conduit_certificatetoken ( +CREATE TABLE {$NAMESPACE}_conduit.conduit_certificatetoken ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, userPHID VARCHAR(64) BINARY NOT NULL, token VARCHAR(64), @@ -6,7 +6,7 @@ CREATE TABLE phabricator_conduit.conduit_certificatetoken ( dateModified INT UNSIGNED NOT NULL ); -ALTER TABLE phabricator_conduit.conduit_certificatetoken +ALTER TABLE {$NAMESPACE}_conduit.conduit_certificatetoken ADD UNIQUE KEY (userPHID); -ALTER TABLE phabricator_conduit.conduit_certificatetoken +ALTER TABLE {$NAMESPACE}_conduit.conduit_certificatetoken ADD UNIQUE KEY (token); diff --git a/resources/sql/patches/047.projectstatus.sql b/resources/sql/patches/047.projectstatus.sql index 5b3e843018..56a19a4a98 100644 --- a/resources/sql/patches/047.projectstatus.sql +++ b/resources/sql/patches/047.projectstatus.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_project.project +ALTER TABLE {$NAMESPACE}_project.project ADD status varchar(32) not null; \ No newline at end of file diff --git a/resources/sql/patches/048.relationshipkeys.sql b/resources/sql/patches/048.relationshipkeys.sql index 8b8b09c0ee..7377d1d0be 100644 --- a/resources/sql/patches/048.relationshipkeys.sql +++ b/resources/sql/patches/048.relationshipkeys.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_search.search_documentrelationship +ALTER TABLE {$NAMESPACE}_search.search_documentrelationship add key (relatedPHID, relation); -ALTER TABLE phabricator_search.search_documentrelationship +ALTER TABLE {$NAMESPACE}_search.search_documentrelationship add key (relation, relatedPHID); diff --git a/resources/sql/patches/049.projectowner.sql b/resources/sql/patches/049.projectowner.sql index 56af7474bf..98bf55bf57 100644 --- a/resources/sql/patches/049.projectowner.sql +++ b/resources/sql/patches/049.projectowner.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_project.project_affiliation +ALTER TABLE {$NAMESPACE}_project.project_affiliation ADD isOwner bool NOT NULL; \ No newline at end of file diff --git a/resources/sql/patches/050.taskdenormal.sql b/resources/sql/patches/050.taskdenormal.sql index 640aaf22cf..53a711613f 100644 --- a/resources/sql/patches/050.taskdenormal.sql +++ b/resources/sql/patches/050.taskdenormal.sql @@ -1,20 +1,20 @@ -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD ownerOrdering varchar(64); -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD UNIQUE KEY (phid); -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD KEY (priority, status); -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD KEY (status); -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD KEY (ownerPHID, status); -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD KEY (authorPHID, status); -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD KEY (ownerOrdering); diff --git a/resources/sql/patches/051.projectfilter.sql b/resources/sql/patches/051.projectfilter.sql index 42554d01a7..ac7948715c 100644 --- a/resources/sql/patches/051.projectfilter.sql +++ b/resources/sql/patches/051.projectfilter.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_maniphest.maniphest_taskproject ( +CREATE TABLE {$NAMESPACE}_maniphest.maniphest_taskproject ( taskPHID varchar(64) BINARY NOT NULL, projectPHID varchar(64) BINARY NOT NULL, PRIMARY KEY (projectPHID, taskPHID), diff --git a/resources/sql/patches/052.pastelanguage.sql b/resources/sql/patches/052.pastelanguage.sql index 47f09e12c2..1bfdac0b1f 100644 --- a/resources/sql/patches/052.pastelanguage.sql +++ b/resources/sql/patches/052.pastelanguage.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_pastebin.pastebin_paste +ALTER TABLE {$NAMESPACE}_pastebin.pastebin_paste ADD COLUMN language VARCHAR(64) NOT NULL; \ No newline at end of file diff --git a/resources/sql/patches/053.feed.sql b/resources/sql/patches/053.feed.sql index c0893fb62f..96ae6ed0f7 100644 --- a/resources/sql/patches/053.feed.sql +++ b/resources/sql/patches/053.feed.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS phabricator_feed; -CREATE TABLE phabricator_feed.feed_storydata ( + +CREATE TABLE {$NAMESPACE}_feed.feed_storydata ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, phid VARCHAR(64) BINARY NOT NULL, UNIQUE KEY (phid), @@ -13,7 +13,7 @@ CREATE TABLE phabricator_feed.feed_storydata ( dateModified INT UNSIGNED NOT NULL ); -CREATE TABLE phabricator_feed.feed_storyreference ( +CREATE TABLE {$NAMESPACE}_feed.feed_storyreference ( objectPHID varchar(64) BINARY NOT NULL, chronologicalKey BIGINT UNSIGNED NOT NULL, UNIQUE KEY (objectPHID, chronologicalKey), diff --git a/resources/sql/patches/054.subscribers.sql b/resources/sql/patches/054.subscribers.sql index 263aa1b692..d1402ceb1f 100644 --- a/resources/sql/patches/054.subscribers.sql +++ b/resources/sql/patches/054.subscribers.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_maniphest.maniphest_tasksubscriber ( +CREATE TABLE {$NAMESPACE}_maniphest.maniphest_tasksubscriber ( taskPHID varchar(64) BINARY NOT NULL, subscriberPHID varchar(64) BINARY NOT NULL, PRIMARY KEY (subscriberPHID, taskPHID), diff --git a/resources/sql/patches/055.add_author_to_files.sql b/resources/sql/patches/055.add_author_to_files.sql index f6947fbf80..b43a1c01d9 100644 --- a/resources/sql/patches/055.add_author_to_files.sql +++ b/resources/sql/patches/055.add_author_to_files.sql @@ -1,3 +1,3 @@ -ALTER TABLE phabricator_file.file +ALTER TABLE {$NAMESPACE}_file.file ADD COLUMN authorPHID VARCHAR(64) BINARY, ADD KEY (authorPHID); \ No newline at end of file diff --git a/resources/sql/patches/056.slowvote.sql b/resources/sql/patches/056.slowvote.sql index 829d73dfbc..8a2912bd47 100644 --- a/resources/sql/patches/056.slowvote.sql +++ b/resources/sql/patches/056.slowvote.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS phabricator_slowvote; -CREATE TABLE phabricator_slowvote.slowvote_poll ( + +CREATE TABLE {$NAMESPACE}_slowvote.slowvote_poll ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, question VARCHAR(255) NOT NULL, phid VARCHAR(64) BINARY NOT NULL, @@ -13,7 +13,7 @@ CREATE TABLE phabricator_slowvote.slowvote_poll ( dateModified INT UNSIGNED NOT NULL ); -CREATE TABLE phabricator_slowvote.slowvote_option ( +CREATE TABLE {$NAMESPACE}_slowvote.slowvote_option ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, pollID INT UNSIGNED NOT NULL, KEY (pollID), @@ -22,7 +22,7 @@ CREATE TABLE phabricator_slowvote.slowvote_option ( dateModified INT UNSIGNED NOT NULL ); -CREATE TABLE phabricator_slowvote.slowvote_comment ( +CREATE TABLE {$NAMESPACE}_slowvote.slowvote_comment ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, pollID INT UNSIGNED NOT NULL, UNIQUE KEY (pollID, authorPHID), @@ -32,7 +32,7 @@ CREATE TABLE phabricator_slowvote.slowvote_comment ( dateModified INT UNSIGNED NOT NULL ); -CREATE TABLE phabricator_slowvote.slowvote_choice ( +CREATE TABLE {$NAMESPACE}_slowvote.slowvote_choice ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, pollID INT UNSIGNED NOT NULL, KEY (pollID), @@ -41,10 +41,4 @@ CREATE TABLE phabricator_slowvote.slowvote_choice ( KEY (authorPHID), dateCreated INT UNSIGNED NOT NULL, dateModified INT UNSIGNED NOT NULL -); - -INSERT INTO phabricator_directory.directory_item - (name, description, href, categoryID, sequence, dateCreated, dateModified) -VALUES - ("Slowvote", "Design by committee.", "/vote/", 5, 250, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); +); \ No newline at end of file diff --git a/resources/sql/patches/057.parsecache.sql b/resources/sql/patches/057.parsecache.sql index 67a6efe02e..796fa4592d 100644 --- a/resources/sql/patches/057.parsecache.sql +++ b/resources/sql/patches/057.parsecache.sql @@ -1,7 +1,7 @@ -TRUNCATE phabricator_differential.differential_changeset_parse_cache; +TRUNCATE {$NAMESPACE}_differential.differential_changeset_parse_cache; -ALTER TABLE phabricator_differential.differential_changeset_parse_cache +ALTER TABLE {$NAMESPACE}_differential.differential_changeset_parse_cache ADD dateCreated INT UNSIGNED NOT NULL; -ALTER TABLE phabricator_differential.differential_changeset_parse_cache +ALTER TABLE {$NAMESPACE}_differential.differential_changeset_parse_cache ADD KEY (dateCreated); \ No newline at end of file diff --git a/resources/sql/patches/058.missingkeys.sql b/resources/sql/patches/058.missingkeys.sql index 885c23558e..51d2e10aa2 100644 --- a/resources/sql/patches/058.missingkeys.sql +++ b/resources/sql/patches/058.missingkeys.sql @@ -1,11 +1,11 @@ -ALTER TABLE phabricator_file.file +ALTER TABLE {$NAMESPACE}_file.file ADD UNIQUE KEY (phid); -ALTER TABLE phabricator_project.project +ALTER TABLE {$NAMESPACE}_project.project ADD UNIQUE KEY (phid); -ALTER TABLE phabricator_herald.herald_condition +ALTER TABLE {$NAMESPACE}_herald.herald_condition ADD KEY (ruleID); -ALTER TABLE phabricator_herald.herald_action +ALTER TABLE {$NAMESPACE}_herald.herald_action ADD KEY (ruleID); \ No newline at end of file diff --git a/resources/sql/patches/059.engines.php b/resources/sql/patches/059.engines.php index 765d89263b..abcf2e170b 100644 --- a/resources/sql/patches/059.engines.php +++ b/resources/sql/patches/059.engines.php @@ -1,7 +1,7 @@ AND s.TABLE_NAME != 'search_documentfield' AND s.ENGINE != 'InnoDB'", - 'phabricator_'); + '{$NAMESPACE}_'); if (!$tables) { return; diff --git a/resources/sql/patches/060.phriction.sql b/resources/sql/patches/060.phriction.sql index 51d9074603..97a330575c 100644 --- a/resources/sql/patches/060.phriction.sql +++ b/resources/sql/patches/060.phriction.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS phabricator_phriction; -CREATE TABLE phabricator_phriction.phriction_document ( + +CREATE TABLE {$NAMESPACE}_phriction.phriction_document ( id INT UNSIGNED NOT NULL, phid VARCHAR(64) BINARY NOT NULL, UNIQUE KEY (phid), diff --git a/resources/sql/patches/061.phrictioncontent.sql b/resources/sql/patches/061.phrictioncontent.sql index 423f05513e..958bba3f86 100644 --- a/resources/sql/patches/061.phrictioncontent.sql +++ b/resources/sql/patches/061.phrictioncontent.sql @@ -1,12 +1,12 @@ /* Patch 060 neglected to make this an AUTO_INCREMENT PRIMARY KEY */ -ALTER TABLE phabricator_phriction.phriction_document +ALTER TABLE {$NAMESPACE}_phriction.phriction_document CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY; /* Needs to be initially nullable for insert when documents are created. */ -ALTER TABLE phabricator_phriction.phriction_document +ALTER TABLE {$NAMESPACE}_phriction.phriction_document CHANGE contentID contentID INT UNSIGNED; -CREATE TABLE phabricator_phriction.phriction_content ( +CREATE TABLE {$NAMESPACE}_phriction.phriction_content ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, documentID INT UNSIGNED NOT NULL, version INT UNSIGNED NOT NULL, diff --git a/resources/sql/patches/062.phrictionmenu.sql b/resources/sql/patches/062.phrictionmenu.sql index 763ab599d5..9ce4021be1 100644 --- a/resources/sql/patches/062.phrictionmenu.sql +++ b/resources/sql/patches/062.phrictionmenu.sql @@ -1,9 +1,3 @@ /* Older versions incorrectly computed the depth for the root page. */ -UPDATE phabricator_phriction.phriction_document - SET depth = 0 where slug = '/'; - -INSERT INTO phabricator_directory.directory_item - (name, description, href, categoryID, sequence, dateCreated, dateModified) -VALUES - ("Phriction", "Write things down.", "/w/", 4, 1100, - UNIX_TIMESTAMP(), UNIX_TIMESTAMP()); \ No newline at end of file +UPDATE {$NAMESPACE}_phriction.phriction_document + SET depth = 0 where slug = '/'; \ No newline at end of file diff --git a/resources/sql/patches/063.pasteforks.sql b/resources/sql/patches/063.pasteforks.sql index d2fb7430bc..978b2c16e4 100644 --- a/resources/sql/patches/063.pasteforks.sql +++ b/resources/sql/patches/063.pasteforks.sql @@ -1,3 +1,3 @@ -ALTER TABLE phabricator_pastebin.pastebin_paste +ALTER TABLE {$NAMESPACE}_pastebin.pastebin_paste ADD COLUMN parentPHID VARCHAR(64) BINARY, ADD KEY (parentPHID); \ No newline at end of file diff --git a/resources/sql/patches/064.subprojects.sql b/resources/sql/patches/064.subprojects.sql index acb722c380..0baebc8ae8 100644 --- a/resources/sql/patches/064.subprojects.sql +++ b/resources/sql/patches/064.subprojects.sql @@ -1,9 +1,9 @@ -ALTER TABLE phabricator_project.project +ALTER TABLE {$NAMESPACE}_project.project ADD subprojectPHIDs longblob NOT NULL; -UPDATE phabricator_project.project +UPDATE {$NAMESPACE}_project.project SET subprojectPHIDs = '[]'; -CREATE TABLE phabricator_project.project_subproject ( +CREATE TABLE {$NAMESPACE}_project.project_subproject ( projectPHID varchar(64) BINARY NOT NULL, subprojectPHID varchar(64) BINARY NOT NULL, PRIMARY KEY (subprojectPHID, projectPHID), diff --git a/resources/sql/patches/065.sshkeys.sql b/resources/sql/patches/065.sshkeys.sql index a475eb93f1..0fb7e1d33b 100644 --- a/resources/sql/patches/065.sshkeys.sql +++ b/resources/sql/patches/065.sshkeys.sql @@ -1,11 +1,11 @@ -CREATE TABLE phabricator_user.user_sshkey ( +CREATE TABLE {$NAMESPACE}_user.user_sshkey ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, userPHID varchar(64) BINARY NOT NULL, key (userPHID), name varchar(255), keyType varchar(255), keyBody varchar(32768) BINARY, - unique key (keyBody(512)), + unique key (keyBody(128)), keyComment varchar(255), dateCreated INT UNSIGNED NOT NULL, dateModified INT UNSIGNED NOT NULL diff --git a/resources/sql/patches/066.phrictioncontent.sql b/resources/sql/patches/066.phrictioncontent.sql index 5dd8144e89..9d4e324639 100644 --- a/resources/sql/patches/066.phrictioncontent.sql +++ b/resources/sql/patches/066.phrictioncontent.sql @@ -1,2 +1,2 @@ -alter table phabricator_phriction.phriction_content +alter table {$NAMESPACE}_phriction.phriction_content add description varchar(512); diff --git a/resources/sql/patches/067.preferences.sql b/resources/sql/patches/067.preferences.sql index 9e63e4a466..4623688e52 100644 --- a/resources/sql/patches/067.preferences.sql +++ b/resources/sql/patches/067.preferences.sql @@ -1,2 +1 @@ -DELETE FROM phabricator_directory.directory_item - WHERE href = '/preferences/'; +/* This used to be a "directory" update. */; \ No newline at end of file diff --git a/resources/sql/patches/068.maniphestauxiliarystorage.sql b/resources/sql/patches/068.maniphestauxiliarystorage.sql index df6978d731..429d0dac97 100644 --- a/resources/sql/patches/068.maniphestauxiliarystorage.sql +++ b/resources/sql/patches/068.maniphestauxiliarystorage.sql @@ -1,4 +1,4 @@ -create table phabricator_maniphest.maniphest_taskauxiliarystorage +create table {$NAMESPACE}_maniphest.maniphest_taskauxiliarystorage (id int unsigned not null auto_increment primary key, taskPHID varchar(64) binary not null, name varchar(255) not null, diff --git a/resources/sql/patches/069.heraldxscript.sql b/resources/sql/patches/069.heraldxscript.sql index 753aa44bd1..6bd7b86345 100644 --- a/resources/sql/patches/069.heraldxscript.sql +++ b/resources/sql/patches/069.heraldxscript.sql @@ -1,9 +1,9 @@ -ALTER TABLE phabricator_herald.herald_transcript +ALTER TABLE {$NAMESPACE}_herald.herald_transcript ADD garbageCollected BOOL NOT NULL DEFAULT 0; -UPDATE phabricator_herald.herald_transcript +UPDATE {$NAMESPACE}_herald.herald_transcript SET garbageCollected = 1 WHERE objectTranscript = ""; -ALTER TABLE phabricator_herald.herald_transcript +ALTER TABLE {$NAMESPACE}_herald.herald_transcript ADD KEY (garbageCollected, time); diff --git a/resources/sql/patches/070.differentialaux.sql b/resources/sql/patches/070.differentialaux.sql index 9e63c90373..3d4b65a1c0 100644 --- a/resources/sql/patches/070.differentialaux.sql +++ b/resources/sql/patches/070.differentialaux.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_differential.differential_auxiliaryfield ( +CREATE TABLE {$NAMESPACE}_differential.differential_auxiliaryfield ( id INT UNSIGNED NOT NULL auto_increment PRIMARY KEY, revisionPHID varchar(64) BINARY NOT NULL, name VARCHAR(32) BINARY NOT NULL, diff --git a/resources/sql/patches/071.contentsource.sql b/resources/sql/patches/071.contentsource.sql index eae1b7a608..964a63cdf3 100644 --- a/resources/sql/patches/071.contentsource.sql +++ b/resources/sql/patches/071.contentsource.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_differential.differential_comment +ALTER TABLE {$NAMESPACE}_differential.differential_comment ADD contentSource VARCHAR(255); -ALTER TABLE phabricator_maniphest.maniphest_transaction +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_transaction ADD contentSource VARCHAR(255); diff --git a/resources/sql/patches/072.blamerevert.sql b/resources/sql/patches/072.blamerevert.sql index 76b4c087e6..f1776a4a9d 100644 --- a/resources/sql/patches/072.blamerevert.sql +++ b/resources/sql/patches/072.blamerevert.sql @@ -1,20 +1,20 @@ -INSERT INTO phabricator_differential.differential_auxiliaryfield +INSERT INTO {$NAMESPACE}_differential.differential_auxiliaryfield (revisionPHID, name, value, dateCreated, dateModified) SELECT phid, 'phabricator:blame-revision', blameRevision, dateCreated, dateModified - FROM phabricator_differential.differential_revision + FROM {$NAMESPACE}_differential.differential_revision WHERE blameRevision != ''; -ALTER TABLE phabricator_differential.differential_revision +ALTER TABLE {$NAMESPACE}_differential.differential_revision DROP blameRevision; -INSERT INTO phabricator_differential.differential_auxiliaryfield +INSERT INTO {$NAMESPACE}_differential.differential_auxiliaryfield (revisionPHID, name, value, dateCreated, dateModified) SELECT phid, 'phabricator:revert-plan', revertPlan, dateCreated, dateModified - FROM phabricator_differential.differential_revision + FROM {$NAMESPACE}_differential.differential_revision WHERE revertPlan != ''; -ALTER TABLE phabricator_differential.differential_revision +ALTER TABLE {$NAMESPACE}_differential.differential_revision DROP revertPlan; diff --git a/resources/sql/patches/073.reposymbols.sql b/resources/sql/patches/073.reposymbols.sql index 98d18ecaaa..54b4aba8c0 100644 --- a/resources/sql/patches/073.reposymbols.sql +++ b/resources/sql/patches/073.reposymbols.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_repository.repository_symbol ( +CREATE TABLE {$NAMESPACE}_repository.repository_symbol ( arcanistProjectID INT UNSIGNED NOT NULL, symbolName varchar(128) NOT NULL, KEY (symbolName), diff --git a/resources/sql/patches/074.affectedpath.sql b/resources/sql/patches/074.affectedpath.sql index 372587b849..0dbabedc30 100644 --- a/resources/sql/patches/074.affectedpath.sql +++ b/resources/sql/patches/074.affectedpath.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_differential.differential_affectedpath ( +CREATE TABLE {$NAMESPACE}_differential.differential_affectedpath ( repositoryID INT UNSIGNED NOT NULL, pathID INT UNSIGNED NOT NULL, epoch INT UNSIGNED NOT NULL, diff --git a/resources/sql/patches/075.revisionhash.sql b/resources/sql/patches/075.revisionhash.sql index 979d8acbce..3bed89659c 100644 --- a/resources/sql/patches/075.revisionhash.sql +++ b/resources/sql/patches/075.revisionhash.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_differential.differential_revisionhash ( +CREATE TABLE {$NAMESPACE}_differential.differential_revisionhash ( revisionID INT UNSIGNED NOT NULL, type CHAR(4) BINARY NOT NULL, hash VARCHAR(40) BINARY NOT NULL, diff --git a/resources/sql/patches/076.indexedlanguages.sql b/resources/sql/patches/076.indexedlanguages.sql index 14c160ddc5..1d3069f1d9 100644 --- a/resources/sql/patches/076.indexedlanguages.sql +++ b/resources/sql/patches/076.indexedlanguages.sql @@ -1,4 +1,4 @@ -ALTER TABLE phabricator_repository.repository_arcanistproject +ALTER TABLE {$NAMESPACE}_repository.repository_arcanistproject ADD symbolIndexLanguages LONGBLOB NOT NULL; -ALTER TABLE phabricator_repository.repository_arcanistproject +ALTER TABLE {$NAMESPACE}_repository.repository_arcanistproject ADD symbolIndexProjects LONGBLOB NOT NULL; \ No newline at end of file diff --git a/resources/sql/patches/077.originalemail.sql b/resources/sql/patches/077.originalemail.sql index 0ce5d9f680..a3a5785366 100644 --- a/resources/sql/patches/077.originalemail.sql +++ b/resources/sql/patches/077.originalemail.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD originalEmailSource VARCHAR(255); diff --git a/resources/sql/patches/078.nametoken.sql b/resources/sql/patches/078.nametoken.sql index aa83714aa8..dae0f2089c 100644 --- a/resources/sql/patches/078.nametoken.sql +++ b/resources/sql/patches/078.nametoken.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_user.user_nametoken ( +CREATE TABLE {$NAMESPACE}_user.user_nametoken ( token VARCHAR(255) NOT NULL, userID INT UNSIGNED NOT NULL, KEY (token), diff --git a/resources/sql/patches/080.filekeys.sql b/resources/sql/patches/080.filekeys.sql index 1100f5adc1..2d8a35a02f 100644 --- a/resources/sql/patches/080.filekeys.sql +++ b/resources/sql/patches/080.filekeys.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_file.file +ALTER TABLE {$NAMESPACE}_file.file ADD secretKey VARCHAR(20) BINARY; \ No newline at end of file diff --git a/resources/sql/patches/082.xactionkey.sql b/resources/sql/patches/082.xactionkey.sql index ecb6999690..b6e55bd0bc 100644 --- a/resources/sql/patches/082.xactionkey.sql +++ b/resources/sql/patches/082.xactionkey.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_maniphest.maniphest_transaction +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_transaction ADD KEY (taskID); diff --git a/resources/sql/patches/083.dxviewtime.sql b/resources/sql/patches/083.dxviewtime.sql index b33b74eb80..98ee018625 100644 --- a/resources/sql/patches/083.dxviewtime.sql +++ b/resources/sql/patches/083.dxviewtime.sql @@ -1 +1 @@ -DROP TABLE phabricator_differential.differential_viewtime; +DROP TABLE {$NAMESPACE}_differential.differential_viewtime; diff --git a/resources/sql/patches/084.pasteauthorkey.sql b/resources/sql/patches/084.pasteauthorkey.sql index 80535dac63..bc8ec6ea8c 100644 --- a/resources/sql/patches/084.pasteauthorkey.sql +++ b/resources/sql/patches/084.pasteauthorkey.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_pastebin.pastebin_paste +ALTER TABLE {$NAMESPACE}_pastebin.pastebin_paste ADD KEY (authorPHID); diff --git a/resources/sql/patches/085.packagecommitrelationship.sql b/resources/sql/patches/085.packagecommitrelationship.sql index ed6222f17e..bcbef04985 100644 --- a/resources/sql/patches/085.packagecommitrelationship.sql +++ b/resources/sql/patches/085.packagecommitrelationship.sql @@ -1,4 +1,4 @@ -CREATE TABLE IF NOT EXISTS phabricator_owners.owners_packagecommitrelationship ( +CREATE TABLE IF NOT EXISTS {$NAMESPACE}_owners.owners_packagecommitrelationship ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `packagePHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, `commitPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, diff --git a/resources/sql/patches/086.formeraffil.sql b/resources/sql/patches/086.formeraffil.sql index 6b73157e24..2394a10aa9 100644 --- a/resources/sql/patches/086.formeraffil.sql +++ b/resources/sql/patches/086.formeraffil.sql @@ -1 +1 @@ -ALTER TABLE phabricator_project.project_affiliation DROP status; \ No newline at end of file +ALTER TABLE {$NAMESPACE}_project.project_affiliation DROP status; \ No newline at end of file diff --git a/resources/sql/patches/087.phrictiondelete.sql b/resources/sql/patches/087.phrictiondelete.sql index eeb377f0b3..b07c5358ff 100644 --- a/resources/sql/patches/087.phrictiondelete.sql +++ b/resources/sql/patches/087.phrictiondelete.sql @@ -1,8 +1,8 @@ -ALTER TABLE phabricator_phriction.phriction_document +ALTER TABLE {$NAMESPACE}_phriction.phriction_document ADD status INT UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE phabricator_phriction.phriction_content +ALTER TABLE {$NAMESPACE}_phriction.phriction_content ADD changeType INT UNSIGNED NOT NULL DEFAULT 0; -ALTER TABLE phabricator_phriction.phriction_content +ALTER TABLE {$NAMESPACE}_phriction.phriction_content ADD changeRef INT UNSIGNED DEFAULT NULL; \ No newline at end of file diff --git a/resources/sql/patches/088.audit.sql b/resources/sql/patches/088.audit.sql index a1d90be6d7..ea93e1c928 100644 --- a/resources/sql/patches/088.audit.sql +++ b/resources/sql/patches/088.audit.sql @@ -1,12 +1,12 @@ -CREATE DATABASE IF NOT EXISTS phabricator_audit; -ALTER TABLE phabricator_owners.owners_packagecommitrelationship + +ALTER TABLE {$NAMESPACE}_owners.owners_packagecommitrelationship ADD COLUMN `auditStatus` varchar(64) NOT NULL, ADD COLUMN `auditReasons` longtext NOT NULL, DROP KEY `packagePHID`, ADD KEY `packagePHID` (`packagePHID`, `auditStatus`, `id`); -CREATE TABLE IF NOT EXISTs phabricator_audit.audit_comment ( +CREATE TABLE IF NOT EXISTs {$NAMESPACE}_audit.audit_comment ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, `targetPHID` varchar(64) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL, @@ -19,5 +19,5 @@ CREATE TABLE IF NOT EXISTs phabricator_audit.audit_comment ( KEY `targetPHID` (`targetPHID`, `actorPHID`, `id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -ALTER TABLE phabricator_owners.owners_package +ALTER TABLE {$NAMESPACE}_owners.owners_package ADD COLUMN `auditingEnabled` tinyint(1) NOT NULL DEFAULT 0; diff --git a/resources/sql/patches/089.projectwiki.sql b/resources/sql/patches/089.projectwiki.sql index 846947846a..6e661259e7 100644 --- a/resources/sql/patches/089.projectwiki.sql +++ b/resources/sql/patches/089.projectwiki.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_project.project - ADD phrictionSlug varchar(512); +ALTER TABLE {$NAMESPACE}_project.project + ADD phrictionSlug varchar(128); diff --git a/resources/sql/patches/091.uniqueslugkey.sql b/resources/sql/patches/091.uniqueslugkey.sql index 1743ed8c4b..32d6e312fd 100644 --- a/resources/sql/patches/091.uniqueslugkey.sql +++ b/resources/sql/patches/091.uniqueslugkey.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_project.project +ALTER TABLE {$NAMESPACE}_project.project ADD UNIQUE KEY (phrictionSlug); diff --git a/resources/sql/patches/092.dropgithubnotification.sql b/resources/sql/patches/092.dropgithubnotification.sql index f197fb2b18..9fcfa76629 100644 --- a/resources/sql/patches/092.dropgithubnotification.sql +++ b/resources/sql/patches/092.dropgithubnotification.sql @@ -1 +1 @@ -DROP TABLE phabricator_repository.repository_githubnotification; \ No newline at end of file +DROP TABLE {$NAMESPACE}_repository.repository_githubnotification; \ No newline at end of file diff --git a/resources/sql/patches/094.phrictioncolumn.sql b/resources/sql/patches/094.phrictioncolumn.sql index d6456bee18..3514d11a5e 100644 --- a/resources/sql/patches/094.phrictioncolumn.sql +++ b/resources/sql/patches/094.phrictioncolumn.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_phriction.phriction_document +ALTER TABLE {$NAMESPACE}_phriction.phriction_document CHANGE slug slug VARCHAR(128) NOT NULL; diff --git a/resources/sql/patches/095.directory.sql b/resources/sql/patches/095.directory.sql index a1a8d5406e..4623688e52 100644 --- a/resources/sql/patches/095.directory.sql +++ b/resources/sql/patches/095.directory.sql @@ -1,6 +1 @@ -UPDATE phabricator_directory.directory_item - SET name = 'MetaMTA (Admin Only)' - WHERE href = '/mail/'; - -DELETE FROM phabricator_directory.directory_item - WHERE href = '/xhprof/'; +/* This used to be a "directory" update. */; \ No newline at end of file diff --git a/resources/sql/patches/096.filename.sql b/resources/sql/patches/096.filename.sql index b52b31dd5a..10ec52569f 100644 --- a/resources/sql/patches/096.filename.sql +++ b/resources/sql/patches/096.filename.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_differential.differential_changeset +ALTER TABLE {$NAMESPACE}_differential.differential_changeset CHANGE fileName filename varchar(255) NOT NULL; diff --git a/resources/sql/patches/097.heraldruletypes.sql b/resources/sql/patches/097.heraldruletypes.sql index cfc63e9d4a..b975403737 100644 --- a/resources/sql/patches/097.heraldruletypes.sql +++ b/resources/sql/patches/097.heraldruletypes.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_herald.herald_rule ADD ruleType varchar(255) not null DEFAULT 'global'; -CREATE INDEX IDX_RULE_TYPE on phabricator_herald.herald_rule (ruleType); \ No newline at end of file +ALTER TABLE {$NAMESPACE}_herald.herald_rule ADD ruleType varchar(255) not null DEFAULT 'global'; +CREATE INDEX IDX_RULE_TYPE on {$NAMESPACE}_herald.herald_rule (ruleType); \ No newline at end of file diff --git a/resources/sql/patches/099.drydock.sql b/resources/sql/patches/099.drydock.sql index da269a658a..87187f8bf7 100644 --- a/resources/sql/patches/099.drydock.sql +++ b/resources/sql/patches/099.drydock.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS phabricator_drydock; -CREATE TABLE phabricator_drydock.drydock_resource ( + +CREATE TABLE {$NAMESPACE}_drydock.drydock_resource ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, phid VARCHAR(64) BINARY NOT NULL, name VARCHAR(255) NOT NULL, @@ -15,7 +15,7 @@ CREATE TABLE phabricator_drydock.drydock_resource ( UNIQUE KEY (phid) ) ENGINE=InnoDB; -CREATE TABLE phabricator_drydock.drydock_lease ( +CREATE TABLE {$NAMESPACE}_drydock.drydock_lease ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, phid VARCHAR(64) BINARY NOT NULL, resourceID INT UNSIGNED, diff --git a/resources/sql/patches/100.projectxaction.sql b/resources/sql/patches/100.projectxaction.sql index 76d51f6892..df92d8ebae 100644 --- a/resources/sql/patches/100.projectxaction.sql +++ b/resources/sql/patches/100.projectxaction.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_project.project_transaction ( +CREATE TABLE {$NAMESPACE}_project.project_transaction ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, projectID INT UNSIGNED NOT NULL, authorPHID VARCHAR(64) BINARY NOT NULL, diff --git a/resources/sql/patches/101.heraldruleapplied.sql b/resources/sql/patches/101.heraldruleapplied.sql index 30c7a1a8ad..2a39db314c 100644 --- a/resources/sql/patches/101.heraldruleapplied.sql +++ b/resources/sql/patches/101.heraldruleapplied.sql @@ -1,2 +1,2 @@ -ALTER TABLE phabricator_herald.herald_ruleapplied +ALTER TABLE {$NAMESPACE}_herald.herald_ruleapplied ADD KEY (phid); diff --git a/resources/sql/patches/103.heraldedithistory.sql b/resources/sql/patches/103.heraldedithistory.sql index 1b2f6f917c..a4e6b166e6 100644 --- a/resources/sql/patches/103.heraldedithistory.sql +++ b/resources/sql/patches/103.heraldedithistory.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_herald.herald_ruleedit ( +CREATE TABLE {$NAMESPACE}_herald.herald_ruleedit ( id int unsigned not null auto_increment primary key, ruleID int unsigned not null, editorPHID varchar(64) BINARY not null, diff --git a/resources/sql/patches/104.searchkey.sql b/resources/sql/patches/104.searchkey.sql index d1bc2d5a7f..4ccde7a806 100644 --- a/resources/sql/patches/104.searchkey.sql +++ b/resources/sql/patches/104.searchkey.sql @@ -1,15 +1,15 @@ -ALTER TABLE phabricator_search.search_query +ALTER TABLE {$NAMESPACE}_search.search_query DROP authorPHID; -ALTER TABLE phabricator_search.search_query +ALTER TABLE {$NAMESPACE}_search.search_query ADD queryKey VARCHAR(12) NOT NULL; /* Preserve URIs for old queries in case anyone has them bookmarked. */ -UPDATE phabricator_search.search_query +UPDATE {$NAMESPACE}_search.search_query SET queryKey = id; -ALTER TABLE phabricator_search.search_query +ALTER TABLE {$NAMESPACE}_search.search_query ADD UNIQUE KEY (queryKey); /* NOTE: Accidentally added this as 104, merging. */ -UPDATE phabricator_project.project SET status = IF(status = 5, 100, 0); +UPDATE {$NAMESPACE}_project.project SET status = IF(status = 5, 100, 0); diff --git a/resources/sql/patches/105.mimetype.sql b/resources/sql/patches/105.mimetype.sql index 99f53a5580..ee5ba84142 100644 --- a/resources/sql/patches/105.mimetype.sql +++ b/resources/sql/patches/105.mimetype.sql @@ -1,4 +1,4 @@ /* Prior to D1615, we used the raw output of `file` to determine mime types, without stripping carriage returns. This creates Content-Type headers which are blocked by response-splitting protections introduced in D1564. */ -UPDATE phabricator_file.file SET mimeType = TRIM(BOTH "\n" FROM mimeType); +UPDATE {$NAMESPACE}_file.file SET mimeType = TRIM(BOTH "\n" FROM mimeType); diff --git a/resources/sql/patches/106.chatlog.sql b/resources/sql/patches/106.chatlog.sql index 437c74c003..419420f410 100644 --- a/resources/sql/patches/106.chatlog.sql +++ b/resources/sql/patches/106.chatlog.sql @@ -1,5 +1,5 @@ -CREATE DATABASE IF NOT EXISTS phabricator_chatlog; -CREATE TABLE phabricator_chatlog.chatlog_event ( + +CREATE TABLE {$NAMESPACE}_chatlog.chatlog_event ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, channel VARCHAR(64) BINARY NOT NULL, epoch INT UNSIGNED NOT NULL, diff --git a/resources/sql/patches/107.oauthserver.sql b/resources/sql/patches/107.oauthserver.sql index 4598762a4a..c2f1ae92cc 100644 --- a/resources/sql/patches/107.oauthserver.sql +++ b/resources/sql/patches/107.oauthserver.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS `phabricator_oauth_server`; -CREATE TABLE `phabricator_oauth_server`.`oauth_server_oauthserverclient` ( + +CREATE TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverclient` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) BINARY NOT NULL, `name` varchar(255) NOT NULL, @@ -13,7 +13,7 @@ CREATE TABLE `phabricator_oauth_server`.`oauth_server_oauthserverclient` ( UNIQUE KEY `phid` (`phid`) ) ENGINE=InnoDB; -CREATE TABLE `phabricator_oauth_server`.`oauth_server_oauthclientauthorization` ( +CREATE TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthclientauthorization` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `phid` varchar(64) BINARY NOT NULL, `userPHID` varchar(64) BINARY NOT NULL, @@ -25,7 +25,7 @@ CREATE TABLE `phabricator_oauth_server`.`oauth_server_oauthclientauthorization` UNIQUE KEY `userPHID` (`userPHID`,`clientPHID`) ) ENGINE=InnoDB; -CREATE TABLE `phabricator_oauth_server`.`oauth_server_oauthserverauthorizationcode` ( +CREATE TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverauthorizationcode` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `code` varchar(32) NOT NULL, `clientPHID` varchar(64) BINARY NOT NULL, @@ -37,7 +37,7 @@ CREATE TABLE `phabricator_oauth_server`.`oauth_server_oauthserverauthorizationco UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB; -CREATE TABLE `phabricator_oauth_server`.`oauth_server_oauthserveraccesstoken` ( +CREATE TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserveraccesstoken` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `token` varchar(32) NOT NULL, `userPHID` varchar(64) BINARY NOT NULL, diff --git a/resources/sql/patches/108.oauthscope.sql b/resources/sql/patches/108.oauthscope.sql index 874c80536e..f17a296956 100644 --- a/resources/sql/patches/108.oauthscope.sql +++ b/resources/sql/patches/108.oauthscope.sql @@ -1,6 +1,6 @@ -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthclientauthorization` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthclientauthorization` ADD `scope` text NOT NULL; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserveraccesstoken` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserveraccesstoken` DROP `dateExpires`; diff --git a/resources/sql/patches/109.oauthclientphidkey.sql b/resources/sql/patches/109.oauthclientphidkey.sql index f3c84dda78..5570043612 100644 --- a/resources/sql/patches/109.oauthclientphidkey.sql +++ b/resources/sql/patches/109.oauthclientphidkey.sql @@ -1,3 +1,3 @@ -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverclient` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverclient` ADD KEY `creatorPHID` (`creatorPHID`) diff --git a/resources/sql/patches/110.commitaudit.sql b/resources/sql/patches/110.commitaudit.sql index 3f04e4ed5e..4fffa055a8 100644 --- a/resources/sql/patches/110.commitaudit.sql +++ b/resources/sql/patches/110.commitaudit.sql @@ -1,11 +1,11 @@ -ALTER TABLE phabricator_repository.repository_commit +ALTER TABLE {$NAMESPACE}_repository.repository_commit ADD mailKey VARCHAR(20) NOT NULL; -ALTER TABLE phabricator_repository.repository_commit +ALTER TABLE {$NAMESPACE}_repository.repository_commit ADD authorPHID VARCHAR(64) BINARY; -ALTER TABLE phabricator_repository.repository_commit +ALTER TABLE {$NAMESPACE}_repository.repository_commit ADD auditStatus INT UNSIGNED NOT NULL; -ALTER TABLE phabricator_repository.repository_commit +ALTER TABLE {$NAMESPACE}_repository.repository_commit ADD KEY (authorPHID, auditStatus, epoch); \ No newline at end of file diff --git a/resources/sql/patches/112.oauthaccesscoderedirecturi.sql b/resources/sql/patches/112.oauthaccesscoderedirecturi.sql index f151c438ad..6131d63aca 100644 --- a/resources/sql/patches/112.oauthaccesscoderedirecturi.sql +++ b/resources/sql/patches/112.oauthaccesscoderedirecturi.sql @@ -1,3 +1,3 @@ -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverauthorizationcode` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverauthorizationcode` ADD `redirectURI` varchar(255) NOT NULL diff --git a/resources/sql/patches/113.lastreviewer.sql b/resources/sql/patches/113.lastreviewer.sql index e2b0c597d6..20d6e622ad 100644 --- a/resources/sql/patches/113.lastreviewer.sql +++ b/resources/sql/patches/113.lastreviewer.sql @@ -1,10 +1,10 @@ -ALTER TABLE `phabricator_differential`.`differential_revision` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_revision` ADD `lastReviewerPHID` varchar(64) BINARY AFTER `authorPHID`; -UPDATE `phabricator_differential`.`differential_revision` +UPDATE `{$NAMESPACE}_differential`.`differential_revision` SET `lastReviewerPHID` = ( SELECT `authorPHID` - FROM `phabricator_differential`.`differential_comment` + FROM `{$NAMESPACE}_differential`.`differential_comment` WHERE `revisionID` = `differential_revision`.`id` AND `action` IN ('accept', 'reject') ORDER BY `id` DESC diff --git a/resources/sql/patches/114.auditrequest.sql b/resources/sql/patches/114.auditrequest.sql index 6903aacdcb..048f789da3 100644 --- a/resources/sql/patches/114.auditrequest.sql +++ b/resources/sql/patches/114.auditrequest.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_repository.repository_auditrequest ( +CREATE TABLE {$NAMESPACE}_repository.repository_auditrequest ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, auditorPHID varchar(64) BINARY NOT NULL, commitPHID varchar(64) BINARY NOT NULL, @@ -8,9 +8,9 @@ CREATE TABLE phabricator_repository.repository_auditrequest ( KEY (auditorPHID, auditStatus) ) ENGINE=InnoDB; -INSERT INTO phabricator_repository.repository_auditrequest +INSERT INTO {$NAMESPACE}_repository.repository_auditrequest (auditorPHID, commitPHID, auditStatus, auditReasons) SELECT packagePHID, commitPHID, auditStatus, auditReasons - FROM phabricator_owners.owners_packagecommitrelationship; + FROM {$NAMESPACE}_owners.owners_packagecommitrelationship; -DROP TABLE phabricator_owners.owners_packagecommitrelationship; +DROP TABLE {$NAMESPACE}_owners.owners_packagecommitrelationship; diff --git a/resources/sql/patches/115.prepareutf8.sql b/resources/sql/patches/115.prepareutf8.sql index 126ed28ee5..1f0cba979b 100644 --- a/resources/sql/patches/115.prepareutf8.sql +++ b/resources/sql/patches/115.prepareutf8.sql @@ -1,18 +1,18 @@ -ALTER TABLE `phabricator_project`.`project` +ALTER TABLE `{$NAMESPACE}_project`.`project` MODIFY `phrictionSlug` varchar(128) binary; -ALTER TABLE phabricator_repository.repository_path +ALTER TABLE {$NAMESPACE}_repository.repository_path ADD COLUMN pathHash varchar(32) binary AFTER path; -UPDATE phabricator_repository.repository_path SET pathHash = MD5(path); -ALTER TABLE phabricator_repository.repository_path +UPDATE {$NAMESPACE}_repository.repository_path SET pathHash = MD5(path); +ALTER TABLE {$NAMESPACE}_repository.repository_path MODIFY pathHash varchar(32) binary not null, DROP KEY path, ADD UNIQUE KEY (pathHash); -ALTER TABLE phabricator_user.user_sshkey +ALTER TABLE {$NAMESPACE}_user.user_sshkey ADD COLUMN keyHash varchar(32) binary AFTER keyBody; -UPDATE phabricator_user.user_sshkey SET keyHash = MD5(keyBody); -ALTER TABLE phabricator_user.user_sshkey +UPDATE {$NAMESPACE}_user.user_sshkey SET keyHash = MD5(keyBody); +ALTER TABLE {$NAMESPACE}_user.user_sshkey MODIFY keyHash varchar(32) binary not null, DROP KEY keyBody, ADD UNIQUE KEY (keyHash); diff --git a/resources/sql/patches/116.utf8-backup-first-expect-wait.sql b/resources/sql/patches/116.utf8-backup-first-expect-wait.sql index 1a013a241d..71a1c21595 100644 --- a/resources/sql/patches/116.utf8-backup-first-expect-wait.sql +++ b/resources/sql/patches/116.utf8-backup-first-expect-wait.sql @@ -1,12 +1,12 @@ -ALTER DATABASE `phabricator_audit` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_audit` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_audit`.`audit_comment` +ALTER TABLE `{$NAMESPACE}_audit`.`audit_comment` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `targetPHID` varchar(64) CHARACTER SET binary, MODIFY `actorPHID` varchar(64) CHARACTER SET binary, MODIFY `action` varchar(64) CHARACTER SET binary, MODIFY `content` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_audit`.`audit_comment` +ALTER TABLE `{$NAMESPACE}_audit`.`audit_comment` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `targetPHID` varchar(64) COLLATE utf8_bin NOT NULL, @@ -16,15 +16,15 @@ ALTER TABLE `phabricator_audit`.`audit_comment` -ALTER DATABASE `phabricator_chatlog` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_chatlog` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_chatlog`.`chatlog_event` +ALTER TABLE `{$NAMESPACE}_chatlog`.`chatlog_event` MODIFY `channel` varchar(64) CHARACTER SET binary, MODIFY `author` varchar(64) CHARACTER SET binary, MODIFY `type` varchar(4) CHARACTER SET binary, MODIFY `message` longtext CHARACTER SET binary, MODIFY `loggedByPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_chatlog`.`chatlog_event` +ALTER TABLE `{$NAMESPACE}_chatlog`.`chatlog_event` COLLATE utf8_general_ci, MODIFY `channel` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `author` varchar(64) COLLATE utf8_bin NOT NULL, @@ -34,95 +34,95 @@ ALTER TABLE `phabricator_chatlog`.`chatlog_event` -ALTER DATABASE `phabricator_conduit` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_conduit` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_conduit`.`conduit_certificatetoken` +ALTER TABLE `{$NAMESPACE}_conduit`.`conduit_certificatetoken` MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `token` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_conduit`.`conduit_certificatetoken` +ALTER TABLE `{$NAMESPACE}_conduit`.`conduit_certificatetoken` COLLATE utf8_general_ci, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `token` varchar(64) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_conduit`.`conduit_connectionlog` +ALTER TABLE `{$NAMESPACE}_conduit`.`conduit_connectionlog` MODIFY `client` varchar(255) CHARACTER SET binary, MODIFY `clientVersion` varchar(255) CHARACTER SET binary, MODIFY `clientDescription` varchar(255) CHARACTER SET binary, MODIFY `username` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_conduit`.`conduit_connectionlog` +ALTER TABLE `{$NAMESPACE}_conduit`.`conduit_connectionlog` COLLATE utf8_general_ci, MODIFY `client` varchar(255) COLLATE utf8_general_ci, MODIFY `clientVersion` varchar(255) COLLATE utf8_general_ci, MODIFY `clientDescription` varchar(255) COLLATE utf8_general_ci, MODIFY `username` varchar(255) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_conduit`.`conduit_methodcalllog` +ALTER TABLE `{$NAMESPACE}_conduit`.`conduit_methodcalllog` MODIFY `method` varchar(255) CHARACTER SET binary, MODIFY `error` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_conduit`.`conduit_methodcalllog` +ALTER TABLE `{$NAMESPACE}_conduit`.`conduit_methodcalllog` COLLATE utf8_general_ci, MODIFY `method` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `error` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER DATABASE `phabricator_countdown` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_countdown` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_countdown`.`countdown_timer` +ALTER TABLE `{$NAMESPACE}_countdown`.`countdown_timer` MODIFY `title` varchar(255) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_countdown`.`countdown_timer` +ALTER TABLE `{$NAMESPACE}_countdown`.`countdown_timer` COLLATE utf8_general_ci, MODIFY `title` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER DATABASE `phabricator_daemon` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_daemon` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_daemon`.`daemon_log` +ALTER TABLE `{$NAMESPACE}_daemon`.`daemon_log` MODIFY `daemon` varchar(255) CHARACTER SET binary, MODIFY `host` varchar(255) CHARACTER SET binary, MODIFY `argv` varchar(512) CHARACTER SET binary; -ALTER TABLE `phabricator_daemon`.`daemon_log` +ALTER TABLE `{$NAMESPACE}_daemon`.`daemon_log` COLLATE utf8_general_ci, MODIFY `daemon` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `host` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `argv` varchar(512) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_daemon`.`daemon_logevent` +ALTER TABLE `{$NAMESPACE}_daemon`.`daemon_logevent` MODIFY `logType` varchar(4) CHARACTER SET binary, MODIFY `message` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_daemon`.`daemon_logevent` +ALTER TABLE `{$NAMESPACE}_daemon`.`daemon_logevent` COLLATE utf8_general_ci, MODIFY `logType` varchar(4) COLLATE utf8_general_ci NOT NULL, MODIFY `message` longtext COLLATE utf8_bin NOT NULL; -ALTER DATABASE `phabricator_differential` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_differential` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_differential`.`differential_affectedpath` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_affectedpath` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_differential`.`differential_auxiliaryfield` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_auxiliaryfield` MODIFY `revisionPHID` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(32) CHARACTER SET binary, MODIFY `value` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_auxiliaryfield` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_auxiliaryfield` COLLATE utf8_general_ci, MODIFY `revisionPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(32) COLLATE utf8_bin NOT NULL, MODIFY `value` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_differential`.`differential_changeset` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_changeset` MODIFY `oldFile` varchar(255) CHARACTER SET binary, MODIFY `filename` varchar(255) CHARACTER SET binary, MODIFY `awayPaths` longtext CHARACTER SET binary, MODIFY `metadata` longtext CHARACTER SET binary, MODIFY `oldProperties` longtext CHARACTER SET binary, MODIFY `newProperties` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_changeset` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_changeset` COLLATE utf8_general_ci, MODIFY `oldFile` varchar(255) COLLATE utf8_general_ci, MODIFY `filename` varchar(255) COLLATE utf8_general_ci NOT NULL, @@ -131,20 +131,20 @@ ALTER TABLE `phabricator_differential`.`differential_changeset` MODIFY `oldProperties` longtext COLLATE utf8_bin, MODIFY `newProperties` longtext COLLATE utf8_bin; -ALTER TABLE `phabricator_differential`.`differential_changeset_parse_cache` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_changeset_parse_cache` MODIFY `cache` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_changeset_parse_cache` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_changeset_parse_cache` COLLATE utf8_general_ci, MODIFY `cache` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_differential`.`differential_comment` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_comment` MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `action` varchar(64) CHARACTER SET binary, MODIFY `content` longtext CHARACTER SET binary, MODIFY `cache` longtext CHARACTER SET binary, MODIFY `metadata` longtext CHARACTER SET binary, MODIFY `contentSource` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_comment` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_comment` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `action` varchar(64) COLLATE utf8_general_ci NOT NULL, @@ -153,13 +153,13 @@ ALTER TABLE `phabricator_differential`.`differential_comment` MODIFY `metadata` longtext COLLATE utf8_bin NOT NULL, MODIFY `contentSource` varchar(255) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_differential`.`differential_commit` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_commit` MODIFY `commitPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_commit` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_commit` COLLATE utf8_general_ci, MODIFY `commitPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_differential`.`differential_diff` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_diff` MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `sourceMachine` varchar(255) CHARACTER SET binary, MODIFY `sourcePath` varchar(255) CHARACTER SET binary, @@ -171,7 +171,7 @@ ALTER TABLE `phabricator_differential`.`differential_diff` MODIFY `creationMethod` varchar(255) CHARACTER SET binary, MODIFY `description` varchar(255) CHARACTER SET binary, MODIFY `repositoryUUID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_diff` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_diff` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin, MODIFY `sourceMachine` varchar(255) COLLATE utf8_general_ci, @@ -185,41 +185,41 @@ ALTER TABLE `phabricator_differential`.`differential_diff` MODIFY `description` varchar(255) COLLATE utf8_general_ci, MODIFY `repositoryUUID` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_differential`.`differential_diffproperty` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_diffproperty` MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `data` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_diffproperty` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_diffproperty` COLLATE utf8_general_ci, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `data` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_differential`.`differential_hunk` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_hunk` MODIFY `changes` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_hunk` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_hunk` COLLATE utf8_general_ci, MODIFY `changes` longtext COLLATE utf8_bin; -ALTER TABLE `phabricator_differential`.`differential_inlinecomment` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_inlinecomment` MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `content` longtext CHARACTER SET binary, MODIFY `cache` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_inlinecomment` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_inlinecomment` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `content` longtext COLLATE utf8_bin NOT NULL, MODIFY `cache` longtext COLLATE utf8_bin; -ALTER TABLE `phabricator_differential`.`differential_relationship` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_relationship` MODIFY `relation` varchar(4) CHARACTER SET binary, MODIFY `objectPHID` varchar(64) CHARACTER SET binary, MODIFY `reasonPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_relationship` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_relationship` COLLATE utf8_general_ci, MODIFY `relation` varchar(4) COLLATE utf8_bin NOT NULL, MODIFY `objectPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `reasonPHID` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_differential`.`differential_revision` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_revision` MODIFY `title` varchar(255) CHARACTER SET binary, MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `status` varchar(32) CHARACTER SET binary, @@ -230,7 +230,7 @@ ALTER TABLE `phabricator_differential`.`differential_revision` MODIFY `attached` longtext CHARACTER SET binary, MODIFY `unsubscribed` longtext CHARACTER SET binary, MODIFY `mailKey` varchar(40) CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_revision` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_revision` COLLATE utf8_general_ci, MODIFY `title` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, @@ -243,45 +243,23 @@ ALTER TABLE `phabricator_differential`.`differential_revision` MODIFY `unsubscribed` longtext COLLATE utf8_bin NOT NULL, MODIFY `mailKey` varchar(40) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_differential`.`differential_revisionhash` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_revisionhash` MODIFY `type` char(4) CHARACTER SET binary, MODIFY `hash` varchar(40) CHARACTER SET binary; -ALTER TABLE `phabricator_differential`.`differential_revisionhash` +ALTER TABLE `{$NAMESPACE}_differential`.`differential_revisionhash` COLLATE utf8_general_ci, MODIFY `type` char(4) COLLATE utf8_bin NOT NULL, MODIFY `hash` varchar(40) COLLATE utf8_bin NOT NULL; -ALTER DATABASE `phabricator_directory` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_draft` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_directory`.`directory_category` - MODIFY `name` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_directory`.`directory_category` - COLLATE utf8_general_ci, - MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL; - -ALTER TABLE `phabricator_directory`.`directory_item` - MODIFY `name` varchar(255) CHARACTER SET binary, - MODIFY `description` text CHARACTER SET binary, - MODIFY `href` varchar(255) CHARACTER SET binary, - MODIFY `imagePHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_directory`.`directory_item` - COLLATE utf8_general_ci, - MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, - MODIFY `description` text COLLATE utf8_general_ci NOT NULL, - MODIFY `href` varchar(255) COLLATE utf8_general_ci NOT NULL, - MODIFY `imagePHID` varchar(64) COLLATE utf8_bin; - - - -ALTER DATABASE `phabricator_draft` COLLATE utf8_general_ci; - -ALTER TABLE `phabricator_draft`.`draft` +ALTER TABLE `{$NAMESPACE}_draft`.`draft` MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `draftKey` varchar(64) CHARACTER SET binary, MODIFY `draft` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_draft`.`draft` +ALTER TABLE `{$NAMESPACE}_draft`.`draft` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `draftKey` varchar(64) COLLATE utf8_bin NOT NULL, @@ -289,19 +267,19 @@ ALTER TABLE `phabricator_draft`.`draft` -ALTER DATABASE `phabricator_drydock` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_drydock` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_drydock`.`drydock_lease` +ALTER TABLE `{$NAMESPACE}_drydock`.`drydock_lease` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `ownerPHID` varchar(64) CHARACTER SET binary, MODIFY `attributes` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_drydock`.`drydock_lease` +ALTER TABLE `{$NAMESPACE}_drydock`.`drydock_lease` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `ownerPHID` varchar(64) COLLATE utf8_bin, MODIFY `attributes` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_drydock`.`drydock_resource` +ALTER TABLE `{$NAMESPACE}_drydock`.`drydock_resource` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `ownerPHID` varchar(64) CHARACTER SET binary, @@ -309,7 +287,7 @@ ALTER TABLE `phabricator_drydock`.`drydock_resource` MODIFY `type` varchar(64) CHARACTER SET binary, MODIFY `attributes` longtext CHARACTER SET binary, MODIFY `capabilities` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_drydock`.`drydock_resource` +ALTER TABLE `{$NAMESPACE}_drydock`.`drydock_resource` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, @@ -321,31 +299,31 @@ ALTER TABLE `phabricator_drydock`.`drydock_resource` -ALTER DATABASE `phabricator_feed` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_feed` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_feed`.`feed_storydata` +ALTER TABLE `{$NAMESPACE}_feed`.`feed_storydata` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `storyType` varchar(64) CHARACTER SET binary, MODIFY `storyData` longtext CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_feed`.`feed_storydata` +ALTER TABLE `{$NAMESPACE}_feed`.`feed_storydata` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `storyType` varchar(64) COLLATE utf8_general_ci NOT NULL, MODIFY `storyData` longtext COLLATE utf8_bin NOT NULL, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_feed`.`feed_storyreference` +ALTER TABLE `{$NAMESPACE}_feed`.`feed_storyreference` MODIFY `objectPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_feed`.`feed_storyreference` +ALTER TABLE `{$NAMESPACE}_feed`.`feed_storyreference` COLLATE utf8_general_ci, MODIFY `objectPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER DATABASE `phabricator_file` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_file` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_file`.`file` +ALTER TABLE `{$NAMESPACE}_file`.`file` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `mimeType` varchar(255) CHARACTER SET binary, @@ -354,7 +332,7 @@ ALTER TABLE `phabricator_file`.`file` MODIFY `storageHandle` varchar(255) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `secretKey` varchar(20) CHARACTER SET binary; -ALTER TABLE `phabricator_file`.`file` +ALTER TABLE `{$NAMESPACE}_file`.`file` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci, @@ -365,30 +343,30 @@ ALTER TABLE `phabricator_file`.`file` MODIFY `authorPHID` varchar(64) COLLATE utf8_bin, MODIFY `secretKey` varchar(20) COLLATE utf8_bin; -ALTER TABLE `phabricator_file`.`file_imagemacro` +ALTER TABLE `{$NAMESPACE}_file`.`file_imagemacro` MODIFY `filePHID` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_file`.`file_imagemacro` +ALTER TABLE `{$NAMESPACE}_file`.`file_imagemacro` COLLATE utf8_general_ci, MODIFY `filePHID` varchar(64) COLLATE utf8_general_ci NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_file`.`file_proxyimage` +ALTER TABLE `{$NAMESPACE}_file`.`file_proxyimage` MODIFY `uri` varchar(255) CHARACTER SET binary, MODIFY `filePHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_file`.`file_proxyimage` +ALTER TABLE `{$NAMESPACE}_file`.`file_proxyimage` COLLATE utf8_general_ci, MODIFY `uri` varchar(255) COLLATE utf8_bin NOT NULL, MODIFY `filePHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_file`.`file_storageblob` +ALTER TABLE `{$NAMESPACE}_file`.`file_storageblob` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_file`.`file_transformedfile` +ALTER TABLE `{$NAMESPACE}_file`.`file_transformedfile` MODIFY `originalPHID` varchar(64) CHARACTER SET binary, MODIFY `transform` varchar(255) CHARACTER SET binary, MODIFY `transformedPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_file`.`file_transformedfile` +ALTER TABLE `{$NAMESPACE}_file`.`file_transformedfile` COLLATE utf8_general_ci, MODIFY `originalPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `transform` varchar(255) COLLATE utf8_bin NOT NULL, @@ -396,59 +374,59 @@ ALTER TABLE `phabricator_file`.`file_transformedfile` -ALTER DATABASE `phabricator_herald` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_herald` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_herald`.`herald_action` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_action` MODIFY `action` varchar(255) CHARACTER SET binary, MODIFY `target` text CHARACTER SET binary; -ALTER TABLE `phabricator_herald`.`herald_action` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_action` COLLATE utf8_general_ci, MODIFY `action` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `target` text COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_herald`.`herald_condition` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_condition` MODIFY `fieldName` varchar(255) CHARACTER SET binary, MODIFY `fieldCondition` varchar(255) CHARACTER SET binary, MODIFY `value` text CHARACTER SET binary; -ALTER TABLE `phabricator_herald`.`herald_condition` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_condition` COLLATE utf8_general_ci, MODIFY `fieldName` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `fieldCondition` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `value` text COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_herald`.`herald_rule` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_rule` MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `contentType` varchar(255) CHARACTER SET binary, MODIFY `ruleType` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_herald`.`herald_rule` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_rule` COLLATE utf8_general_ci, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `contentType` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `ruleType` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT 'global'; -ALTER TABLE `phabricator_herald`.`herald_ruleapplied` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_ruleapplied` MODIFY `phid` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_herald`.`herald_ruleapplied` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_ruleapplied` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_herald`.`herald_ruleedit` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_ruleedit` MODIFY `editorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_herald`.`herald_ruleedit` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_ruleedit` COLLATE utf8_general_ci, MODIFY `editorPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_herald`.`herald_savedheader` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_savedheader` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `header` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_herald`.`herald_savedheader` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_savedheader` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `header` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_herald`.`herald_transcript` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_transcript` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `host` varchar(255) CHARACTER SET binary, MODIFY `psth` varchar(255) CHARACTER SET binary, @@ -457,7 +435,7 @@ ALTER TABLE `phabricator_herald`.`herald_transcript` MODIFY `ruleTranscripts` longtext CHARACTER SET binary, MODIFY `conditionTranscripts` longtext CHARACTER SET binary, MODIFY `applyTranscripts` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_herald`.`herald_transcript` +ALTER TABLE `{$NAMESPACE}_herald`.`herald_transcript` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `host` varchar(255) COLLATE utf8_general_ci NOT NULL, @@ -470,9 +448,9 @@ ALTER TABLE `phabricator_herald`.`herald_transcript` -ALTER DATABASE `phabricator_maniphest` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_maniphest` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_maniphest`.`maniphest_task` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_task` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `ownerPHID` varchar(64) CHARACTER SET binary, @@ -484,7 +462,7 @@ ALTER TABLE `phabricator_maniphest`.`maniphest_task` MODIFY `mailKey` varchar(40) CHARACTER SET binary, MODIFY `ownerOrdering` varchar(64) CHARACTER SET binary, MODIFY `originalEmailSource` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_maniphest`.`maniphest_task` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_task` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, @@ -498,39 +476,39 @@ ALTER TABLE `phabricator_maniphest`.`maniphest_task` MODIFY `ownerOrdering` varchar(64) COLLATE utf8_general_ci, MODIFY `originalEmailSource` varchar(255) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_maniphest`.`maniphest_taskauxiliarystorage` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_taskauxiliarystorage` MODIFY `taskPHID` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `value` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_maniphest`.`maniphest_taskauxiliarystorage` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_taskauxiliarystorage` COLLATE utf8_general_ci, MODIFY `taskPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `value` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_maniphest`.`maniphest_taskproject` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_taskproject` MODIFY `taskPHID` varchar(64) CHARACTER SET binary, MODIFY `projectPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_maniphest`.`maniphest_taskproject` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_taskproject` COLLATE utf8_general_ci, MODIFY `taskPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `projectPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_maniphest`.`maniphest_tasksubscriber` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_tasksubscriber` MODIFY `taskPHID` varchar(64) CHARACTER SET binary, MODIFY `subscriberPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_maniphest`.`maniphest_tasksubscriber` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_tasksubscriber` COLLATE utf8_general_ci, MODIFY `taskPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `subscriberPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_maniphest`.`maniphest_touch` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_touch` MODIFY `userPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_maniphest`.`maniphest_touch` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_touch` COLLATE utf8_general_ci, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_maniphest`.`maniphest_transaction` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_transaction` MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `transactionType` varchar(16) CHARACTER SET binary, MODIFY `oldValue` longtext CHARACTER SET binary, @@ -539,7 +517,7 @@ ALTER TABLE `phabricator_maniphest`.`maniphest_transaction` MODIFY `cache` longtext CHARACTER SET binary, MODIFY `metadata` longtext CHARACTER SET binary, MODIFY `contentSource` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_maniphest`.`maniphest_transaction` +ALTER TABLE `{$NAMESPACE}_maniphest`.`maniphest_transaction` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `transactionType` varchar(16) COLLATE utf8_general_ci NOT NULL, @@ -552,47 +530,44 @@ ALTER TABLE `phabricator_maniphest`.`maniphest_transaction` -ALTER DATABASE `phabricator_meta_data` COLLATE utf8_general_ci; - -ALTER TABLE `phabricator_meta_data`.`schema_version` - COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_meta_data` COLLATE utf8_general_ci; -ALTER DATABASE `phabricator_metamta` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_metamta` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_metamta`.`metamta_mail` +ALTER TABLE `{$NAMESPACE}_metamta`.`metamta_mail` MODIFY `parameters` longtext CHARACTER SET binary, MODIFY `status` varchar(255) CHARACTER SET binary, MODIFY `message` text CHARACTER SET binary, MODIFY `relatedPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_metamta`.`metamta_mail` +ALTER TABLE `{$NAMESPACE}_metamta`.`metamta_mail` COLLATE utf8_general_ci, MODIFY `parameters` longtext COLLATE utf8_bin NOT NULL, MODIFY `status` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `message` text COLLATE utf8_general_ci, MODIFY `relatedPHID` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_metamta`.`metamta_mailinglist` +ALTER TABLE `{$NAMESPACE}_metamta`.`metamta_mailinglist` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `email` varchar(255) CHARACTER SET binary, MODIFY `uri` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_metamta`.`metamta_mailinglist` +ALTER TABLE `{$NAMESPACE}_metamta`.`metamta_mailinglist` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `email` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `uri` varchar(255) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_metamta`.`metamta_receivedmail` +ALTER TABLE `{$NAMESPACE}_metamta`.`metamta_receivedmail` MODIFY `headers` longtext CHARACTER SET binary, MODIFY `bodies` longtext CHARACTER SET binary, MODIFY `attachments` longtext CHARACTER SET binary, MODIFY `relatedPHID` varchar(64) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `message` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_metamta`.`metamta_receivedmail` +ALTER TABLE `{$NAMESPACE}_metamta`.`metamta_receivedmail` COLLATE utf8_general_ci, MODIFY `headers` longtext COLLATE utf8_bin NOT NULL, MODIFY `bodies` longtext COLLATE utf8_bin NOT NULL, @@ -603,37 +578,37 @@ ALTER TABLE `phabricator_metamta`.`metamta_receivedmail` -ALTER DATABASE `phabricator_oauth_server` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_oauth_server` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthclientauthorization` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthclientauthorization` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `clientPHID` varchar(64) CHARACTER SET binary, MODIFY `scope` text CHARACTER SET binary; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthclientauthorization` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthclientauthorization` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `clientPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `scope` text COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserveraccesstoken` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserveraccesstoken` MODIFY `token` varchar(32) CHARACTER SET binary, MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `clientPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserveraccesstoken` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserveraccesstoken` COLLATE utf8_general_ci, MODIFY `token` varchar(32) COLLATE utf8_general_ci NOT NULL, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `clientPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverauthorizationcode` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverauthorizationcode` MODIFY `code` varchar(32) CHARACTER SET binary, MODIFY `clientPHID` varchar(64) CHARACTER SET binary, MODIFY `clientSecret` varchar(32) CHARACTER SET binary, MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `redirectURI` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverauthorizationcode` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverauthorizationcode` COLLATE utf8_general_ci, MODIFY `code` varchar(32) COLLATE utf8_general_ci NOT NULL, MODIFY `clientPHID` varchar(64) COLLATE utf8_bin NOT NULL, @@ -641,13 +616,13 @@ ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverauthorizationcod MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `redirectURI` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverclient` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverclient` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `secret` varchar(32) CHARACTER SET binary, MODIFY `redirectURI` varchar(255) CHARACTER SET binary, MODIFY `creatorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverclient` +ALTER TABLE `{$NAMESPACE}_oauth_server`.`oauth_server_oauthserverclient` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, @@ -657,46 +632,46 @@ ALTER TABLE `phabricator_oauth_server`.`oauth_server_oauthserverclient` -ALTER DATABASE `phabricator_owners` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_owners` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_owners`.`owners_owner` +ALTER TABLE `{$NAMESPACE}_owners`.`owners_owner` MODIFY `userPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_owners`.`owners_owner` +ALTER TABLE `{$NAMESPACE}_owners`.`owners_owner` COLLATE utf8_general_ci, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_owners`.`owners_package` +ALTER TABLE `{$NAMESPACE}_owners`.`owners_package` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `description` text CHARACTER SET binary, MODIFY `primaryOwnerPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_owners`.`owners_package` +ALTER TABLE `{$NAMESPACE}_owners`.`owners_package` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `description` text COLLATE utf8_general_ci NOT NULL, MODIFY `primaryOwnerPHID` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_owners`.`owners_path` +ALTER TABLE `{$NAMESPACE}_owners`.`owners_path` MODIFY `repositoryPHID` varchar(64) CHARACTER SET binary, MODIFY `path` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_owners`.`owners_path` +ALTER TABLE `{$NAMESPACE}_owners`.`owners_path` COLLATE utf8_general_ci, MODIFY `repositoryPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `path` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER DATABASE `phabricator_pastebin` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_pastebin` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_pastebin`.`pastebin_paste` +ALTER TABLE `{$NAMESPACE}_pastebin`.`pastebin_paste` MODIFY `title` varchar(255) CHARACTER SET binary, MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `filePHID` varchar(64) CHARACTER SET binary, MODIFY `language` varchar(64) CHARACTER SET binary, MODIFY `parentPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_pastebin`.`pastebin_paste` +ALTER TABLE `{$NAMESPACE}_pastebin`.`pastebin_paste` COLLATE utf8_general_ci, MODIFY `title` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, @@ -707,14 +682,14 @@ ALTER TABLE `phabricator_pastebin`.`pastebin_paste` -ALTER DATABASE `phabricator_phid` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_phid` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_phid`.`phid` +ALTER TABLE `{$NAMESPACE}_phid`.`phid` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `phidType` varchar(4) CHARACTER SET binary, MODIFY `parentPHID` varchar(64) CHARACTER SET binary, MODIFY `ownerPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_phid`.`phid` +ALTER TABLE `{$NAMESPACE}_phid`.`phid` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `phidType` varchar(4) COLLATE utf8_bin, @@ -723,15 +698,15 @@ ALTER TABLE `phabricator_phid`.`phid` -ALTER DATABASE `phabricator_phriction` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_phriction` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_phriction`.`phriction_content` +ALTER TABLE `{$NAMESPACE}_phriction`.`phriction_content` MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `title` varchar(512) CHARACTER SET binary, MODIFY `slug` varchar(512) CHARACTER SET binary, MODIFY `content` longtext CHARACTER SET binary, MODIFY `description` varchar(512) CHARACTER SET binary; -ALTER TABLE `phabricator_phriction`.`phriction_content` +ALTER TABLE `{$NAMESPACE}_phriction`.`phriction_content` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `title` varchar(512) COLLATE utf8_general_ci NOT NULL, @@ -739,26 +714,26 @@ ALTER TABLE `phabricator_phriction`.`phriction_content` MODIFY `content` longtext COLLATE utf8_bin NOT NULL, MODIFY `description` varchar(512) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_phriction`.`phriction_document` +ALTER TABLE `{$NAMESPACE}_phriction`.`phriction_document` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `slug` varchar(128) CHARACTER SET binary; -ALTER TABLE `phabricator_phriction`.`phriction_document` +ALTER TABLE `{$NAMESPACE}_phriction`.`phriction_document` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `slug` varchar(128) COLLATE utf8_general_ci NOT NULL; -ALTER DATABASE `phabricator_project` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_project` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_project`.`project` +ALTER TABLE `{$NAMESPACE}_project`.`project` MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `status` varchar(32) CHARACTER SET binary, MODIFY `subprojectPHIDs` longtext CHARACTER SET binary, MODIFY `phrictionSlug` varchar(128) CHARACTER SET binary; -ALTER TABLE `phabricator_project`.`project` +ALTER TABLE `{$NAMESPACE}_project`.`project` COLLATE utf8_general_ci, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, @@ -767,40 +742,40 @@ ALTER TABLE `phabricator_project`.`project` MODIFY `subprojectPHIDs` longtext COLLATE utf8_bin NOT NULL, MODIFY `phrictionSlug` varchar(128) COLLATE utf8_bin; -ALTER TABLE `phabricator_project`.`project_affiliation` +ALTER TABLE `{$NAMESPACE}_project`.`project_affiliation` MODIFY `projectPHID` varchar(64) CHARACTER SET binary, MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `role` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_project`.`project_affiliation` +ALTER TABLE `{$NAMESPACE}_project`.`project_affiliation` COLLATE utf8_general_ci, MODIFY `projectPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `role` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_project`.`project_profile` +ALTER TABLE `{$NAMESPACE}_project`.`project_profile` MODIFY `projectPHID` varchar(64) CHARACTER SET binary, MODIFY `blurb` longtext CHARACTER SET binary, MODIFY `profileImagePHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_project`.`project_profile` +ALTER TABLE `{$NAMESPACE}_project`.`project_profile` COLLATE utf8_general_ci, MODIFY `projectPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `blurb` longtext COLLATE utf8_general_ci NOT NULL, MODIFY `profileImagePHID` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_project`.`project_subproject` +ALTER TABLE `{$NAMESPACE}_project`.`project_subproject` MODIFY `projectPHID` varchar(64) CHARACTER SET binary, MODIFY `subprojectPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_project`.`project_subproject` +ALTER TABLE `{$NAMESPACE}_project`.`project_subproject` COLLATE utf8_general_ci, MODIFY `projectPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `subprojectPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_project`.`project_transaction` +ALTER TABLE `{$NAMESPACE}_project`.`project_transaction` MODIFY `authorPHID` varchar(64) CHARACTER SET binary, MODIFY `transactionType` varchar(32) CHARACTER SET binary, MODIFY `oldValue` longtext CHARACTER SET binary, MODIFY `newValue` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_project`.`project_transaction` +ALTER TABLE `{$NAMESPACE}_project`.`project_transaction` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `transactionType` varchar(32) COLLATE utf8_general_ci NOT NULL, @@ -809,16 +784,16 @@ ALTER TABLE `phabricator_project`.`project_transaction` -ALTER DATABASE `phabricator_repository` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_repository` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_repository`.`repository` +ALTER TABLE `{$NAMESPACE}_repository`.`repository` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `callsign` varchar(32) CHARACTER SET binary, MODIFY `versionControlSystem` varchar(32) CHARACTER SET binary, MODIFY `details` longtext CHARACTER SET binary, MODIFY `uuid` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository` +ALTER TABLE `{$NAMESPACE}_repository`.`repository` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, @@ -827,92 +802,92 @@ ALTER TABLE `phabricator_repository`.`repository` MODIFY `details` longtext COLLATE utf8_bin NOT NULL, MODIFY `uuid` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_repository`.`repository_arcanistproject` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_arcanistproject` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `symbolIndexLanguages` longtext CHARACTER SET binary, MODIFY `symbolIndexProjects` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_arcanistproject` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_arcanistproject` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `symbolIndexLanguages` longtext COLLATE utf8_bin NOT NULL, MODIFY `symbolIndexProjects` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_repository`.`repository_auditrequest` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_auditrequest` MODIFY `auditorPHID` varchar(64) CHARACTER SET binary, MODIFY `commitPHID` varchar(64) CHARACTER SET binary, MODIFY `auditStatus` varchar(64) CHARACTER SET binary, MODIFY `auditReasons` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_auditrequest` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_auditrequest` COLLATE utf8_general_ci, MODIFY `auditorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `commitPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `auditStatus` varchar(64) COLLATE utf8_general_ci NOT NULL, MODIFY `auditReasons` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_repository`.`repository_badcommit` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_badcommit` MODIFY `fullCommitName` varchar(255) CHARACTER SET binary, MODIFY `description` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_badcommit` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_badcommit` COLLATE utf8_general_ci, MODIFY `fullCommitName` varchar(255) COLLATE utf8_bin NOT NULL, MODIFY `description` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_repository`.`repository_commit` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_commit` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `commitIdentifier` varchar(40) CHARACTER SET binary, MODIFY `mailKey` varchar(20) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_commit` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_commit` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `commitIdentifier` varchar(40) COLLATE utf8_bin NOT NULL, MODIFY `mailKey` varchar(20) COLLATE utf8_general_ci NOT NULL, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_repository`.`repository_commitdata` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_commitdata` MODIFY `authorName` varchar(255) CHARACTER SET binary, MODIFY `commitMessage` longtext CHARACTER SET binary, MODIFY `commitDetails` longtext CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_commitdata` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_commitdata` COLLATE utf8_general_ci, MODIFY `authorName` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `commitMessage` longtext COLLATE utf8_bin NOT NULL, MODIFY `commitDetails` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_repository`.`repository_filesystem` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_filesystem` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_repository`.`repository_path` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_path` MODIFY `path` varchar(512) CHARACTER SET binary, MODIFY `pathHash` varchar(32) CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_path` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_path` COLLATE utf8_general_ci, MODIFY `path` varchar(512) COLLATE utf8_bin NOT NULL, MODIFY `pathHash` varchar(32) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_repository`.`repository_pathchange` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_pathchange` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_repository`.`repository_shortcut` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_shortcut` MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `href` varchar(255) CHARACTER SET binary, MODIFY `description` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_shortcut` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_shortcut` COLLATE utf8_general_ci, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `href` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `description` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_repository`.`repository_summary` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_summary` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_repository`.`repository_symbol` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_symbol` MODIFY `symbolName` varchar(128) CHARACTER SET binary, MODIFY `symbolType` varchar(12) CHARACTER SET binary, MODIFY `symbolLanguage` varchar(32) CHARACTER SET binary; -ALTER TABLE `phabricator_repository`.`repository_symbol` +ALTER TABLE `{$NAMESPACE}_repository`.`repository_symbol` COLLATE utf8_general_ci, MODIFY `symbolName` varchar(128) COLLATE utf8_general_ci NOT NULL, MODIFY `symbolType` varchar(12) COLLATE utf8_bin NOT NULL, @@ -920,26 +895,26 @@ ALTER TABLE `phabricator_repository`.`repository_symbol` -ALTER DATABASE `phabricator_search` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_search` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_search`.`search_document` +ALTER TABLE `{$NAMESPACE}_search`.`search_document` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `documentType` varchar(4) CHARACTER SET binary, MODIFY `documentTitle` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_search`.`search_document` +ALTER TABLE `{$NAMESPACE}_search`.`search_document` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `documentType` varchar(4) COLLATE utf8_bin NOT NULL, MODIFY `documentTitle` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_search`.`search_documentfield` +ALTER TABLE `{$NAMESPACE}_search`.`search_documentfield` DROP INDEX corpus, MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `phidType` varchar(4) CHARACTER SET binary, MODIFY `field` varchar(4) CHARACTER SET binary, MODIFY `auxPHID` varchar(64) CHARACTER SET binary, MODIFY `corpus` text CHARACTER SET binary; -ALTER TABLE `phabricator_search`.`search_documentfield` +ALTER TABLE `{$NAMESPACE}_search`.`search_documentfield` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `phidType` varchar(4) COLLATE utf8_bin NOT NULL, @@ -948,23 +923,23 @@ ALTER TABLE `phabricator_search`.`search_documentfield` MODIFY `corpus` text COLLATE utf8_general_ci, ADD FULLTEXT (corpus); -ALTER TABLE `phabricator_search`.`search_documentrelationship` +ALTER TABLE `{$NAMESPACE}_search`.`search_documentrelationship` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `relatedPHID` varchar(64) CHARACTER SET binary, MODIFY `relation` varchar(4) CHARACTER SET binary, MODIFY `relatedType` varchar(4) CHARACTER SET binary; -ALTER TABLE `phabricator_search`.`search_documentrelationship` +ALTER TABLE `{$NAMESPACE}_search`.`search_documentrelationship` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `relatedPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `relation` varchar(4) COLLATE utf8_bin NOT NULL, MODIFY `relatedType` varchar(4) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_search`.`search_query` +ALTER TABLE `{$NAMESPACE}_search`.`search_query` MODIFY `query` varchar(255) CHARACTER SET binary, MODIFY `parameters` text CHARACTER SET binary, MODIFY `queryKey` varchar(12) CHARACTER SET binary; -ALTER TABLE `phabricator_search`.`search_query` +ALTER TABLE `{$NAMESPACE}_search`.`search_query` COLLATE utf8_general_ci, MODIFY `query` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `parameters` text COLLATE utf8_general_ci NOT NULL, @@ -972,32 +947,32 @@ ALTER TABLE `phabricator_search`.`search_query` -ALTER DATABASE `phabricator_slowvote` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_slowvote` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_slowvote`.`slowvote_choice` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_choice` MODIFY `authorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_slowvote`.`slowvote_choice` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_choice` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_slowvote`.`slowvote_comment` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_comment` MODIFY `authorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_slowvote`.`slowvote_comment` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_comment` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `commentText` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_slowvote`.`slowvote_option` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_option` MODIFY `name` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_slowvote`.`slowvote_option` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_option` COLLATE utf8_general_ci, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_slowvote`.`slowvote_poll` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_poll` MODIFY `question` varchar(255) CHARACTER SET binary, MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `authorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_slowvote`.`slowvote_poll` +ALTER TABLE `{$NAMESPACE}_slowvote`.`slowvote_poll` COLLATE utf8_general_ci, MODIFY `question` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, @@ -1005,39 +980,39 @@ ALTER TABLE `phabricator_slowvote`.`slowvote_poll` -ALTER DATABASE `phabricator_timeline` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_timeline` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_timeline`.`timeline_cursor` +ALTER TABLE `{$NAMESPACE}_timeline`.`timeline_cursor` MODIFY `name` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_timeline`.`timeline_cursor` +ALTER TABLE `{$NAMESPACE}_timeline`.`timeline_cursor` COLLATE utf8_general_ci, MODIFY `name` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_timeline`.`timeline_event` +ALTER TABLE `{$NAMESPACE}_timeline`.`timeline_event` MODIFY `type` char(4) CHARACTER SET binary; -ALTER TABLE `phabricator_timeline`.`timeline_event` +ALTER TABLE `{$NAMESPACE}_timeline`.`timeline_event` COLLATE utf8_general_ci, MODIFY `type` char(4) COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_timeline`.`timeline_eventdata` +ALTER TABLE `{$NAMESPACE}_timeline`.`timeline_eventdata` COLLATE utf8_general_ci, MODIFY `eventData` longtext COLLATE utf8_bin NOT NULL; -ALTER DATABASE `phabricator_user` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_user` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_user`.`phabricator_session` +ALTER TABLE `{$NAMESPACE}_user`.`phabricator_session` MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `type` varchar(32) CHARACTER SET binary, MODIFY `sessionKey` varchar(40) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`phabricator_session` +ALTER TABLE `{$NAMESPACE}_user`.`phabricator_session` COLLATE utf8_general_ci, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `type` varchar(32) COLLATE utf8_bin NOT NULL, MODIFY `sessionKey` varchar(40) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_user`.`user` +ALTER TABLE `{$NAMESPACE}_user`.`user` MODIFY `phid` varchar(64) CHARACTER SET binary, MODIFY `userName` varchar(64) CHARACTER SET binary, MODIFY `realName` varchar(128) CHARACTER SET binary, @@ -1048,7 +1023,7 @@ ALTER TABLE `phabricator_user`.`user` MODIFY `consoleTab` varchar(64) CHARACTER SET binary, MODIFY `conduitCertificate` varchar(255) CHARACTER SET binary, MODIFY `timezoneIdentifier` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`user` +ALTER TABLE `{$NAMESPACE}_user`.`user` COLLATE utf8_general_ci, MODIFY `phid` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `userName` varchar(64) COLLATE utf8_general_ci NOT NULL, @@ -1061,13 +1036,13 @@ ALTER TABLE `phabricator_user`.`user` MODIFY `conduitCertificate` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `timezoneIdentifier` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_user`.`user_log` +ALTER TABLE `{$NAMESPACE}_user`.`user_log` MODIFY `actorPHID` varchar(64) CHARACTER SET binary, MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `action` varchar(64) CHARACTER SET binary, MODIFY `remoteAddr` varchar(16) CHARACTER SET binary, MODIFY `session` varchar(40) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`user_log` +ALTER TABLE `{$NAMESPACE}_user`.`user_log` COLLATE utf8_general_ci, MODIFY `actorPHID` varchar(64) COLLATE utf8_bin, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, @@ -1078,13 +1053,13 @@ ALTER TABLE `phabricator_user`.`user_log` MODIFY `remoteAddr` varchar(16) COLLATE utf8_general_ci NOT NULL, MODIFY `session` varchar(40) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_user`.`user_nametoken` +ALTER TABLE `{$NAMESPACE}_user`.`user_nametoken` MODIFY `token` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`user_nametoken` +ALTER TABLE `{$NAMESPACE}_user`.`user_nametoken` COLLATE utf8_general_ci, MODIFY `token` varchar(255) COLLATE utf8_general_ci NOT NULL; -ALTER TABLE `phabricator_user`.`user_oauthinfo` +ALTER TABLE `{$NAMESPACE}_user`.`user_oauthinfo` MODIFY `oauthProvider` varchar(255) CHARACTER SET binary, MODIFY `oauthUID` varchar(255) CHARACTER SET binary, MODIFY `accountURI` varchar(255) CHARACTER SET binary, @@ -1092,7 +1067,7 @@ ALTER TABLE `phabricator_user`.`user_oauthinfo` MODIFY `token` varchar(255) CHARACTER SET binary, MODIFY `tokenScope` varchar(255) CHARACTER SET binary, MODIFY `tokenStatus` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`user_oauthinfo` +ALTER TABLE `{$NAMESPACE}_user`.`user_oauthinfo` COLLATE utf8_general_ci, MODIFY `oauthProvider` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `oauthUID` varchar(255) COLLATE utf8_general_ci NOT NULL, @@ -1102,33 +1077,33 @@ ALTER TABLE `phabricator_user`.`user_oauthinfo` MODIFY `tokenScope` varchar(255) COLLATE utf8_general_ci, MODIFY `tokenStatus` varchar(255) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_user`.`user_preferences` +ALTER TABLE `{$NAMESPACE}_user`.`user_preferences` MODIFY `userPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`user_preferences` +ALTER TABLE `{$NAMESPACE}_user`.`user_preferences` COLLATE utf8_general_ci, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `preferences` longtext COLLATE utf8_bin NOT NULL; -ALTER TABLE `phabricator_user`.`user_profile` +ALTER TABLE `{$NAMESPACE}_user`.`user_profile` MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `title` varchar(255) CHARACTER SET binary, MODIFY `blurb` text CHARACTER SET binary, MODIFY `profileImagePHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`user_profile` +ALTER TABLE `{$NAMESPACE}_user`.`user_profile` COLLATE utf8_general_ci, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `title` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `blurb` text COLLATE utf8_general_ci NOT NULL, MODIFY `profileImagePHID` varchar(64) COLLATE utf8_bin; -ALTER TABLE `phabricator_user`.`user_sshkey` +ALTER TABLE `{$NAMESPACE}_user`.`user_sshkey` MODIFY `userPHID` varchar(64) CHARACTER SET binary, MODIFY `name` varchar(255) CHARACTER SET binary, MODIFY `keyType` varchar(255) CHARACTER SET binary, MODIFY `keyBody` text CHARACTER SET binary, MODIFY `keyHash` varchar(32) CHARACTER SET binary, MODIFY `keyComment` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_user`.`user_sshkey` +ALTER TABLE `{$NAMESPACE}_user`.`user_sshkey` COLLATE utf8_general_ci, MODIFY `userPHID` varchar(64) COLLATE utf8_bin NOT NULL, MODIFY `name` varchar(255) COLLATE utf8_general_ci, @@ -1139,27 +1114,27 @@ ALTER TABLE `phabricator_user`.`user_sshkey` -ALTER DATABASE `phabricator_worker` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_worker` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_worker`.`worker_task` +ALTER TABLE `{$NAMESPACE}_worker`.`worker_task` MODIFY `taskClass` varchar(255) CHARACTER SET binary, MODIFY `leaseOwner` varchar(255) CHARACTER SET binary; -ALTER TABLE `phabricator_worker`.`worker_task` +ALTER TABLE `{$NAMESPACE}_worker`.`worker_task` COLLATE utf8_general_ci, MODIFY `taskClass` varchar(255) COLLATE utf8_general_ci NOT NULL, MODIFY `leaseOwner` varchar(255) COLLATE utf8_general_ci; -ALTER TABLE `phabricator_worker`.`worker_taskdata` +ALTER TABLE `{$NAMESPACE}_worker`.`worker_taskdata` COLLATE utf8_general_ci, MODIFY `data` longtext COLLATE utf8_bin NOT NULL; -ALTER DATABASE `phabricator_xhpastview` COLLATE utf8_general_ci; +ALTER DATABASE `{$NAMESPACE}_xhpastview` COLLATE utf8_general_ci; -ALTER TABLE `phabricator_xhpastview`.`xhpastview_parsetree` +ALTER TABLE `{$NAMESPACE}_xhpastview`.`xhpastview_parsetree` MODIFY `authorPHID` varchar(64) CHARACTER SET binary; -ALTER TABLE `phabricator_xhpastview`.`xhpastview_parsetree` +ALTER TABLE `{$NAMESPACE}_xhpastview`.`xhpastview_parsetree` COLLATE utf8_general_ci, MODIFY `authorPHID` varchar(64) COLLATE utf8_bin, MODIFY `input` longtext COLLATE utf8_bin NOT NULL, diff --git a/resources/sql/patches/118.auditinline.sql b/resources/sql/patches/118.auditinline.sql index fae6d3380d..4494ebe6c5 100644 --- a/resources/sql/patches/118.auditinline.sql +++ b/resources/sql/patches/118.auditinline.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_audit.audit_inlinecomment ( +CREATE TABLE {$NAMESPACE}_audit.audit_inlinecomment ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, authorPHID varchar(64) COLLATE utf8_bin NOT NULL, commitPHID varchar(64) COLLATE utf8_bin NOT NULL, diff --git a/resources/sql/patches/119.filehash.sql b/resources/sql/patches/119.filehash.sql index 549721165c..29b5033c6b 100644 --- a/resources/sql/patches/119.filehash.sql +++ b/resources/sql/patches/119.filehash.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_file.file +ALTER TABLE {$NAMESPACE}_file.file ADD contentHash varchar(40) COLLATE utf8_bin; -ALTER TABLE phabricator_file.file +ALTER TABLE {$NAMESPACE}_file.file ADD KEY (contentHash); diff --git a/resources/sql/patches/121.drydocklog.sql b/resources/sql/patches/121.drydocklog.sql index a7eeb19ae8..e2b50c6eca 100644 --- a/resources/sql/patches/121.drydocklog.sql +++ b/resources/sql/patches/121.drydocklog.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_drydock.drydock_log ( +CREATE TABLE {$NAMESPACE}_drydock.drydock_log ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, resourceID INT UNSIGNED, leaseID INT UNSIGNED, diff --git a/resources/sql/patches/122.flag.sql b/resources/sql/patches/122.flag.sql index fa242caeed..6b666a6855 100644 --- a/resources/sql/patches/122.flag.sql +++ b/resources/sql/patches/122.flag.sql @@ -1,6 +1,6 @@ -CREATE DATABASE phabricator_flag COLLATE utf8_general_ci; -CREATE TABLE phabricator_flag.flag ( + +CREATE TABLE {$NAMESPACE}_flag.flag ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ownerPHID varchar(64) COLLATE utf8_bin NOT NULL, type varchar(4) COLLATE utf8_bin NOT NULL, diff --git a/resources/sql/patches/123.heraldrulelog.sql b/resources/sql/patches/123.heraldrulelog.sql index 0d3f1a873d..4a8e0e7bf2 100644 --- a/resources/sql/patches/123.heraldrulelog.sql +++ b/resources/sql/patches/123.heraldrulelog.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_herald.herald_ruleedit +ALTER TABLE {$NAMESPACE}_herald.herald_ruleedit ADD ruleName VARCHAR(255) NOT NULL COLLATE utf8_general_ci; -ALTER TABLE phabricator_herald.herald_ruleedit +ALTER TABLE {$NAMESPACE}_herald.herald_ruleedit ADD action VARCHAR(32) NOT NULL COLLATE utf8_general_ci; diff --git a/resources/sql/patches/124.subpriority.sql b/resources/sql/patches/124.subpriority.sql index 2a00e73e19..2133b6e574 100644 --- a/resources/sql/patches/124.subpriority.sql +++ b/resources/sql/patches/124.subpriority.sql @@ -1,11 +1,11 @@ -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD subpriority DOUBLE NOT NULL; -ALTER TABLE phabricator_maniphest.maniphest_task +ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task ADD KEY (priority, subpriority); /* Seed the subpriority column with reasonable values that keep order stable. */ -UPDATE phabricator_maniphest.maniphest_task +UPDATE {$NAMESPACE}_maniphest.maniphest_task SET subpriority = (UNIX_TIMESTAMP() - dateModified); diff --git a/resources/sql/patches/125.ipv6.sql b/resources/sql/patches/125.ipv6.sql index 203bc62193..805555b8e9 100644 --- a/resources/sql/patches/125.ipv6.sql +++ b/resources/sql/patches/125.ipv6.sql @@ -1,3 +1,3 @@ -ALTER TABLE `phabricator_user`.`user_log` +ALTER TABLE `{$NAMESPACE}_user`.`user_log` -- 45 is length of "0000:0000:0000:0000:0000:0000:255.255.255.255". MODIFY `remoteAddr` varchar(45) COLLATE 'utf8_general_ci' NOT NULL; diff --git a/resources/sql/patches/126.edges.sql b/resources/sql/patches/126.edges.sql index 2123c0b068..8dfb5cd5d6 100644 --- a/resources/sql/patches/126.edges.sql +++ b/resources/sql/patches/126.edges.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_maniphest.edge ( +CREATE TABLE {$NAMESPACE}_maniphest.edge ( src VARCHAR(64) NOT NULL COLLATE utf8_bin, type VARCHAR(64) NOT NULL COLLATE utf8_bin, dst VARCHAR(64) NOT NULL COLLATE utf8_bin, @@ -9,14 +9,14 @@ CREATE TABLE phabricator_maniphest.edge ( KEY (src, type, dateCreated, seq) ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_maniphest.edgedata ( +CREATE TABLE {$NAMESPACE}_maniphest.edgedata ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, data LONGTEXT NOT NULL COLLATE utf8_bin ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_repository.edge ( +CREATE TABLE {$NAMESPACE}_repository.edge ( src VARCHAR(64) NOT NULL COLLATE utf8_bin, type VARCHAR(64) NOT NULL COLLATE utf8_bin, dst VARCHAR(64) NOT NULL COLLATE utf8_bin, @@ -27,14 +27,14 @@ CREATE TABLE phabricator_repository.edge ( KEY (src, type, dateCreated, seq) ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_repository.edgedata ( +CREATE TABLE {$NAMESPACE}_repository.edgedata ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, data LONGTEXT NOT NULL COLLATE utf8_bin ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_differential.edge ( +CREATE TABLE {$NAMESPACE}_differential.edge ( src VARCHAR(64) NOT NULL COLLATE utf8_bin, type VARCHAR(64) NOT NULL COLLATE utf8_bin, dst VARCHAR(64) NOT NULL COLLATE utf8_bin, @@ -45,14 +45,14 @@ CREATE TABLE phabricator_differential.edge ( KEY (src, type, dateCreated, seq) ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_differential.edgedata ( +CREATE TABLE {$NAMESPACE}_differential.edgedata ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, data LONGTEXT NOT NULL COLLATE utf8_bin ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_file.edge ( +CREATE TABLE {$NAMESPACE}_file.edge ( src VARCHAR(64) NOT NULL COLLATE utf8_bin, type VARCHAR(64) NOT NULL COLLATE utf8_bin, dst VARCHAR(64) NOT NULL COLLATE utf8_bin, @@ -63,14 +63,14 @@ CREATE TABLE phabricator_file.edge ( KEY (src, type, dateCreated, seq) ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_file.edgedata ( +CREATE TABLE {$NAMESPACE}_file.edgedata ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, data LONGTEXT NOT NULL COLLATE utf8_bin ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_user.edge ( +CREATE TABLE {$NAMESPACE}_user.edge ( src VARCHAR(64) NOT NULL COLLATE utf8_bin, type VARCHAR(64) NOT NULL COLLATE utf8_bin, dst VARCHAR(64) NOT NULL COLLATE utf8_bin, @@ -81,14 +81,14 @@ CREATE TABLE phabricator_user.edge ( KEY (src, type, dateCreated, seq) ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_user.edgedata ( +CREATE TABLE {$NAMESPACE}_user.edgedata ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, data LONGTEXT NOT NULL COLLATE utf8_bin ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_project.edge ( +CREATE TABLE {$NAMESPACE}_project.edge ( src VARCHAR(64) NOT NULL COLLATE utf8_bin, type VARCHAR(64) NOT NULL COLLATE utf8_bin, dst VARCHAR(64) NOT NULL COLLATE utf8_bin, @@ -99,14 +99,14 @@ CREATE TABLE phabricator_project.edge ( KEY (src, type, dateCreated, seq) ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_project.edgedata ( +CREATE TABLE {$NAMESPACE}_project.edgedata ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, data LONGTEXT NOT NULL COLLATE utf8_bin ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_metamta.edge ( +CREATE TABLE {$NAMESPACE}_metamta.edge ( src VARCHAR(64) NOT NULL COLLATE utf8_bin, type VARCHAR(64) NOT NULL COLLATE utf8_bin, dst VARCHAR(64) NOT NULL COLLATE utf8_bin, @@ -117,7 +117,7 @@ CREATE TABLE phabricator_metamta.edge ( KEY (src, type, dateCreated, seq) ) ENGINE=InnoDB, COLLATE utf8_general_ci; -CREATE TABLE phabricator_metamta.edgedata ( +CREATE TABLE {$NAMESPACE}_metamta.edgedata ( id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, data LONGTEXT NOT NULL COLLATE utf8_bin ) ENGINE=InnoDB, COLLATE utf8_general_ci; diff --git a/resources/sql/patches/127.userkeybody.sql b/resources/sql/patches/127.userkeybody.sql index 712da7c740..0218e5bbe5 100644 --- a/resources/sql/patches/127.userkeybody.sql +++ b/resources/sql/patches/127.userkeybody.sql @@ -1,2 +1,2 @@ -ALTER TABLE `phabricator_user`.`user_sshkey` +ALTER TABLE `{$NAMESPACE}_user`.`user_sshkey` MODIFY `keyBody` text COLLATE utf8_bin; diff --git a/resources/sql/patches/128.phabricatorcom.sql b/resources/sql/patches/128.phabricatorcom.sql index 02acb07c0a..4623688e52 100644 --- a/resources/sql/patches/128.phabricatorcom.sql +++ b/resources/sql/patches/128.phabricatorcom.sql @@ -1,3 +1 @@ -UPDATE phabricator_directory.directory_item SET - href = REPLACE(href, 'http://phabricator.com/', 'http://www.phabricator.com/') - WHERE href LIKE 'http://phabricator.com/%'; +/* This used to be a "directory" update. */; \ No newline at end of file diff --git a/resources/sql/patches/129.savedquery.sql b/resources/sql/patches/129.savedquery.sql index d4b223123f..69143666d2 100644 --- a/resources/sql/patches/129.savedquery.sql +++ b/resources/sql/patches/129.savedquery.sql @@ -1,4 +1,4 @@ -CREATE TABLE phabricator_maniphest.maniphest_savedquery ( +CREATE TABLE {$NAMESPACE}_maniphest.maniphest_savedquery ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, userPHID varchar(64) COLLATE utf8_bin NOT NULL, queryKey varchar(64) COLLATE utf8_bin NOT NULL, diff --git a/resources/sql/patches/130.denormalrevisionquery.sql b/resources/sql/patches/130.denormalrevisionquery.sql index 125d7131a3..573cd895b9 100644 --- a/resources/sql/patches/130.denormalrevisionquery.sql +++ b/resources/sql/patches/130.denormalrevisionquery.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_differential.differential_revision +ALTER TABLE {$NAMESPACE}_differential.differential_revision ADD branchName VARCHAR(255) COLLATE utf8_general_ci; -ALTER TABLE phabricator_differential.differential_revision +ALTER TABLE {$NAMESPACE}_differential.differential_revision ADD arcanistProjectPHID VARCHAR(64) COLLATE utf8_bin; diff --git a/resources/sql/patches/132.phame.sql b/resources/sql/patches/132.phame.sql index 04e15a45bb..e56de6fe91 100644 --- a/resources/sql/patches/132.phame.sql +++ b/resources/sql/patches/132.phame.sql @@ -1,6 +1,6 @@ -CREATE DATABASE IF NOT EXISTS `phabricator_phame` COLLATE utf8_general_ci; -CREATE TABLE `phabricator_phame`.`phame_post` ( + +CREATE TABLE `{$NAMESPACE}_phame`.`phame_post` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `phid` VARCHAR(64) BINARY NOT NULL COLLATE utf8_bin, `bloggerPHID` VARCHAR(64) BINARY NOT NULL COLLATE utf8_bin, diff --git a/resources/sql/patches/133.imagemacro.sql b/resources/sql/patches/133.imagemacro.sql index 94a27ea13f..01852c6b48 100644 --- a/resources/sql/patches/133.imagemacro.sql +++ b/resources/sql/patches/133.imagemacro.sql @@ -1,2 +1,2 @@ -ALTER IGNORE TABLE `phabricator_file`.`file_imagemacro` +ALTER IGNORE TABLE `{$NAMESPACE}_file`.`file_imagemacro` ADD UNIQUE `name` (`name`); diff --git a/resources/sql/patches/134.emptysearch.sql b/resources/sql/patches/134.emptysearch.sql index 40e51cf6b2..2fce9b2bab 100644 --- a/resources/sql/patches/134.emptysearch.sql +++ b/resources/sql/patches/134.emptysearch.sql @@ -1,2 +1,2 @@ -ALTER TABLE `phabricator_search`.`search_document` +ALTER TABLE `{$NAMESPACE}_search`.`search_document` ADD INDEX `documentCreated` (`documentCreated`); diff --git a/resources/sql/patches/135.datecommitted.sql b/resources/sql/patches/135.datecommitted.sql index 44659d3c6a..1259f8fa7a 100644 --- a/resources/sql/patches/135.datecommitted.sql +++ b/resources/sql/patches/135.datecommitted.sql @@ -1,7 +1,7 @@ -UPDATE phabricator_differential.differential_revision SET +UPDATE {$NAMESPACE}_differential.differential_revision SET dateCommitted = ( SELECT MIN(dateCreated) - FROM phabricator_differential.differential_comment + FROM {$NAMESPACE}_differential.differential_comment WHERE revisionID = differential_revision.id AND action = 'commit' ) WHERE status = 3 AND dateCommitted IS NULL; diff --git a/resources/sql/patches/136.sex.sql b/resources/sql/patches/136.sex.sql index be7d4e2106..d1bf6f7728 100644 --- a/resources/sql/patches/136.sex.sql +++ b/resources/sql/patches/136.sex.sql @@ -1,2 +1,2 @@ -ALTER TABLE `phabricator_user`.`user` +ALTER TABLE `{$NAMESPACE}_user`.`user` ADD `sex` char(1) COLLATE utf8_bin AFTER `email`; diff --git a/resources/sql/patches/137.auditmetadata.sql b/resources/sql/patches/137.auditmetadata.sql index 2f03fc1d7c..a8ff68138a 100644 --- a/resources/sql/patches/137.auditmetadata.sql +++ b/resources/sql/patches/137.auditmetadata.sql @@ -1,5 +1,5 @@ -ALTER TABLE phabricator_audit.audit_comment +ALTER TABLE {$NAMESPACE}_audit.audit_comment ADD metadata LONGTEXT COLLATE utf8_bin NOT NULL; -UPDATE phabricator_audit.audit_comment +UPDATE {$NAMESPACE}_audit.audit_comment SET metadata = '{}' WHERE metadata = ''; diff --git a/resources/sql/quickstart.sql b/resources/sql/quickstart.sql new file mode 100644 index 0000000000..bf8f115841 --- /dev/null +++ b/resources/sql/quickstart.sql @@ -0,0 +1,1496 @@ +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_audit` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_audit`; + +CREATE TABLE `audit_comment` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `targetPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `actorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `action` varchar(64) NOT NULL, + `content` longtext NOT NULL, + `metadata` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + 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, + `commitPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `pathID` int(10) unsigned NOT NULL, + `auditCommentID` int(10) unsigned DEFAULT NULL, + `isNewFile` tinyint(1) NOT NULL, + `lineNumber` int(10) unsigned NOT NULL, + `lineLength` int(10) unsigned NOT NULL, + `content` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `cache` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `commitPHID` (`commitPHID`,`pathID`), + KEY `authorPHID` (`authorPHID`,`commitPHID`,`auditCommentID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_chatlog` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_chatlog`; + +CREATE TABLE `chatlog_event` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `channel` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `epoch` int(10) unsigned NOT NULL, + `author` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` varchar(4) NOT NULL, + `message` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `loggedByPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + KEY `channel` (`channel`,`epoch`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_conduit` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_conduit`; + +CREATE TABLE `conduit_certificatetoken` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `token` varchar(64) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `userPHID` (`userPHID`), + 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, + `clientVersion` varchar(255) DEFAULT NULL, + `clientDescription` varchar(255) DEFAULT NULL, + `username` 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 `conduit_methodcalllog` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `connectionID` bigint(20) unsigned DEFAULT NULL, + `method` varchar(255) NOT NULL, + `error` varchar(255) NOT NULL, + `duration` bigint(20) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_countdown` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_countdown`; + +CREATE TABLE `countdown_timer` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `datepoint` int(10) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_daemon` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_daemon`; + +CREATE TABLE `daemon_log` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `daemon` varchar(255) NOT NULL, + `host` varchar(255) NOT NULL, + `pid` int(10) unsigned NOT NULL, + `argv` varchar(512) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `daemon_logevent` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `logID` int(10) unsigned NOT NULL, + `logType` varchar(4) NOT NULL, + `message` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `epoch` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `logID` (`logID`,`epoch`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_differential` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_differential`; + +CREATE TABLE `differential_affectedpath` ( + `repositoryID` int(10) unsigned NOT NULL, + `pathID` int(10) unsigned NOT NULL, + `epoch` int(10) unsigned NOT NULL, + `revisionID` int(10) unsigned NOT NULL, + KEY `repositoryID` (`repositoryID`,`pathID`,`epoch`), + 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, + `name` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `value` 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 `revisionPHID` (`revisionPHID`,`name`), + 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, + `oldFile` varchar(255) DEFAULT NULL, + `filename` varchar(255) NOT NULL, + `awayPaths` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `changeType` int(10) unsigned NOT NULL, + `fileType` int(10) unsigned NOT NULL, + `metadata` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `oldProperties` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `newProperties` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `addLines` int(10) unsigned NOT NULL, + `delLines` int(10) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + 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, + `dateCreated` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + 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, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `action` varchar(64) NOT NULL, + `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `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 `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, + PRIMARY KEY (`revisionID`,`commitPHID`), + 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, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `sourceMachine` varchar(255) DEFAULT NULL, + `sourcePath` varchar(255) DEFAULT NULL, + `sourceControlSystem` varchar(64) DEFAULT NULL, + `sourceControlBaseRevision` varchar(255) DEFAULT NULL, + `sourceControlPath` varchar(255) DEFAULT NULL, + `lintStatus` int(10) unsigned NOT NULL, + `unitStatus` int(10) unsigned NOT NULL, + `lineCount` int(10) unsigned NOT NULL, + `branch` 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, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `description` varchar(255) DEFAULT NULL, + `repositoryUUID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`id`), + 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, + `name` varchar(255) NOT NULL, + `data` 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 `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, + `changes` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `oldOffset` int(10) unsigned NOT NULL, + `oldLen` int(10) unsigned NOT NULL, + `newOffset` int(10) unsigned NOT NULL, + `newLen` int(10) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + 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, + `commentID` int(10) unsigned DEFAULT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `changesetID` int(10) unsigned NOT NULL, + `isNewFile` tinyint(1) NOT NULL, + `lineNumber` int(10) unsigned NOT NULL, + `lineLength` int(10) unsigned NOT NULL, + `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `cache` longtext CHARACTER SET utf8 COLLATE utf8_bin, + PRIMARY KEY (`id`), + KEY `changesetID` (`changesetID`), + KEY `commentID` (`commentID`), + 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, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `sequence` int(10) unsigned NOT NULL, + `reasonPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`revisionID`,`relation`,`objectPHID`), + 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, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `status` varchar(32) NOT NULL, + `summary` longtext NOT NULL, + `testPlan` text NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `lastReviewerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `dateCommitted` int(10) unsigned DEFAULT NULL, + `lineCount` int(10) unsigned DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `attached` longtext NOT NULL, + `unsubscribed` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `mailKey` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `branchName` varchar(255) DEFAULT NULL, + `arcanistProjectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + 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, + `hash` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + KEY `type` (`type`,`hash`), + 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, + `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 DATABASE IF NOT EXISTS `{$NAMESPACE}_draft` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_draft`; + +CREATE TABLE `draft` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `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, + `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; + +USE `{$NAMESPACE}_drydock`; + +CREATE TABLE `drydock_lease` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `resourceID` int(10) unsigned DEFAULT NULL, + `status` int(10) unsigned NOT NULL, + `until` int(10) unsigned DEFAULT NULL, + `ownerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `attributes` 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 `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, + `leaseID` int(10) unsigned DEFAULT NULL, + `epoch` int(10) unsigned NOT NULL, + `message` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `resourceID` (`resourceID`,`epoch`), + KEY `leaseID` (`leaseID`,`epoch`), + 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, + `name` varchar(255) NOT NULL, + `ownerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `status` int(10) unsigned NOT NULL, + `blueprintClass` varchar(255) NOT NULL, + `type` varchar(64) NOT NULL, + `attributes` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `capabilities` 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 `phid` (`phid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_feed` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_feed`; + +CREATE TABLE `feed_storydata` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `chronologicalKey` bigint(20) unsigned NOT NULL, + `storyType` varchar(64) NOT NULL, + `storyData` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `authorPHID` 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`), + UNIQUE KEY `chronologicalKey` (`chronologicalKey`), + UNIQUE KEY `phid` (`phid`) +) 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, + UNIQUE KEY `objectPHID` (`objectPHID`,`chronologicalKey`), + KEY `chronologicalKey` (`chronologicalKey`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_file` 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, + `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 `file` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `name` varchar(255) DEFAULT NULL, + `mimeType` varchar(255) DEFAULT NULL, + `byteSize` bigint(20) unsigned NOT NULL, + `storageEngine` varchar(32) NOT NULL, + `storageFormat` varchar(32) NOT NULL, + `storageHandle` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `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, + 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, + `filePHID` varchar(64) NOT NULL, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) 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, + `data` longblob NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + 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, + `transform` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `transformedPHID` 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`), + UNIQUE KEY `originalPHID` (`originalPHID`,`transform`), + KEY `transformedPHID` (`transformedPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_flag` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_flag`; + +CREATE TABLE `flag` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ownerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `reasonPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `color` int(10) unsigned NOT NULL, + `note` varchar(255) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ownerPHID` (`ownerPHID`,`type`,`objectPHID`), + KEY `objectPHID` (`objectPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_herald` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_herald`; + +CREATE TABLE `herald_action` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `ruleID` int(10) unsigned NOT NULL, + `action` varchar(255) NOT NULL, + `target` text NOT NULL, + PRIMARY KEY (`id`), + 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, + `fieldName` varchar(255) NOT NULL, + `fieldCondition` varchar(255) NOT NULL, + `value` text NOT NULL, + PRIMARY KEY (`id`), + 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, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `contentType` varchar(255) NOT NULL, + `mustMatchAll` tinyint(1) NOT NULL, + `configVersion` int(10) unsigned NOT NULL DEFAULT '1', + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `repetitionPolicy` int(10) unsigned DEFAULT NULL, + `ruleType` varchar(255) NOT NULL DEFAULT 'global', + PRIMARY KEY (`id`), + UNIQUE KEY `authorPHID` (`authorPHID`,`name`), + 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, + PRIMARY KEY (`ruleID`,`phid`), + 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, + `editorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `ruleName` varchar(255) NOT NULL, + `action` varchar(32) NOT NULL, + PRIMARY KEY (`id`), + 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, + `time` int(10) unsigned NOT NULL, + `host` varchar(255) NOT NULL, + `psth` varchar(255) NOT NULL, + `duration` float NOT NULL, + `objectPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dryRun` tinyint(1) NOT NULL, + `objectTranscript` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `ruleTranscripts` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `conditionTranscripts` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `applyTranscripts` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `garbageCollected` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + KEY `objectPHID` (`objectPHID`), + KEY `garbageCollected` (`garbageCollected`,`time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_maniphest` 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, + `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 `maniphest_savedquery` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `queryKey` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `name` varchar(128) NOT NULL, + `isDefault` tinyint(1) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `userPHID` (`userPHID`,`name`), + 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, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `ownerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `ccPHIDs` text, + `attached` longtext NOT NULL, + `status` int(10) unsigned NOT NULL, + `priority` int(10) unsigned NOT NULL, + `title` text NOT NULL, + `description` longtext NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `projectPHIDs` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `mailKey` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `ownerOrdering` varchar(64) DEFAULT NULL, + `originalEmailSource` varchar(255) DEFAULT NULL, + `subpriority` double NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + KEY `priority` (`priority`,`status`), + KEY `status` (`status`), + KEY `ownerPHID` (`ownerPHID`,`status`), + KEY `authorPHID` (`authorPHID`,`status`), + KEY `ownerOrdering` (`ownerOrdering`), + 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, + `name` varchar(255) NOT NULL, + `value` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + 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, + PRIMARY KEY (`projectPHID`,`taskPHID`), + 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, + PRIMARY KEY (`subscriberPHID`,`taskPHID`), + 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, + `touchedAt` int(10) unsigned NOT NULL, + 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, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `transactionType` varchar(16) NOT NULL, + `oldValue` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `newValue` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `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; + +USE `{$NAMESPACE}_meta_data`; + +CREATE TABLE `patch_status` ( + `patch` varchar(255) NOT NULL, + `applied` int(10) unsigned NOT NULL, + 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; + +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, + `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 `metamta_mail` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `parameters` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `status` varchar(255) NOT NULL, + `message` text, + `retryCount` int(10) unsigned NOT NULL, + `nextRetry` int(10) unsigned NOT NULL, + `relatedPHID` 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`), + KEY `status` (`status`,`nextRetry`), + 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, + `name` varchar(255) NOT NULL, + `email` varchar(255) NOT NULL, + `uri` varchar(255) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + UNIQUE KEY `email` (`email`), + 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, + `bodies` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `attachments` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `relatedPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `message` longtext CHARACTER SET utf8 COLLATE utf8_bin, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `relatedPHID` (`relatedPHID`), + KEY `authorPHID` (`authorPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_oauth_server` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_oauth_server`; + +CREATE TABLE `oauth_server_oauthclientauthorization` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `clientPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `scope` text NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + 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, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `clientPHID` 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`), + 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, + `clientPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `clientSecret` varchar(32) NOT NULL, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `redirectURI` varchar(255) NOT NULL, + PRIMARY KEY (`id`), + 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, + `name` varchar(255) NOT NULL, + `secret` varchar(32) NOT NULL, + `redirectURI` varchar(255) 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, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + KEY `creatorPHID` (`creatorPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_owners` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_owners`; + +CREATE TABLE `owners_owner` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `packageID` int(10) unsigned NOT NULL, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `packageID` (`packageID`,`userPHID`), + 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, + `description` text NOT NULL, + `primaryOwnerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `auditingEnabled` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + 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, + PRIMARY KEY (`id`), + KEY `packageID` (`packageID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_pastebin` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_pastebin`; + +CREATE TABLE `pastebin_paste` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `filePHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `language` varchar(64) NOT NULL, + `parentPHID` 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; + +USE `{$NAMESPACE}_phame`; + +CREATE TABLE `phame_post` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `bloggerPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `title` varchar(255) NOT NULL, + `phameTitle` varchar(64) NOT NULL, + `body` longtext, + `visibility` int(10) unsigned NOT NULL DEFAULT '0', + `configData` longtext, + `datePublished` int(10) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + UNIQUE KEY `phameTitle` (`bloggerPHID`,`phameTitle`), + KEY `bloggerPosts` (`bloggerPHID`,`visibility`,`datePublished`,`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_phid` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_phid`; + +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, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_phriction` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_phriction`; + +CREATE TABLE `phriction_content` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `documentID` int(10) unsigned NOT NULL, + `version` int(10) unsigned NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `title` varchar(512) NOT NULL, + `slug` varchar(512) NOT NULL, + `content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `description` varchar(512) DEFAULT NULL, + `changeType` int(10) unsigned NOT NULL DEFAULT '0', + `changeRef` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `documentID` (`documentID`,`version`), + KEY `authorPHID` (`authorPHID`), + 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, + `slug` varchar(128) NOT NULL, + `depth` int(10) unsigned NOT NULL, + `contentID` int(10) unsigned DEFAULT NULL, + `status` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + UNIQUE KEY `slug` (`slug`), + 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 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 `project` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) NOT NULL, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `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, + 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, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `role` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `isOwner` tinyint(1) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `projectPHID` (`projectPHID`,`userPHID`), + 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, + `blurb` longtext NOT NULL, + `profileImagePHID` 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 `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, + PRIMARY KEY (`subprojectPHID`,`projectPHID`), + 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, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `transactionType` varchar(32) NOT NULL, + `oldValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `newValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `projectID` (`projectID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_repository` 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, + `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 `repository` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `name` varchar(255) NOT NULL, + `callsign` varchar(32) NOT NULL, + `versionControlSystem` varchar(32) NOT NULL, + `details` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `uuid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `callsign` (`callsign`), + 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, + `name` varchar(255) NOT NULL, + `repositoryID` int(10) unsigned DEFAULT NULL, + `symbolIndexLanguages` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `symbolIndexProjects` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + 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, + `commitPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `auditStatus` varchar(64) NOT NULL, + `auditReasons` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + KEY `commitPHID` (`commitPHID`), + 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_commit` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `repositoryID` int(10) unsigned NOT NULL, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commitIdentifier` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `epoch` int(10) unsigned NOT NULL, + `mailKey` varchar(20) NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `auditStatus` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`), + UNIQUE KEY `repositoryID` (`repositoryID`,`commitIdentifier`(16)), + KEY `repositoryID_2` (`repositoryID`,`epoch`), + 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, + `authorName` varchar(255) NOT NULL, + `commitMessage` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commitDetails` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `commitID` (`commitID`), + KEY `authorName` (`authorName`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `repository_filesystem` ( + `repositoryID` int(10) unsigned NOT NULL, + `parentID` int(10) unsigned NOT NULL, + `svnCommit` int(10) unsigned NOT NULL, + `pathID` int(10) unsigned NOT NULL, + `existed` tinyint(1) NOT NULL, + `fileType` int(10) unsigned NOT NULL, + PRIMARY KEY (`repositoryID`,`parentID`,`pathID`,`svnCommit`), + KEY `repositoryID` (`repositoryID`,`svnCommit`) +) 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, + `pathHash` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + 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, + `commitID` int(10) unsigned NOT NULL, + `targetPathID` int(10) unsigned DEFAULT NULL, + `targetCommitID` int(10) unsigned DEFAULT NULL, + `changeType` int(10) unsigned NOT NULL, + `fileType` int(10) unsigned NOT NULL, + `isDirect` tinyint(1) NOT NULL, + `commitSequence` int(10) unsigned NOT NULL, + PRIMARY KEY (`commitID`,`pathID`), + 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, + `href` varchar(255) NOT NULL, + `description` varchar(255) NOT NULL, + `sequence` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `repository_summary` ( + `repositoryID` int(10) unsigned NOT NULL, + `size` int(10) unsigned NOT NULL, + `lastCommitID` int(10) unsigned NOT NULL, + `epoch` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`repositoryID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `repository_symbol` ( + `arcanistProjectID` int(10) unsigned NOT NULL, + `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, + `pathID` int(10) unsigned NOT NULL, + `lineNumber` int(10) unsigned NOT NULL, + KEY `symbolName` (`symbolName`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_search` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_search`; + +CREATE TABLE `search_document` ( + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `documentType` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `documentTitle` varchar(255) NOT NULL, + `documentCreated` int(10) unsigned NOT NULL, + `documentModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`phid`), + 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, + `field` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `auxPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `corpus` text, + KEY `phid` (`phid`), + 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, + `relation` varchar(4) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `relatedType` varchar(4) NOT NULL, + `relatedTime` int(10) unsigned NOT NULL, + KEY `phid` (`phid`), + KEY `relatedPHID` (`relatedPHID`,`relation`), + 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, + `parameters` text NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `queryKey` varchar(12) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `queryKey` (`queryKey`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_slowvote` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_slowvote`; + +CREATE TABLE `slowvote_choice` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `pollID` int(10) unsigned NOT NULL, + `optionID` int(10) unsigned NOT NULL, + `authorPHID` 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 `pollID` (`pollID`), + 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, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `commentText` 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 `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, + `name` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + 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, + `phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `responseVisibility` int(10) unsigned NOT NULL, + `shuffle` int(10) unsigned NOT NULL, + `method` int(10) unsigned NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `phid` (`phid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_timeline` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_timeline`; + +CREATE TABLE `timeline_cursor` ( + `name` varchar(255) NOT NULL, + `position` int(10) unsigned NOT NULL, + 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, + `dataID` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `dataID` (`dataID`), + 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; + +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, + `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 `phabricator_session` ( + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `type` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `sessionKey` varchar(40) NOT NULL, + `sessionStart` int(10) unsigned NOT NULL, + PRIMARY KEY (`userPHID`,`type`), + 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, + `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, + `dateModified` int(10) unsigned NOT NULL, + `profileImagePHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `consoleEnabled` tinyint(1) NOT NULL, + `consoleVisible` tinyint(1) NOT NULL, + `consoleTab` varchar(64) NOT NULL, + `conduitCertificate` varchar(255) NOT NULL, + `isSystemAgent` tinyint(1) NOT NULL DEFAULT '0', + `isDisabled` tinyint(1) NOT NULL, + `isAdmin` tinyint(1) NOT NULL, + `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_log` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `actorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `userPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `action` varchar(64) NOT NULL, + `oldValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `newValue` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `details` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `remoteAddr` varchar(45) NOT NULL, + `session` varchar(40) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `actorPHID` (`actorPHID`,`dateCreated`), + KEY `userPHID` (`userPHID`,`dateCreated`), + KEY `action` (`action`,`dateCreated`), + KEY `dateCreated` (`dateCreated`), + KEY `remoteAddr` (`remoteAddr`,`dateCreated`), + KEY `session` (`session`,`dateCreated`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `user_nametoken` ( + `token` varchar(255) NOT NULL, + `userID` int(10) unsigned NOT NULL, + KEY `token` (`token`), + 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, + `oauthProvider` varchar(255) NOT NULL, + `oauthUID` varchar(255) NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + `accountURI` varchar(255) DEFAULT NULL, + `accountName` varchar(255) DEFAULT NULL, + `token` varchar(255) DEFAULT NULL, + `tokenExpires` int(10) unsigned DEFAULT NULL, + `tokenScope` varchar(255) DEFAULT NULL, + `tokenStatus` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `userID` (`userID`,`oauthProvider`), + 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, + `preferences` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + PRIMARY KEY (`id`), + 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, + `title` varchar(255) NOT NULL, + `blurb` text NOT NULL, + `profileImagePHID` 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 `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, + `name` varchar(255) DEFAULT NULL, + `keyType` varchar(255) DEFAULT NULL, + `keyBody` text CHARACTER SET utf8 COLLATE utf8_bin, + `keyHash` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `keyComment` varchar(255) DEFAULT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `keyHash` (`keyHash`), + KEY `userPHID` (`userPHID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE DATABASE IF NOT EXISTS `{$NAMESPACE}_worker` DEFAULT CHARACTER SET utf8; + +USE `{$NAMESPACE}_worker`; + +CREATE TABLE `worker_task` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `taskClass` varchar(255) NOT NULL, + `leaseOwner` varchar(255) DEFAULT NULL, + `leaseExpires` int(10) unsigned DEFAULT NULL, + `failureCount` int(10) unsigned NOT NULL, + `dataID` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `dataID` (`dataID`), + KEY `taskClass` (`taskClass`), + KEY `leaseExpires` (`leaseExpires`), + KEY `leaseOwner` (`leaseOwner`(16)) +) 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; + +USE `{$NAMESPACE}_xhpastview`; + +CREATE TABLE `xhpastview_parsetree` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, + `input` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `stdout` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + `dateCreated` int(10) unsigned NOT NULL, + `dateModified` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +