Created
August 18, 2011 18:09
-
-
Save havvg/1154715 to your computer and use it in GitHub Desktop.
Example storage configuration file for Sismo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$con = new \PDO('mysql:host=localhost;dbname=sismo', 'sismo'); | |
$sql = <<<SQL | |
CREATE TABLE IF NOT EXISTS `project` ( | |
`slug` VARCHAR(128), | |
`name` TEXT, | |
`repository` TEXT, | |
`branch` TEXT, | |
`command` BLOB, | |
`url_pattern` TEXT, | |
PRIMARY KEY (`slug`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
CREATE TABLE IF NOT EXISTS `commit` ( | |
`slug` VARCHAR(128), | |
`sha` VARCHAR(128), | |
`date` DATETIME, | |
`message` BLOB, | |
`author` TEXT, | |
`status` TEXT, | |
`output` BLOB, | |
`build_date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`slug`, `sha`), | |
CONSTRAINT `slug` FOREIGN KEY (`slug`) REFERENCES `project` (`slug`) ON DELETE CASCADE | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
SQL; | |
$con->exec($sql); | |
return new \Sismo\PdoStorage($con); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment