mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
Remove email column from user table
This commit is contained in:
@ -72,6 +72,23 @@ RSpec.describe ColumnDropper do
|
||||
SQL
|
||||
end
|
||||
|
||||
it 'should be droppable' do
|
||||
name = Topic
|
||||
.exec_sql("SELECT name FROM schema_migration_details LIMIT 1")
|
||||
.getvalue(0, 0)
|
||||
|
||||
dropped_proc_called = false
|
||||
ColumnDropper.drop(
|
||||
table: table_name,
|
||||
after_migration: name,
|
||||
columns: ['email'],
|
||||
delay: 0.minutes,
|
||||
on_drop: ->() { dropped_proc_called = true }
|
||||
)
|
||||
|
||||
expect(dropped_proc_called).to eq(true)
|
||||
|
||||
end
|
||||
it 'should prevent updates to the readonly column' do
|
||||
expect do
|
||||
ActiveRecord::Base.connection.raw_connection.exec <<~SQL
|
||||
|
Reference in New Issue
Block a user