mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Make BIGINT values more readable in tests env (#29189)
This commit is contained in:
committed by
GitHub
parent
61f2786614
commit
448fae6ea5
@@ -488,9 +488,12 @@ RSpec.configure do |config|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Sets sequence's value to be greater than the max value that an INT column can hold. This is done to prevent
|
||||||
|
# type mistmatches for foreign keys that references a column of type BIGINT. We set the value to 10_000_000_000
|
||||||
|
# instead of 2**31-1 so that the values are easier to read.
|
||||||
DB
|
DB
|
||||||
.query("SELECT sequence_name FROM information_schema.sequences WHERE data_type = 'bigint'")
|
.query("SELECT sequence_name FROM information_schema.sequences WHERE data_type = 'bigint'")
|
||||||
.each { |row| DB.exec "SELECT setval('#{row.sequence_name}', #{2**32})" }
|
.each { |row| DB.exec "SELECT setval('#{row.sequence_name}', '10000000000')" }
|
||||||
|
|
||||||
# Prevents 500 errors for site setting URLs pointing to test.localhost in system specs.
|
# Prevents 500 errors for site setting URLs pointing to test.localhost in system specs.
|
||||||
SiteIconManager.clear_cache!
|
SiteIconManager.clear_cache!
|
||||||
|
|||||||
Reference in New Issue
Block a user