mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:23:25 +08:00
FIX: Correct email_tokens_token_to_nullable migration (#15277)
We were checking for the existence of the column in any schema, including the `backup` schema. This can cause 'column does not exist' errors. In fact, we should only be checking in the `public` schema.
This commit is contained in:
parent
1773d9d594
commit
7d72041fff
|
@ -11,7 +11,9 @@ class EmailTokensTokenToNullable < ActiveRecord::Migration[6.1]
|
|||
Migration::SafeMigrate.disable!
|
||||
if DB.query_single(<<~SQL).length > 0
|
||||
SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'email_tokens' AND column_name = 'token'
|
||||
WHERE table_schema='public'
|
||||
AND table_name = 'email_tokens'
|
||||
AND column_name = 'token'
|
||||
SQL
|
||||
execute <<~SQL
|
||||
ALTER TABLE email_tokens ALTER COLUMN token DROP NOT NULL
|
||||
|
|
Loading…
Reference in New Issue
Block a user