Clean migration of default definitions for entity properties

This commit is contained in:
2024-11-04 15:18:59 +01:00
committed by Julien Fastré
parent 31912b9b91
commit 9698a5e987
5 changed files with 32 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241104135957 extends AbstractMigration
{
public function getDescription(): string
{
return 'Define default values for entity properties';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_event_event ALTER organizationcost DROP DEFAULT');
$this->addSql('ALTER TABLE chill_person_accompanying_period_user_history ALTER startdate SET DEFAULT \'now()\'');
$this->addSql('ALTER TABLE chill_event_event ALTER organizationcost SET DEFAULT \'0.0\'');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_event_event ALTER organizationCost SET DEFAULT \'0.0\'');
}
}