gerhard
(Gerhard Schlager)
22 أكتوبر 2024، 10:25ص
29
أرى المشكلة. الالتزام 82e75c8 أنشأ دوال في مخطط discourse_functions والالتزام 8016fca أسقط الدوال. عندما تحاول استعادة نسخة احتياطية تم إنشاؤها بين هذين الالتزامين على إصدار بعد 8016fca، تفشل الاستعادة.
تحتوي وظيفة الاستعادة على حل بديل لمثل هذه المشكلات، لكنها لم تعمل مع discourse_functions التي تم إنشاؤها من داخل الإضافات. إليك طلب سحب سيؤدي إلى إصلاح ذلك:
main ← fix_restore_discourse_functions
opened 10:25AM - 22 Oct 24 UTC
Database dumps sometimes reference functions in the `discourse_functions` schema… . It's possible that some of these functions have been dropped in a newer version of Discourse. In that case, restoring an older backup will fail with a `ERROR: function discourse_functions.something_something() does not exist` error. The restore functionality contains a workaround for that problem, but it didn't work with functions created in plugin migrations.
This commit adds support for temporarily creating missing `discourse_functions` from plugins. And it adds a simple check if the DB migration file even contains the required `DROPPED_TABLES` or `DROPPED_COLUMNS` constant. We don't need to create an instance of the DB migration class unless one of those constants is used. This makes the restore slightly faster and works around a problem with migrations that execute without `up` or `down` methods (e.g. `BackfillChatChannelAndThreadLastMessageIdsPostMigrate`).
إعجابَين (2)