-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #327 from LUCILE-DECROZANT-TRIQUENAUX-EIRL/hotfix-…
…326-short-denomination Hotfix 326 short denomination
- Loading branch information
Showing
3 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?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 Version20240204132311 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Add short label for denomination'; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
// Add short_label field | ||
$this->addSql('ALTER TABLE denomination ADD short_label VARCHAR(255) DEFAULT NULL'); | ||
|
||
// Update existing denominations | ||
$this->addSql("UPDATE denomination SET short_label = 'M.' WHERE label = 'Monsieur'"); | ||
$this->addSql("UPDATE denomination SET short_label = 'Mme' WHERE label = 'Madame'"); | ||
$this->addSql("UPDATE denomination SET short_label = 'Mx' WHERE label = 'Mix'"); | ||
$this->addSql("UPDATE denomination SET short_label = 'Dr' WHERE label = 'Docteur'"); | ||
$this->addSql("UPDATE denomination SET short_label = 'Me' WHERE label = 'Maître'"); | ||
$this->addSql("UPDATE denomination SET short_label = 'Sté' WHERE label = 'Société'"); | ||
$this->addSql("UPDATE denomination SET short_label = 'Asso' WHERE label = 'Association'"); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// Remove short_label field | ||
$this->addSql('ALTER TABLE denomination DROP short_label'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters