FEATURE [profession] change field type of profession into string

This commit is contained in:
2023-02-15 20:08:04 +01:00
committed by Julien Fastré
parent c953da3fd0
commit ac4c821290
2 changed files with 34 additions and 8 deletions

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\ThirdParty;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230215175150 extends AbstractMigration
{
public function getDescription(): string
{
return 'Change profession to a string field and transfer values';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_3party.third_party ADD profession VARCHAR(255) DEFAULT \'\' NOT NULL');
// $this->addSql('ALTER TABLE chill_3party.third_party DROP profession_id');
}
public function down(Schema $schema): void
{
// $this->addSql('ALTER TABLE chill_3party.third_party ADD profession_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_3party.third_party DROP profession');
}
}