Version20180315124145.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Application\Migrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use MigrationsBundle\Migrations\MigrationsBase;
  5. /**
  6. * Auto-generated Migration: Please modify to your needs!
  7. */
  8. class Version20180315124145 extends MigrationsBase
  9. {
  10. /**
  11. * @param Schema $schema
  12. */
  13. public function up(Schema $schema)
  14. {
  15. // this up() migration is auto-generated, please modify it to your needs
  16. if (!$this->existFieldInTable('oltmodel', 'netmiko')) {
  17. $this->addsql("ALTER TABLE oltmodel ADD netmiko VARCHAR(255) DEFAULT NULL;");
  18. }
  19. if (!$this->existFieldInTable('oltmodel_audit', 'netmiko')) {
  20. $this->addsql("ALTER TABLE oltmodel_audit ADD netmiko VARCHAR(255) DEFAULT NULL;");
  21. }
  22. if (!$this->existFieldInTable('olt', 'backups')) {
  23. $this->addSql("ALTER TABLE olt ADD backups TINYINT(1) DEFAULT '1';");
  24. }
  25. if (!$this->existFieldInTable('olt_audit', 'backups')) {
  26. $this->addSql("ALTER TABLE olt_audit ADD backups TINYINT(1) DEFAULT '1';");
  27. }
  28. }
  29. /**
  30. * @param Schema $schema
  31. */
  32. public function down(Schema $schema)
  33. {
  34. // this down() migration is auto-generated, please modify it to your needs
  35. }
  36. }