mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
Remove email column from user table
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user