Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$60] Migration plan for new and updates tables #300

Closed
jmgasper opened this issue Mar 26, 2020 · 6 comments
Closed

[$60] Migration plan for new and updates tables #300

jmgasper opened this issue Mar 26, 2020 · 6 comments

Comments

@jmgasper
Copy link
Collaborator

@afrisalyp - As you mentioned, we added new columns to a couple tables, and new tables entirely, to support new features. This is fine for starting from scratch, but we have to support existing data that's already in the app.

Can you offer a migration plan or script that we can use to create the new columns and tables please? I have access to Dynamo in dev, so we can test it there first.

@jmgasper
Copy link
Collaborator Author

Contest https://www.topcoder.com/challenges/30120923 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

Contest https://www.topcoder.com/challenges/30120923 has been updated - it has been assigned to afrisalyp.

This is an automated message for ghostar via Topcoder X

@afrisalyp
Copy link
Collaborator

@jmgasper

New columns and new tables will be updated automatically at the first runtime. The only thing that needs to be handled is the new indexes on the existing tables.

https://github.com/topcoder-platform/topcoder-x-ui/blob/0c9e743549739189e06548c470db2c370ff46549/src/models/OwnerUserGroup.js#L60

https://github.com/topcoder-platform/topcoder-x-ui/blob/0c9e743549739189e06548c470db2c370ff46549/src/models/OwnerUserTeam.js#L71

To update the indexes. We can simply put option update: true on the model creation. It will automatically update the tables. https://dynamoosejs.com/api/config/.

But, in my opinion, I'm concerned about the new index AccessLevelIndex. I don't think that it's necessary since there are no queries based on the accessLevel column.

Please let me know your thoughts on this.

@jmgasper
Copy link
Collaborator Author

@afrisalyp - Thanks. I'm fine if we remove the AccessLevelIndex

@jmgasper
Copy link
Collaborator Author

Looks like the issue I'm seeing is a problem in the dev environment with the current rights for the configured AWS account:

AccessDeniedException: User: arn:aws:sts::811668436784:assumed-role/topcoder-x-role/824c6eff-7f09-4cac-87af-1446da74cffe is not authorized to perform: dynamodb:DescribeTable on resource: arn:aws:dynamodb:us-east-1:811668436784:table/Topcoder_X.UserTeamMapping

@jmgasper
Copy link
Collaborator Author

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30120923

This is an automated message for ghostar via Topcoder X

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants