mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
30 lines
1.0 KiB
PHP
30 lines
1.0 KiB
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace Application\Migrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Switch event date to datetime
|
|
*/
|
|
final class Version20190110140538 extends AbstractMigration
|
|
{
|
|
public function up(Schema $schema): void
|
|
{
|
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
|
|
|
$this->addSql('ALTER TABLE chill_event_event ALTER date TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
|
|
$this->addSql('ALTER TABLE chill_event_event ALTER date DROP DEFAULT');
|
|
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
|
|
|
$this->addSql('ALTER TABLE chill_event_event ALTER date TYPE DATE');
|
|
$this->addSql('ALTER TABLE chill_event_event ALTER date DROP DEFAULT');
|
|
}
|
|
}
|