migrations/Version20220417204749.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220417204749 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('ALTER TABLE video DROP FOREIGN KEY FK_7CC7DA2CA76ED395');
  18.         $this->addSql('DROP INDEX IDX_7CC7DA2CA76ED395 ON video');
  19.         $this->addSql('ALTER TABLE video DROP amount, CHANGE user_id creator_id BIGINT UNSIGNED DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE video ADD CONSTRAINT FK_7CC7DA2C61220EA6 FOREIGN KEY (creator_id) REFERENCES creator (id)');
  21.         $this->addSql('CREATE INDEX IDX_7CC7DA2C61220EA6 ON video (creator_id)');
  22.     }
  23.     public function down(Schema $schema): void
  24.     {
  25.         $this->addSql('ALTER TABLE video DROP FOREIGN KEY FK_7CC7DA2C61220EA6');
  26.         $this->addSql('DROP INDEX IDX_7CC7DA2C61220EA6 ON video');
  27.         $this->addSql('ALTER TABLE video ADD amount DOUBLE PRECISION UNSIGNED NOT NULL, CHANGE creator_id user_id BIGINT UNSIGNED DEFAULT NULL');
  28.         $this->addSql('ALTER TABLE video ADD CONSTRAINT FK_7CC7DA2CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
  29.         $this->addSql('CREATE INDEX IDX_7CC7DA2CA76ED395 ON video (user_id)');
  30.     }
  31.     public function isTransactional(): bool
  32.     {
  33.         return false;
  34.     }
  35. }