Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Ensure javascript caches are unique per theme/theme_field (#23126)
We were assuming that this was the case before, but not enforcing it.
- Loading branch information
1 parent
5409283
commit 80a0d88
Showing
2 changed files
with
13 additions
and
2 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
11 changes: 11 additions & 0 deletions
11
db/migrate/20230817174049_ensure_javascript_cache_is_unique_per_theme.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,11 @@ | ||
# frozen_string_literal: true | ||
|
||
class EnsureJavascriptCacheIsUniquePerTheme < ActiveRecord::Migration[7.0] | ||
def change | ||
remove_index :javascript_caches, :theme_id | ||
add_index :javascript_caches, :theme_id, unique: true | ||
|
||
remove_index :javascript_caches, :theme_field_id | ||
add_index :javascript_caches, :theme_field_id, unique: true | ||
end | ||
end |