Created
November 4, 2012 13:48
-
-
Save eminetto/4011989 to your computer and use it in GitHub Desktop.
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 | |
//queries used by tests | |
return array( | |
'posts' => array( | |
'create' => 'CREATE TABLE if not exists posts ( | |
id INT NOT NULL AUTO_INCREMENT , | |
title VARCHAR(250) NOT NULL , | |
description TEXT NOT NULL , | |
post_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , | |
PRIMARY KEY (id) ) | |
ENGINE = InnoDB;', | |
'drop' => "DROP TABLE posts;" | |
), | |
'comments' => array( | |
'create' => 'CREATE TABLE if not exists comments ( | |
id INT NOT NULL AUTO_INCREMENT , | |
post_id INT NOT NULL , | |
description TEXT NOT NULL , | |
name VARCHAR(200) NOT NULL , | |
email VARCHAR(250) NOT NULL , | |
webpage VARCHAR(200) NOT NULL , | |
comment_date TIMESTAMP NULL , | |
PRIMARY KEY (id, post_id) , | |
INDEX fk_comments_posts (post_id ASC) , | |
CONSTRAINT fk_comments_posts | |
FOREIGN KEY (post_id ) | |
REFERENCES posts (id ) | |
ON DELETE NO ACTION | |
ON UPDATE NO ACTION) | |
ENGINE = InnoDB;', | |
'drop' =>'drop table comments;' | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment