Basically, what I think has happened is some kind of data corruption. I'm not sure how else the database could be in this state. Our migration software believes it has created this table and is on a later script. postgres stores tables in seperate files, so I believe it's possible that the migration table wasn't affected but the shared_links table has been deleted in the underlying storage