|
@@ -2,13 +2,13 @@
|
|
|
|
|
|
namespace Application\Migrations;
|
|
namespace Application\Migrations;
|
|
|
|
|
|
-use Doctrine\DBAL\Migrations\AbstractMigration;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
|
|
+use MigrationsBundle\Migrations\MigrationsBase;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
*/
|
|
-class Version20180315124145 extends AbstractMigration
|
|
|
|
|
|
+class Version201a80315124145 extends MigrationsBase
|
|
{
|
|
{
|
|
/**
|
|
/**
|
|
* @param Schema $schema
|
|
* @param Schema $schema
|
|
@@ -16,10 +16,18 @@ class Version20180315124145 extends AbstractMigration
|
|
public function up(Schema $schema)
|
|
public function up(Schema $schema)
|
|
{
|
|
{
|
|
// this up() migration is auto-generated, please modify it to your needs
|
|
// this up() migration is auto-generated, please modify it to your needs
|
|
- $this->addsql("ALTER TABLE oltmodel ADD netmiko VARCHAR(255) DEFAULT NULL;");
|
|
|
|
- $this->addsql("ALTER TABLE oltmodel_audit ADD netmiko VARCHAR(255) DEFAULT NULL;");
|
|
|
|
- $this->addSql("ALTER TABLE olt ADD backups TINYINT(1) DEFAULT '1' NOT NULL, CHANGE execute_snmp execute_snmp BOOLEAN DEFAULT TRUE;");
|
|
|
|
- $this->addSql("ALTER TABLE olt_audit ADD backups TINYINT(1) DEFAULT '1', CHANGE execute_snmp execute_snmp BOOLEAN DEFAULT TRUE;");
|
|
|
|
|
|
+ if (!$this->existFieldInTable('oltmodel', 'netmiko')) {
|
|
|
|
+ $this->addsql("ALTER TABLE oltmodel ADD netmiko VARCHAR(255) DEFAULT NULL;");
|
|
|
|
+ }
|
|
|
|
+ if (!$this->existFieldInTable('oltmodel_audit', 'netmiko')) {
|
|
|
|
+ $this->addsql("ALTER TABLE oltmodel_audit ADD netmiko VARCHAR(255) DEFAULT NULL;");
|
|
|
|
+ }
|
|
|
|
+ if (!$this->existFieldInTable('olt', 'backups')) {
|
|
|
|
+ $this->addSql("ALTER TABLE olt ADD backups TINYINT(1) DEFAULT '1' NOT NULL, CHANGE execute_snmp execute_snmp BOOLEAN DEFAULT TRUE;");
|
|
|
|
+ }
|
|
|
|
+ if (!$this->existFieldInTable('olt_audit', 'backups')) {
|
|
|
|
+ $this->addSql("ALTER TABLE olt_audit ADD backups TINYINT(1) DEFAULT '1', CHANGE execute_snmp execute_snmp BOOLEAN DEFAULT TRUE;");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|