<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20191110083406 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add calendar definition entity';
}
/**
* @throws \Doctrine\DBAL\DBALException
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE TABLE calendar (
id UUID NOT NULL,
title VARCHAR(255) NOT NULL,
description TEXT DEFAULT NULL,
calendar_id VARCHAR(255) NOT NULL,
public_url VARCHAR(255) DEFAULT NULL,
i_cal_address VARCHAR(255) DEFAULT NULL,
confirm_to TEXT DEFAULT NULL, PRIMARY KEY(id),
slug VARCHAR(255) NOT NULL)'
);
$this->addSql('COMMENT ON COLUMN calendar.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN calendar.confirm_to IS \'(DC2Type:simple_array)\'');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6EA9A1462B36786B ON calendar (title)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6EA9A146A40A2C8 ON calendar (calendar_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6EA9A146989D9B62 ON calendar (slug)');
}
/**
* @throws \Doctrine\DBAL\DBALException
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('DROP INDEX UNIQ_6EA9A1462B36786B');
$this->addSql('DROP INDEX UNIQ_6EA9A146A40A2C8');
$this->addSql('DROP INDEX UNIQ_6EA9A146989D9B62');
$this->addSql('DROP TABLE calendar');
}
}