|
@@ -4,11 +4,12 @@ namespace Application\Migrations;
|
|
|
|
|
|
use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
|
+use MigrationsBundle\Migrations\MigrationsBase;
|
|
|
|
|
|
/**
|
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
|
*/
|
|
|
-class Version20180221174411 extends AbstractMigration
|
|
|
+class Version20180221174411 extends MigrationsBase
|
|
|
{
|
|
|
/**
|
|
|
* @param Schema $schema
|
|
@@ -26,7 +27,7 @@ class Version20180221174411 extends AbstractMigration
|
|
|
$this->addSql('ALTER TABLE olt_audit CHANGE execute_snmp execute_snmp BOOLEAN DEFAULT TRUE');
|
|
|
}
|
|
|
|
|
|
- $result = $this->connection->query("select o.id id, o.olt_id, nap_id, pon_serial_number, position, slot, link FROM onu o JOIN nap n ON (n.id = o.nap_id) WHERE o.deleted_at IS NULL;");
|
|
|
+ $result = $this->connection->query("select o.id id, o.olt_id, nap_id, pon_serial_number, position, slot, link, ot.name FROM onu o JOIN nap n ON (n.id = o.nap_id) JOIN olt t ON (t.id = o.olt_id) JOIN oltmodel ot ON(t.model_id = ot.id) WHERE o.deleted_at IS NULL AND ot.name LIKE 'Huawei MA5608T';");
|
|
|
|
|
|
$i = 0;
|
|
|
$vlangemport_config = array('voip' => array('gemport' => 0, 'vlan' => 13), 'data' => array('gemport' => 1, 'vlan' => 10));
|
|
@@ -48,10 +49,17 @@ class Version20180221174411 extends AbstractMigration
|
|
|
foreach($service_port as $type => $number){
|
|
|
$gemport = $vlangemport_config[$type]['gemport'];
|
|
|
$vlan = $vlangemport_config[$type]['vlan'];
|
|
|
- $sql = "INSERT 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, type, gemport, vlan) VALUES ($olt_id, $onu_id, $number, '$type', $gemport, $vlan);";
|
|
|
$this->addSql($sql);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ // this up() migration is auto-generated, please modify it to your needs
|
|
|
+ $this->executeYaml(__DIR__ . "/Templates20180221174411/", "template-action-2018-02-26.yml");
|
|
|
+ $this->showResult();
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|