New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data loss with new relationship approach #2478
Comments
I think this is not related to the reference change but the GSI update in DayPlanTodo.
In the sandbox mode, when the GSI update is detected, the table will be deleted and recreated instead of the normal GSI update, which will wipe the existing data. This is the behavior in effect for SANDBOX ONLY to accelerate the GSI update time. |
Interesting. I will test it in my staging environment and let you know |
Facing this problem as well, is there a clear migration guide on how we can move from the old resource definition format to the new one while keep tables and access ids consistent? I'm not seeing any documentation on this. |
I tested in my staging environment and indeed I didn't face data loss there. However, for the new schema definition expectation I had to be very careful to ensure I have the exact same table names and field names to ensure I do not loose data. In addition, the new schema definition creates new secondary indexes and deletes the existing ones which is very time consuming and Amplify pipeline-deploy as well as the step functions run into timeout issues as described here: #2488 |
AFAIK, in Gen2 the table will only be replaced if the key schema for the table is changed (GSIs updates are exempted). The table names are not able to be modified in the any customer facing APIs of Gen2 because of the table replacement resulting from the rename. Neither will the table name is generated differently between sandbox and branch deployment environment |
Issue isn't really data loss via table replacement, it is more naming relationship ids. In prior versions, this was automatically done. Ex. Original
New:
So now I have to manually check the table for each model definition to identify the exact id used and define it. |
Environment information
Description
The new relationship approach caused data loss for me.
Before the upgrade to
@aws-amplify/backend@0.13.0-beta.20
this has been my data model:As I have to provide
references
now, I changed the model to this:Unfortunately, all records in DayPlanTodo have been deleted as a consequence. Lukily, I only did it in my sandbox environment.
The text was updated successfully, but these errors were encountered: