File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
src/CoreBundle/Migrations/Schema/V200 Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /* For licensing terms, see /license.txt */
4+
5+ declare (strict_types=1 );
6+
7+ namespace Chamilo \CoreBundle \Migrations \Schema \V200 ;
8+
9+ use Chamilo \CoreBundle \Entity \ExtraField ;
10+ use Chamilo \CoreBundle \Migrations \AbstractMigrationChamilo ;
11+ use Doctrine \DBAL \Schema \Schema ;
12+
13+ final class Version20250724115010 extends AbstractMigrationChamilo
14+ {
15+ public function getDescription (): string
16+ {
17+ return 'Remove show_conditions_to_user setting and gdpr + my_terms extra_fields ' ;
18+ }
19+
20+ public function up (Schema $ schema ): void
21+ {
22+ $ this ->addSql ("DELETE FROM settings WHERE variable = 'show_conditions_to_user' " );
23+
24+ $ userType = ExtraField::USER_FIELD_TYPE ;
25+ $ this ->addSql ("
26+ DELETE FROM extra_field_values
27+ WHERE field_id IN (
28+ SELECT id FROM extra_field
29+ WHERE item_type = $ userType
30+ AND variable IN ('gdpr','my_terms')
31+ )
32+ " );
33+
34+ $ this ->addSql ("
35+ DELETE FROM extra_field
36+ WHERE item_type = $ userType
37+ AND variable IN ('gdpr','my_terms')
38+ " );
39+ }
40+
41+ public function down (Schema $ schema ): void {}
42+ }
You can’t perform that action at this time.
0 commit comments