DEV: Fix bigint notifications id migration to deal with public schema (#28538)
Follow up to 799a45a291
This commit is contained in:
parent
799a45a291
commit
6832c7b7e7
|
@ -15,7 +15,7 @@ class CopyNotificationsIdIndexes < ActiveRecord::Migration[7.0]
|
||||||
# Copy existing indexes and suffix them with `_bigint`
|
# Copy existing indexes and suffix them with `_bigint`
|
||||||
results =
|
results =
|
||||||
execute(
|
execute(
|
||||||
"SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'notifications' AND indexdef SIMILAR TO '%\\mid\\M%'",
|
"SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'notifications' AND indexdef SIMILAR TO '%\\mid\\M%' AND schemaname = 'public'",
|
||||||
)
|
)
|
||||||
results.each do |res|
|
results.each do |res|
|
||||||
indexname, indexdef = res["indexname"], res["indexdef"]
|
indexname, indexdef = res["indexname"], res["indexdef"]
|
||||||
|
|
|
@ -17,7 +17,7 @@ class DropOldNotificationIdIndexes < ActiveRecord::Migration[7.0]
|
||||||
# Remove `_bigint` suffix from indexes
|
# Remove `_bigint` suffix from indexes
|
||||||
results =
|
results =
|
||||||
execute(
|
execute(
|
||||||
"SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'notifications' AND indexdef SIMILAR TO '%\\mid\\M%'",
|
"SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'notifications' AND indexdef SIMILAR TO '%\\mid\\M%' AND schemaname = 'public'",
|
||||||
)
|
)
|
||||||
results.each do |res|
|
results.each do |res|
|
||||||
indexname, indexdef = res["indexname"], res["indexdef"]
|
indexname, indexdef = res["indexname"], res["indexdef"]
|
||||||
|
|
Loading…
Reference in New Issue