zend-blog-3-backend
30 строк · 1.5 Кб
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 Version20240830055032 extends AbstractMigration14{
15public function up(Schema $schema): void16{17// this up() migration is auto-generated, please modify it to your needs18$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');19
20$this->addSql('CREATE TABLE subscription_settings (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(64) NOT NULL, block_sending TINYINT(1) DEFAULT 0 NOT NULL, subs_type SMALLINT DEFAULT 1 NOT NULL COMMENT \'1: reply\', time_created DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3) NOT NULL COMMENT \'(DC2Type:milliseconds_dt)\', last_update DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3) NOT NULL COMMENT \'(DC2Type:milliseconds_dt)\', UNIQUE INDEX UNIQ_82EBFFE9E7927C744DD186C6 (email, subs_type), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');21}22
23public function down(Schema $schema): void24{25// this down() migration is auto-generated, please modify it to your needs26$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');27
28$this->addSql('DROP TABLE subscription_settings');29}30}
31