migrations/Version20240419142313.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Constants\OperatorTypeConstants;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  */
  10. final class Version20240419142313 extends AbstractMigration
  11. {
  12.     public function getDescription(): string
  13.     {
  14.         return '';
  15.     }
  16.     public function up(Schema $schema): void
  17.     {
  18.         // this up() migration is auto-generated, please modify it to your needs
  19.         $this->addSql('ALTER TABLE tariff CHANGE subscription subscription VARCHAR(191) NOT NULL');
  20.         $this->addSql('UPDATE tariff t INNER JOIN operator o ON o.id = t.operator_id SET t.subscription = "згідно обраного тарифного плану" WHERE o.type = '.OperatorTypeConstants::LIFECELL);
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('ALTER TABLE tariff CHANGE subscription subscription DOUBLE PRECISION NOT NULL');
  26.     }
  27. }