migrations/Version20190606144933.php line 1

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace DoctrineMigrations;
  3. use Doctrine\DBAL\Schema\Schema;
  4. use Doctrine\Migrations\AbstractMigration;
  5. /**
  6. * Auto-generated Migration: Please modify to your needs!
  7. */
  8. final class Version20190606144933 extends AbstractMigration
  9. {
  10. public function up(Schema $schema) : void
  11. {
  12. // this up() migration is auto-generated, please modify it to your needs
  13. $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
  14. $this->addSql('ALTER TABLE vsabo ADD aboname_short VARCHAR(8) DEFAULT NULL, ADD max_length_vs_titel INT DEFAULT NULL, ADD max_length_vs_beschreibung INT DEFAULT NULL');
  15. $this->addSql("UPDATE vsabo SET aboname_short='K', max_length_vs_titel = 50, max_length_vs_beschreibung = 60 WHERE id=1");
  16. $this->addSql("UPDATE vsabo SET aboname_short='SO', max_length_vs_titel = 60, max_length_vs_beschreibung = 120 WHERE id=2");
  17. $this->addSql("UPDATE vsabo SET aboname_short='SM', max_length_vs_titel = 60, max_length_vs_beschreibung = 120 WHERE id=3");
  18. $this->addSql("UPDATE vsabo SET aboname_short='PO', max_length_vs_titel = 100, max_length_vs_beschreibung = 300 WHERE id=4");
  19. $this->addSql("UPDATE vsabo SET aboname_short='PM', max_length_vs_titel = 100, max_length_vs_beschreibung = 300 WHERE id=5");
  20. }
  21. public function down(Schema $schema) : void
  22. {
  23. // this down() migration is auto-generated, please modify it to your needs
  24. $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
  25. $this->addSql('ALTER TABLE vsabo DROP aboname_short, DROP max_length_vs_titel, DROP max_length_vs_beschreibung');
  26. }
  27. }