migrations/Version20220228124112.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220228124112 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'В TimeEntry добавлены поля StartAbs,EndAbs,CreateAt,UpdatedAt,is_fixed';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('ALTER TABLE time_entry ADD timer_start_absolute TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE time_entry ADD timer_end_absolute TIMESTAMP(0) WITH TIME ZONE DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE time_entry ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT \'now()\' NOT NULL');
  21.         $this->addSql('ALTER TABLE time_entry ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
  22.         $this->addSql('COMMENT ON COLUMN time_entry.is_fixed IS \'Change prohibition\'');
  23.         $this->addSql('COMMENT ON COLUMN time_entry.created_at IS \'Дата создания\'');
  24.         $this->addSql('COMMENT ON COLUMN time_entry.updated_at IS \'Дата обновления\'');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE time_entry DROP timer_start_absolute');
  30.         $this->addSql('ALTER TABLE time_entry DROP timer_end_absolute');
  31.         $this->addSql('ALTER TABLE time_entry DROP created_at');
  32.         $this->addSql('ALTER TABLE time_entry DROP updated_at');
  33.     }
  34. }