mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Clean migration for thirdparty bundle
This commit is contained in:
parent
877c33e4ce
commit
fa8f6d6f15
@ -200,7 +200,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin
|
||||
* [fr] Qualité.
|
||||
*/
|
||||
#[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])]
|
||||
#[ORM\Column(name: 'profession', type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)]
|
||||
#[ORM\Column(name: 'profession', type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])]
|
||||
#[Context(normalizationContext: ['groups' => 'docgen:read'], groups: ['docgen:read:3party:parent'])]
|
||||
private string $profession = '';
|
||||
|
||||
|
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\ThirdParty;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20240918152229 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Drop foreign key profession_id and set not null on firstname';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_3party.third_party DROP profession_id');
|
||||
$this->addSql('ALTER TABLE chill_3party.third_party ALTER firstname SET NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user