Skip to content

Instantly share code, notes, and snippets.

@havvg
Created August 18, 2011 18:09
Show Gist options
  • Save havvg/1154715 to your computer and use it in GitHub Desktop.
Save havvg/1154715 to your computer and use it in GitHub Desktop.
Example storage configuration file for Sismo
<?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