FIX: Ensure javascript caches are unique per theme/theme_field (#23126)
We were assuming that this was the case before, but not enforcing it.
This commit is contained in:
parent
54092833b9
commit
80a0d88e4c
|
@ -46,8 +46,8 @@ end
|
|||
# Indexes
|
||||
#
|
||||
# index_javascript_caches_on_digest (digest)
|
||||
# index_javascript_caches_on_theme_field_id (theme_field_id)
|
||||
# index_javascript_caches_on_theme_id (theme_id)
|
||||
# index_javascript_caches_on_theme_field_id (theme_field_id) UNIQUE
|
||||
# index_javascript_caches_on_theme_id (theme_id) UNIQUE
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue