Adding @searchable directive to an existing @model in schema deleted and re-created all existing dynamo db tables
See original GitHub issueDescribe the bug Adding @ searchable directive to an existing @ model in schema deleted and re-created all existing dynamo db tables.
This is disconcerting - I worry about people running this in an environment and losing data. I’m running this is in a low-level testing environment so it’s not that big deal right now.
To Reproduce Steps to reproduce the behavior:
- Add a @ searchable directive to an existing @model
- run amplify push
Expected behavior The resolvers for the specified @ model should be updated to work with an elasticsearch instance
Add any other context about the problem here.
Another interesting thing is that the first time these tables were created, the environment I’m using was appended to the end of the resources. Example (with environment “deva”): Old table: User-asdflweriuwroiuf-deva New (deleted and re-created table): User-weroiusdflkjasdff
Edit: Seems related to https://github.com/aws-amplify/amplify-cli/issues/566#issuecomment-450043788
~ $ amplify -v 0.2.1-multienv.14
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (9 by maintainers)

 Top Related Medium Post
Top Related Medium Post Top Related StackOverflow Question
Top Related StackOverflow Question
@mwarger I actually did try older versions as well, no luck there. I tried .16, .15, .14, .13, .12, .11, and .4. For me the tables are dropped because they’re names go from
<table_name>_<api_id>_<env_name>to<table_name>_<api_id>, so they are technically new tables.I tried creating a new project and schema with Todos like you did. I wasn’t able to reproduce this issue. One thing to note: the environment name was not appended to my dynamodb table that was created to hold the Todos.