mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Create BaseDropper functions in a different schema.
https://meta.discourse.org/t/error-when-restore-db-backup/93145/25?u=tgxworld
This commit is contained in:
@@ -152,19 +152,23 @@ RSpec.describe Migration::ColumnDropper do
|
||||
)
|
||||
|
||||
expect(dropped_proc_called).to eq(true)
|
||||
|
||||
end
|
||||
|
||||
it 'should prevent updates to the readonly column' do
|
||||
expect do
|
||||
begin
|
||||
DB.exec <<~SQL
|
||||
UPDATE #{table_name}
|
||||
SET email = 'testing@email.com'
|
||||
WHERE topic_id = 1;
|
||||
SQL
|
||||
end.to raise_error(
|
||||
PG::RaiseException,
|
||||
/Discourse: email in #{table_name} is readonly/
|
||||
)
|
||||
rescue PG::RaiseException => e
|
||||
[
|
||||
"Discourse: email in #{table_name} is readonly",
|
||||
'discourse_functions.raise_table_with_readonly_column_email_readonly()'
|
||||
].each do |message|
|
||||
expect(e.message).to include(message)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'should allow updates to the other columns' do
|
||||
|
||||
Reference in New Issue
Block a user