Goal
I am trying to recover data from my canais
table that was lost after an incorrect migration. The expected behavior is to restore the table to its previous state of before the schema migration, including all the dropped columns and their data.
Steps
I executed the following migration on the canais
table approximately 16 hours ago:
ALTER TABLE canais
ALTER COLUMN nome_canal DROP NOT NULL,
DROP COLUMN logo,
DROP COLUMN img_estaiada,
DROP COLUMN owner,
DROP COLUMN cnpj,
DROP COLUMN tipo_parceiro,
DROP COLUMN razao_social,
DROP COLUMN partner_id,
ADD COLUMN fator numeric NOT NULL DEFAULT '1'::numeric;
After this migration, the columns mentioned above were dropped, and I realized that I lost critical data associated with these columns.
What I’ve done so far:
- Checked database backups for possible recovery options but have limited success in retrieving the data.
- Consulted the Retool Documentation for rollback options or ways to restore data.
- Attempted to manually reverse the migration but dind't find the option.
Details
The migration affected several critical columns (logo
, img_estaiada
, owner
, cnpj
, tipo_parceiro
, razao_social
, and partner_id
), which are essential for my app's functionality. I need guidance on whether:
- Retool or my database has any inherent rollback mechanism for such cases.
- There are tools or best practices for recovering the data that was lost.
- Retool logs or app metadata could help in retrieving the data.
Screenshots
Here’s a screenshot of the current state of the canais
table and the migration code that caused the issue:
