-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 #16960 from opf/housekeeping/57983-create-a-migrat…
…ion-to-remove-the-custom-design-color-variables-that-we-removed-from-the-list [57983] Create a migration to remove the custom design color variables that we removed from the list
- Loading branch information
Showing
3 changed files
with
21 additions
and
28 deletions.
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
21 changes: 21 additions & 0 deletions
21
db/migrate/20241015081341_remove_obsolete_design_variables.rb
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,21 @@ | ||
class RemoveObsoleteDesignVariables < ActiveRecord::Migration[7.1] | ||
OBSOLETE_COLOR_VARIABLES = %w( main-menu-font-color | ||
main-menu-selected-font-color | ||
main-menu-hover-font-color | ||
main-menu-border-color | ||
header-item-font-color | ||
header-item-font-hover-color | ||
header-border-bottom-color ).freeze | ||
|
||
class MigrationDesignColor < ApplicationRecord | ||
self.table_name = "design_colors" | ||
end | ||
|
||
def up | ||
MigrationDesignColor.where(variable: OBSOLETE_COLOR_VARIABLES).delete_all | ||
end | ||
|
||
def down | ||
# This is not revertible | ||
end | ||
end |
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