mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 02:04:53 +08:00
DEV: Correctly tag heredocs (#16061)
This allows text editors to use correct syntax coloring for the heredoc sections. Heredoc tag names we use: languages: SQL, JS, RUBY, LUA, HTML, CSS, SCSS, SH, HBS, XML, YAML/YML, MF, ICS other: MD, TEXT/TXT, RAW, EMAIL
This commit is contained in:
@ -121,7 +121,7 @@ class Migration::SafeMigrate
|
||||
|
||||
def self.protect!(sql)
|
||||
if sql =~ /^\s*(?:drop\s+table|alter\s+table.*rename\s+to)\s+/i
|
||||
$stdout.puts("", <<~STR)
|
||||
$stdout.puts("", <<~TEXT)
|
||||
WARNING
|
||||
-------------------------------------------------------------------------------------
|
||||
An attempt was made to drop or rename a table in a migration
|
||||
@ -131,10 +131,10 @@ class Migration::SafeMigrate
|
||||
|
||||
This protection is in place to protect us against dropping tables that are currently
|
||||
in use by live applications.
|
||||
STR
|
||||
TEXT
|
||||
raise Discourse::InvalidMigration, "Attempt was made to drop a table"
|
||||
elsif sql =~ /^\s*alter\s+table.*(?:rename|drop)\s+/i
|
||||
$stdout.puts("", <<~STR)
|
||||
$stdout.puts("", <<~TEXT)
|
||||
WARNING
|
||||
-------------------------------------------------------------------------------------
|
||||
An attempt was made to drop or rename a column in a migration
|
||||
@ -148,7 +148,7 @@ class Migration::SafeMigrate
|
||||
|
||||
This protection is in place to protect us against dropping columns that are currently
|
||||
in use by live applications.
|
||||
STR
|
||||
TEXT
|
||||
raise Discourse::InvalidMigration, "Attempt was made to rename or delete column"
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user