amplify-backend
amplify-backend copied to clipboard
feat: add imported tables to data
Problem
Gen 1 -> Gen 2 table migration.
Issue number, if available: N/A
Changes
Add new props:
importedAmplifyDynamoDBTableMap- mapping of model name to table name for imported tables.importedModels- List of model names that should be treated as imported. This gives fault tolerance if theimportedAmplifyDynamoDBTableMapis missing or modified. The deploy will fail if theimportedModelslist does not match models inimportedAmplifyDynamoDBTableMap.
Usage:
const schema = `
type Blog @model {
title: String
content: String
authors: [String]
}
type ImportedModel @model {
description: String
}
`;
const dataFactory = defineData({
schema,
importedAmplifyDynamoDBTableMap: {
ImportedModel: 'ImportedModel-1234-dev',
},
importedModels: ['ImportedModel'],
});
Corresponding docs PR, if applicable: N/A
Validation
- Unit testing
Checklist
- [x] If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
- [x] If this PR requires a change to the Project Architecture README, I have included that update in this PR.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
🦋 Changeset detected
Latest commit: 21be576c49b7aa4f358e5840e5ccd9e1ca19d17d
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @aws-amplify/backend-data | Minor |
| @aws-amplify/backend | Minor |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR