-
-
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.
Ref #326: Add shortLabel field for denomination and use it in tag gen…
…eration
- Loading branch information
1 parent
911e0a2
commit d7760b6
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 = 'Assoc.' 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