mirror of
https://github.com/discourse/discourse.git
synced 2025-04-14 10:22:56 +08:00
FIX: Create PostgreSQL extensions before migrating (#16158)
Enabled extensions are not saved in backups and thus not created when restoring a newer backup (that has a new extension) to an old site (that does not have the migration).
This commit is contained in:
parent
9b420eb6e3
commit
631bfb2a23
@ -215,6 +215,8 @@ task 'db:migrate' => ['load_config', 'environment', 'set_locale'] do |_, args|
|
||||
raise "Migration #{migrations.last.version} is timestamped in the future" if migrations.last.version > now_timestamp
|
||||
raise "Migration #{migrations.first.version} is timestamped before the epoch" if migrations.first.version < epoch_timestamp
|
||||
|
||||
%i[pg_trgm unaccent].each { |extension| DB.exec "CREATE EXTENSION IF NOT EXISTS #{extension}" }
|
||||
|
||||
ActiveRecord::Tasks::DatabaseTasks.migrate
|
||||
|
||||
if !Discourse.is_parallel_test?
|
||||
|
Loading…
x
Reference in New Issue
Block a user