Relation "discourse_automation_automations" restoring from 3.3beta1 to 3.5beta7

So I removed these:

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

and probably should have removed 20190601000001_create_automations_table.rb, but instead I added unless table exists code (I think when I deleted it I had another problem?).

And I finally got it to restore.

And when I rebuild, I get the same errors when the database tries to migrate.

So somehow I guess I need to convince rails that these migrations have, uh, run already. So then I tried this:

INSERT INTO schema_migrations(version) VALUES
('20190601000001'),
('20210108134117'),
('20210512090204'),
('20210530122323'),
('20211119103353'),
('20230412120414');

And that didn’t work either.

I think maybe it’s just those ones frrom 2021 I need to skip? Or maybe 202105?

But the version that’s running is from January 2024.

I was able to restore the first database (before I’d mucked with the schema_migrations) on the old server, so at least I’m back where I started. I guess I need to know how to look at the commits and migrations in some ways that I don’t.

1 Like