Relation "discourse_automation_automations" שחזור מ- 3.3beta1 ל- 3.5beta7

Trying to restore a database from

    <meta name="generator" content="Discourse 3.3.0.beta1-dev - https://github.com/discourse/discourse version a4022f69f31af611bc0e21258b0ccb77dec38ba3">

to current. I copied the same app.yml and am restoring (new VM and trying to sidestep the pg upgrade, though maybe I should try that instead of the restore)

I’m getting this error:

PG::DuplicateTable: ERROR:  relation "discourse_automation_automations" already exists

Seems like another case of some migration getting checked back in and this site got built during those few commits.

I don’t know what to do, though. Maybe I delete the migration that tries creating this table?

Old database is on 20240122015630 and new is 20250617085536.

I see this in the new source:

db/migrate/20190601000001_create_automations_table.rb:    create_table :discourse_automation_automations do |t|

But somehow this migration doesn’t know not to do that one? That table has the same fields on both. Maybe I just delete that migrations from 2019?

אני חושב ש-3.3beta1 היה לפני שהתוסף שולב בליבה באפריל. האם זה יכול לגרום לבעיות כלשהן — לדוגמה, בגלל שהתוסף משולב כעת בליבה בעודו עדיין מותקן בנפרד דרך app.yml?

זה רעיון טוב, אבל זה לא זה. אני לא כולל את זה שוב. אני תוהה אם אולי הייתי צריך לנסות להוסיף את זה (אבל אני לא רואה את זה במבט מהיר). הרעיון הנוכחי שלי הוא להסיר את כל טבלאות האוטומציות (הן ריקות) באתר הישן, ליצור גיבוי חדש ולנסות לשחזר אותו.

לייק 1

Well, and then it failed because discourse_automations_automations was missing. :person_shrugging:

אז הסרתי את אלה:

20210108134117_add_pending_pms_table.rb
20210512090204_add_timestamps_to_automations.rb
20210530122323_move_triggers_to_fields.rb
20211119103353_adds_discourse_automation_user_global_notice.rb
20230412120414_add_prefers_encrypt_field_to_pending_pms.rb

וכנראה שהייתי צריך להסיר 20190601000001_create_automations_table.rb, אבל במקום זאת הוספתי קוד ‘unless table exists’ (אני חושב שכשהסרתי את זה הייתה לי בעיה אחרת?).

ולבסוף הצלחתי לשחזר את זה.

לייק 1

האם נוכל לסגור את הנושא הזה? או להעביר אותו ל-Dev או Installation > Hosting אם תרצו להשאיר אותו פתוח?

כן. אפשר לסגור את זה. לא ברור לי אם זה יקרה אי פעם למישהו אחר, כך שזה עשוי להיות שימושי או לא.