File tree Expand file tree Collapse file tree
migrations/DoctrineMigrations
src/OpenConext/EngineBlockBundle/Authentication/Entity Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525/**
2626 * Change to the consent schema
2727 * 1. Added the `attribute_stable` column, string(80), nullable
28- * 2. Changed the `attribute` column, has been made nullable
2928 */
3029final class Version20260315000001 extends AbstractEngineBlockMigration
3130{
3231 public function getDescription (): string
3332 {
34- return 'Add attribute_stable column to consent table and make attribute nullable ' ;
33+ return 'Add attribute_stable column to consent table ' ;
3534 }
3635
3736 public function preUp (Schema $ schema ): void
@@ -41,14 +40,11 @@ public function preUp(Schema $schema): void
4140
4241 public function up (Schema $ schema ): void
4342 {
44- $ this ->addSql ('ALTER TABLE consent ADD attribute_stable VARCHAR(80) DEFAULT NULL, CHANGE attribute attribute VARCHAR(80) DEFAULT NULL ' );
43+ $ this ->addSql ('ALTER TABLE consent ADD attribute_stable VARCHAR(80) DEFAULT NULL ' );
4544 }
4645
4746 public function down (Schema $ schema ): void
4847 {
49- $ this ->warnIf (true , 'This migration is not reversible without deleting all migrated consent hashes. ' .
50- ' Manually run `DELETE FROM consent WHERE attribute IS NOT NULL` to delete all migrated consent hashes. ' );
51- $ this ->addSql ('ALTER TABLE consent CHANGE attribute attribute VARCHAR(80) NOT NULL ' );
5248 $ this ->addSql ('ALTER TABLE consent DROP attribute_stable ' );
5349 }
5450}
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class Consent
5656 /**
5757 * @var string
5858 */
59- #[ORM \Column(type: Types::STRING , length: 80 , nullable: true )]
59+ #[ORM \Column(type: Types::STRING , length: 80 , nullable: false )]
6060 public ?string $ attribute = null ;
6161
6262 /**
You can’t perform that action at this time.
0 commit comments