Having the weirdest error with a new postgres db made by a rails app.
I created a new table (images) with a reference field (game_id).
create_table :images do |t|
t.string :title
t.references :game
t.string :file
t.integer :image_type, default: 0
t.timestamps
end
I inserted over 6000 images in my table, with working reference to the games table. After working for a few months, the table now lost that game_id column. It's completely gone. Did not run any migration, development database works fine, it still has that column. I checked logs since i started the app (it has all the migrations), there is no trace of a drop column call anywhere. Also nothing in the postgres history. Logs show proper inserts
INSERT INTO "images" ("game_id", "file", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id"ESC[0m [["game_id", 4], ["file", "r6hhvtaozowkcf06bswz.jpg"], ["created_at", "2019-03-05 14:40:33.612203"], ["updated_at", "2019-03-05 14:40:33.612203"]]
Now i only have the errors
column images.game_id does not exist
I'm upset that i lost all that data, does anyone know of a reason why the column got dropped? And would it be possible to get the data back or should i just start from scratch? I also didn't upgrade the server, didn't even touch the