]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - migrations/20150119171459_init_database.php
Test for GET on empty database
[github/wallabag/wallabag.git] / migrations / 20150119171459_init_database.php
index 48a7d4b6aa5db858d64077070288039d6356f3b6..35fc9e07f877a53fa97d23a8ba60d349c1a54e50 100644 (file)
@@ -3,18 +3,13 @@
 use Phinx\Migration\AbstractMigration;
 
 class InitDatabase extends AbstractMigration
-{    
+{
     /**
      * Migrate Up.
      */
     public function up()
     {
-        $this->execute("CREATE TABLE IF NOT EXISTS `montest` (
-  `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;");
+        $this->execute("INSERT INTO config (name, value) VALUES ('foo', 'bar');");
     }
 
     /**
@@ -22,6 +17,6 @@ class InitDatabase extends AbstractMigration
      */
     public function down()
     {
-        $this->execute("DROP DATABASE montest;");
+        $this->execute("DELETE FROM config WHERE name = 'foo' AND value = 'bar';");
     }
 }
\ No newline at end of file