zend-blog-3-backend
36 строк · 1.4 Кб
1<?php
2
3declare(strict_types=1);
4
5namespace Application\Migrations;
6
7use Doctrine\DBAL\Schema\Schema;
8use Doctrine\Migrations\AbstractMigration;
9
10/**
11* Auto-generated Migration: Please modify to your needs!
12*/
13final class Version20230714065712 extends AbstractMigration
14{
15public function up(Schema $schema): void
16{
17// this up() migration is auto-generated, please modify it to your needs
18$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
19
20$this->addSql('ALTER TABLE media_file ADD picture_tag TEXT DEFAULT NULL');
21$this->addSql('DROP INDEX UNIQ_885DBAFAC71A1E10 ON posts');
22$this->addSql('ALTER TABLE posts DROP disqus_thread');
23$this->addSql('ALTER TABLE media_file ADD src_set TEXT DEFAULT NULL');
24}
25
26public function down(Schema $schema): void
27{
28// this down() migration is auto-generated, please modify it to your needs
29$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
30
31$this->addSql('ALTER TABLE media_file DROP picture_tag');
32$this->addSql('ALTER TABLE posts ADD disqus_thread BIGINT DEFAULT NULL');
33$this->addSql('CREATE UNIQUE INDEX UNIQ_885DBAFAC71A1E10 ON posts (disqus_thread)');
34$this->addSql('ALTER TABLE media_file DROP src_set');
35}
36}
37