Forráskód Böngészése

Merge branch 'hotfix-correct-migrations' into 'master'

Fixed migrations when i use command docker-compose

See merge request interlink-sa/flowdat3/modules/ftth!156
Jean Sumara Leopoldo 5 éve
szülő
commit
e04c33623f

+ 27 - 0
app/DoctrineMigrations/Version20190823104523.php

@@ -0,0 +1,27 @@
+<?php
+
+
+namespace Application\Migrations;
+
+
+use Doctrine\DBAL\Migrations\AbstractMigration;
+use Doctrine\DBAL\Schema\Schema;
+
+class Version20190823104523 extends AbstractMigration
+{
+    /**
+     * @param Schema $schema
+     */
+    public function up(Schema $schema)
+    {
+        $this->addSql("INSERT IGNORE INTO vlan_id (id, name, value, tenancy_id, used_by_default) SELECT 1, 'vlanid_data', 10, 1, 1 FROM DUAL WHERE NOT EXISTS(SELECT * FROM vlan_id WHERE id != 1 && id != 2);");
+        $this->addSql("INSERT IGNORE INTO vlan_id (id, name, value, tenancy_id, used_by_default) SELECT 2, 'vlanid_voip', 13, 1, 1 FROM DUAL WHERE NOT EXISTS(SELECT * FROM vlan_id WHERE id != 1 && id != 2);");
+    }
+
+    /**
+     * @param Schema $schema
+     */
+    public function down(Schema $schema)
+    {
+    }
+}

+ 0 - 14
app/DoctrineMigrations/src/vlan_id.yml

@@ -1,14 +0,0 @@
-insertignore:
-    vlan_id:
-        -
-          id: 1
-          name: "vlanid_data"
-          value: 10
-          used_by_default: 1
-          tenancy_id: 1
-        -
-          id: 2
-          name: "vlanid_voip"
-          value: 13
-          used_by_default: 1
-          tenancy_id: 1