test for migration

This commit is contained in:
Nicolas Lœuillet 2015-01-20 07:50:50 +01:00
parent 9a5c1bc62a
commit 8d6ff10e8e
2 changed files with 6 additions and 11 deletions

View File

@ -9,12 +9,7 @@ class InitDatabase extends AbstractMigration
*/ */
public function up() public function up()
{ {
$this->execute("CREATE TABLE IF NOT EXISTS `montest` ( $this->execute("INSERT INTO config (name, value) VALUES ('foo', 'bar');");
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
} }
/** /**
@ -22,6 +17,6 @@ class InitDatabase extends AbstractMigration
*/ */
public function down() public function down()
{ {
$this->execute("DROP DATABASE montest;"); $this->execute("DELETE FROM config WHERE name = 'foo' AND value = 'bar';");
} }
} }

View File

@ -6,12 +6,12 @@ environments:
default_database: development default_database: development
production: production:
adapter: sqlite adapter: sqlite
name: db/poche name: app/db/poche
development: development:
adapter: sqlite adapter: sqlite
name: db/poche name: app/db/poche
testing: testing:
adapter: sqlite adapter: sqlite
name: db/poche name: app/db/poche