question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding @searchable directive to an existing @model in schema deleted and re-created all existing dynamo db tables

See original GitHub issue

Describe 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:

  1. Add a @ searchable directive to an existing @model
  2. 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:closed
  • Created 5 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jesse-bonzocommented, Dec 28, 2018

@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.

1reaction
mwargercommented, Dec 28, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editing an existing data model - Amazon DynamoDB
In NoSQL Workbench, in the navigation pane on the left side, choose the Data modeler button. Choose the table that you want to...
Read more >
API (GraphQL) - Data modeling - AWS Amplify Docs
Amplify automatically creates Amazon DynamoDB database tables for GraphQL types annotated with the @model directive in your GraphQL schema.
Read more >
Trying to execute a `ddb_to_es.py` file in order to backfill ...
Once the @searchable directive is added, all new records added to the model are streamed to OpenSearch. To backfill existing data, see Backfill ......
Read more >
Create Your First Table by Using the DynamoDB Console
In this first episode, you use the DynamoDB console to create a simple table, add data, scan and query the data, delete data,...
Read more >
aws_dynamodb_table | Resources | hashicorp/aws
DynamoDB Table attributes ... Only define attributes on the table object that are going to be used as: ... The DynamoDB API expects...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found