浏览代码

update migrations

Espinoza Guillermo 6 年之前
父节点
当前提交
30d7735b96
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      app/DoctrineMigrations/Version20180221174411.php
  2. 1 1
      app/DoctrineMigrations/src/template.yml

+ 2 - 2
app/DoctrineMigrations/Version20180221174411.php

@@ -21,7 +21,7 @@ class Version20180221174411 extends MigrationsBase
 
 
     if (!$schema->hasTable('service_port') == true) {
-        $this->addSql('CREATE TABLE service_port (id INT AUTO_INCREMENT NOT NULL, olt_id BIGINT DEFAULT NULL, onu_id INT DEFAULT NULL, number INT DEFAULT 0 NOT NULL, gemport INT DEFAULT 0 NOT NULL, vlan INT DEFAULT 0 NOT NULL, type VARCHAR(255) NOT NULL, INDEX IDX_8DD2E92069FFAD89 (olt_id), INDEX IDX_8DD2E920AB83998C (onu_id), UNIQUE INDEX sp_unique (olt_id, number), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
+        $this->addSql('CREATE TABLE service_port (id INT AUTO_INCREMENT NOT NULL, olt_id BIGINT DEFAULT NULL, onu_id INT DEFAULT NULL, number INT DEFAULT 0 NOT NULL, gemport INT DEFAULT 0 NOT NULL, vlan INT DEFAULT 0 NOT NULL, INDEX IDX_8DD2E92069FFAD89 (olt_id), INDEX IDX_8DD2E920AB83998C (onu_id), UNIQUE INDEX sp_unique (olt_id, number), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
         $this->addSql('ALTER TABLE service_port ADD CONSTRAINT FK_8DD2E92069FFAD89 FOREIGN KEY (olt_id) REFERENCES olt (id)');
         $this->addSql('ALTER TABLE service_port ADD CONSTRAINT FK_8DD2E920AB83998C FOREIGN KEY (onu_id) REFERENCES onu (id)');
         $this->addSql('ALTER TABLE olt CHANGE execute_snmp execute_snmp BOOLEAN DEFAULT TRUE');
@@ -50,7 +50,7 @@ class Version20180221174411 extends MigrationsBase
         foreach($service_port as $type => $number){
             $gemport = $vlangemport_config[$type]['gemport'];
             $vlan = $vlangemport_config[$type]['vlan'];
-            $sql = "REPLACE INTO service_port (olt_id, onu_id, number, type, gemport, vlan) VALUES ($olt_id, $onu_id, $number, '$type', $gemport, $vlan);";
+            $sql = "REPLACE INTO service_port (olt_id, onu_id, number, gemport, vlan) VALUES ($olt_id, $onu_id, $number, $gemport, $vlan);";
             $this->addSql($sql);
         }
     }

文件差异内容过多而无法显示
+ 1 - 1
app/DoctrineMigrations/src/template.yml