mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Allow DROP NOT NULL in pre-deploy migrations (#20775)
Our SafeMigrate system is designed to prevent tables/columns being dropped in pre-deploy migrations. Its regex-based detection was triggering incorrectly on `ALTER COLUMN DROP NOT NULL`.
This commit is contained in:
@@ -129,7 +129,7 @@ class Migration::SafeMigrate
|
||||
in use by live applications.
|
||||
TEXT
|
||||
raise Discourse::InvalidMigration, "Attempt was made to drop a table"
|
||||
elsif sql =~ /\A\s*alter\s+table.*(?:rename|drop)\s+/i
|
||||
elsif sql =~ /\A\s*alter\s+table.*(?:rename|drop(?!\s+not\s+null))\s+/i
|
||||
$stdout.puts("", <<~TEXT)
|
||||
WARNING
|
||||
-------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user