File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -21,20 +21,24 @@ public function up(Schema $schema): void
21
21
{
22
22
// this up() migration is auto-generated, please modify it to your needs
23
23
$ this ->addSql (<<<SQL
24
- ALTER TABLE team_category
24
+ ALTER TABLE team_category
25
25
ADD types INT NOT NULL DEFAULT 1 COMMENT 'Bitmask of category types, default is scoring.' AFTER name,
26
26
CHANGE sortorder sortorder TINYINT UNSIGNED DEFAULT NULL COMMENT 'Where to sort this category on the scoreboard',
27
27
ADD css_class VARCHAR(255) DEFAULT NULL COMMENT 'CSS class to apply to scoreboard rows (only for TYPE_CSS_CLASS)' AFTER allow_self_registration
28
28
SQL );
29
+
30
+ // Now update the types for existing categories based on whether the color is set
31
+ $ this ->addSql ('UPDATE team_category SET types = 7 WHERE color IS NOT NULL ' );
32
+ $ this ->addSql ('UPDATE team_category SET types = 5 WHERE color IS NULL ' );
29
33
}
30
34
31
35
public function down (Schema $ schema ): void
32
36
{
33
37
// this down() migration is auto-generated, please modify it to your needs
34
38
$ this ->addSql (<<<SQL
35
- ALTER TABLE team_category
36
- DROP types,
37
- DROP css_class,
39
+ ALTER TABLE team_category
40
+ DROP types,
41
+ DROP css_class,
38
42
CHANGE sortorder sortorder TINYINT UNSIGNED DEFAULT 0 NOT NULL COMMENT 'Where to sort this category on the scoreboard'
39
43
SQL );
40
44
}
You can’t perform that action at this time.
0 commit comments