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

[$75] NPM steps for creating tables #307

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

[$75] NPM steps for creating tables #307

jmgasper opened this issue Mar 29, 2020 · 6 comments

Comments

@jmgasper
Copy link
Collaborator

@afrisalyp - Let's add this npm options to the package.json. We'll need these to handle DB updates because our dev and prod creds configured for the app cannot do things like create tables, so we'll need to have a separate user run the updates first.

  1. Add a npm run create-tables step that can be run to look for each required table, and, if it doesn't exist, create it. This won't delete or overwrite any existing data, so it can be used non-destructively.
@jmgasper
Copy link
Collaborator Author

[500]: Challenge for the updated issue 307 is creating, rescheduling this event

This is an automated message for ghostar via Topcoder X

@afrisalyp
Copy link
Collaborator

To update DB models we need to:

  • Configure the DynamoDB environment. For local deployment:
export AWS_ACCESS_KEY_ID=FAKE_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY=FAKE_SECRET_ACCESS_KEY
export AWS_REGION=FAKE_REGION
export IS_LOCAL=true
  • Run npm run create-tables on the parent directory of the updated project.

https://drive.google.com/open?id=1Inrk21Jp38bfUVEwspwwaNbUHJG_pFId

@jmgasper jmgasper changed the title [$40] NPM steps for creating tables [$75] NPM steps for creating tables Mar 30, 2020
@jmgasper
Copy link
Collaborator Author

@afrisalyp - This seems to have worked, but we need to make the script a bit more user friendly. Can you add some output so we know when tables are being created, and add an error handler to output errors as well please? We'll need this in the future.

@afrisalyp
Copy link
Collaborator

@jmgasper - Ah okay. I'll make improvements to the script. Thanks for the feedback

@afrisalyp
Copy link
Collaborator

@jmgasper - I've updated the script to make it more informative. It'll be look like this. Do you think that it's acceptable?

Successfully create or update:
Screenshot from 2020-03-30 13-43-39

Access Denied:
Screenshot from 2020-03-30 13-43-30

Network Problem:
Screenshot from 2020-03-30 13-45-02

@jmgasper
Copy link
Collaborator Author

Yep, looks good, thanks!

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