]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/DoctrineMigrations/Version20160410190541.php
Add migration
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20160410190541.php
diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php
new file mode 100644 (file)
index 0000000..b30a898
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace Application\Migrations;
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+
+class Version20160410190541 extends AbstractMigration
+{
+    /**
+     * @param Schema $schema
+     */
+    public function up(Schema $schema)
+    {
+        $this->addSql('ALTER TABLE wallabag_entry ADD uuid LONGTEXT DEFAULT NULL');
+        $this->addSql('UPDATE wallabag_entry SET uuid = uuid()');
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function down(Schema $schema)
+    {
+        $this->addSql('ALTER TABLE `wallabag_entry` DROP uuid');
+    }
+}