50 lines
2.3 KiB
PHP
50 lines
2.3 KiB
PHP
<?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 Version20231020145208 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
// this up() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('ALTER TABLE assignment ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('ALTER TABLE availability ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('ALTER TABLE destination ADD created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('ALTER TABLE disposition ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('ALTER TABLE fee ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('ALTER TABLE job_profile ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
|
$this->addSql('ALTER TABLE training ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
|
|
}
|
|
|
|
public function postUp(Schema $schema): void
|
|
{
|
|
$timestamp = (new \DateTimeImmutable())->format('Y-m-d H:i:s');
|
|
$this->connection->executeQuery('UPDATE destination set created_at=?', [$timestamp]);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('ALTER TABLE disposition DROP deleted_at');
|
|
$this->addSql('ALTER TABLE assignment DROP deleted_at');
|
|
$this->addSql('ALTER TABLE destination DROP created_at, DROP updated_at, DROP deleted_at');
|
|
$this->addSql('ALTER TABLE job_profile DROP deleted_at');
|
|
$this->addSql('ALTER TABLE training DROP deleted_at');
|
|
$this->addSql('ALTER TABLE fee DROP deleted_at');
|
|
$this->addSql('ALTER TABLE availability DROP deleted_at');
|
|
}
|
|
}
|