mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Remove email column from user table
This commit is contained in:
parent
b3fd091379
commit
c705159d22
4 changed files with 24 additions and 7 deletions
|
@ -30,13 +30,13 @@ class ColumnDropper
|
|||
on_drop&.call
|
||||
|
||||
columns.each do |column|
|
||||
ActiveRecord::Base.exec_sql <<~SQL
|
||||
DROP TRIGGER IF EXISTS #{readonly_trigger_name(table, column)} ON #{table};
|
||||
DROP FUNCTION IF EXISTS #{readonly_function_name(table, column)};
|
||||
SQL
|
||||
|
||||
# safe cause it is protected on method entry, can not be passed in params
|
||||
ActiveRecord::Base.exec_sql("ALTER TABLE #{table} DROP COLUMN IF EXISTS #{column}")
|
||||
|
||||
ActiveRecord::Base.exec_sql <<~SQL
|
||||
DROP FUNCTION IF EXISTS #{readonly_function_name(table, column)};
|
||||
DROP TRIGGER IF EXISTS #{readonly_trigger_name(table, column)} ON #{table};
|
||||
SQL
|
||||
end
|
||||
|
||||
Discourse.reset_active_record_cache
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue