Skip to content

Removed elements from data schema do not get removed from amplify_outputs.json after redeployment #4058

Description

@nomnom-yummie

Environment information

-

Describe the bug

I'm facing this issue over and over again.

I remove something from the schema and adopt the code accordingly, commit and push, redownload the amplify_outputs,json after redeployment and the all api operations fail because of failed schema validations for elements that have been removed from the schema, but are still in the amplify_outputs.json.

This does not seem to appear if I add new elements to the schema, but mostly when removing elements from it. And maybe it is related to the fact, that I was changing elements in regard to the partition key.

For example I had a custom part key "customKey: a.id().required()" and ".identifier(["customKey])" and when I removed it, the schema should default back to using "id" which gets automatically populated server-side. But instead the ouputs json just keeps the old schema, even after several redeployments. So the schema definition in the outputs is not the same as in the resource.ts, including the partition key definition.

But the same goes, if I remove a whole model from the schema. It just stays in the amplify_outputs.json, though the corresponding table gets deleted during deployment.

I can actually confirm now, that the amplify_outputs.json, does currently not change at all after redeployment. I added a test property to the model, which does not get adopted into the json. I don't know why, but whenever I try to download the json, it's just the same unchanged json from several deployments ago. Not a single of the many changes to the schema was adopted to it. And I don't understand why this is happening.

Reproduction steps

Metadata

Metadata

Assignees

No one assigned

    Labels

    consoleThe issue is related to performing an action in the Amplify consolepending-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions