Database Migration Error


I recently had an issue with my postgres server and had to restore the Gitlab database from a backup, but now if I check the database migrations that have not yet been run (gitlab-rake db:migrate:status), I have the following:
root@f40ca9ca48de:/# gitlab-rake db:migrate:status | grep " down "
down 20201112215132 Swap partitioned audit events
down 20210301200601 Rename asset proxy allowlist on application settings
down 20210301200959 Clean up asset proxy allowlist rename on application settings

but if I actually try to run the migrations, 20201112215132 fails due to this error:

PG::UndefinedColumn: ERROR: column “[“id”, “created_at”]” of relation “audit_events” does not exist

I’m fairly certain this is due to the migration having already been run. I’m not too sure why it is being shown as “down”.

The audit_events table definetly has both the id and created_at columns:

gitlabhq_production=# SELECT id,created_at FROM audit_events LIMIT 1;
 id |         created_at         
  1 | 2018-05-30 13:10:00.330201
(1 row)

Is there a way to resolve this? I have put the full log of the migration here: root@f40ca9ca48de:/# gitlab-rake db:migrate== 20201112215132 SwapPartitionedAu -