<?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 Version20220228124112 extends AbstractMigration
{
public function getDescription(): string
{
return 'В TimeEntry добавлены поля StartAbs,EndAbs,CreateAt,UpdatedAt,is_fixed';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE time_entry ADD timer_start_absolute TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE time_entry ADD timer_end_absolute TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE time_entry ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT \'now()\' NOT NULL');
$this->addSql('ALTER TABLE time_entry ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN time_entry.is_fixed IS \'Change prohibition\'');
$this->addSql('COMMENT ON COLUMN time_entry.created_at IS \'Дата создания\'');
$this->addSql('COMMENT ON COLUMN time_entry.updated_at IS \'Дата обновления\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE time_entry DROP timer_start_absolute');
$this->addSql('ALTER TABLE time_entry DROP timer_end_absolute');
$this->addSql('ALTER TABLE time_entry DROP created_at');
$this->addSql('ALTER TABLE time_entry DROP updated_at');
}
}