Skip to content

Commit

Permalink
New script to refresh the local DynamoDB database from the cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
brystmar committed Oct 28, 2019
1 parent 64733bb commit fd0bd01
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 288 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Why breadsheet?
Suppose you're invited to a picnic on Saturday afternoon. Captivated by your exemplary breadmaking skills over the years, the group asks you to bake a fresh loaf of sourdough.
Suppose you're invited to a picnic on Saturday afternoon. Captivated by your exemplary breadmaking skills over the years, the group asks you to bake a fresh loaf of sourdough.

There are many time-sensitive steps in this process with a fair bit of downtime throughout. You may need to start as early as Thursday(!) depending how your [levain](https://en.wikipedia.org/wiki/Sourdough#Starter) is stored.
Although you love sourdough, you're also aware it can be challenging to properly schedule. There are many time-sensitive steps in this process with a fair bit of downtime throughout. You may need to start as early as Thursday(!) depending how your [levain](https://en.wikipedia.org/wiki/Sourdough#Starter) is stored.

But wait, this is `${DateJoke.getFullYear()}`, and you've got a busy schedule. Use [breadsheet](http://breadsheet.com) to calculate the start & finish times for each step and the overall recipe.
But wait, this is `${DateJoke.getFullYear()}`! There _must_ be a better way!

Save your brainwaves for the important things in life. Leave the scheduling to [breadsheet](http://breadsheet.com).
Enter [breadsheet](http://breadsheet.com): a tool that calculates the start & finish times for any recipe -- and each step along the way. Focus on the bread, and leave the scheduling to [breadsheet](http://breadsheet.com).


# App Structure
Expand All @@ -15,4 +15,4 @@ Save your brainwaves for the important things in life. Leave the scheduling to

**Frontend (soon!):** React

See the (wiki)[]
Full documentation on the [wiki](https://github.com/brystmar/breadsheet/wiki/Backend-API-Documentation).
150 changes: 0 additions & 150 deletions data/db_migration/build_dynamodb_tables.py

This file was deleted.

35 changes: 0 additions & 35 deletions data/db_migration/cloud_db_to_local.py

This file was deleted.

90 changes: 0 additions & 90 deletions data/db_migration/pg_to_nosql.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
db_local = boto3.resource('dynamodb', region_name=Config.aws_region, aws_access_key_id=Config.aws_access_key,
aws_secret_access_key=Config.aws_secret_access_key, endpoint_url='http://localhost:8008')

table = db_local.create_table(
db_local.Table('Recipe').delete()

recipe_table = db_local.create_table(
TableName='Recipe',
KeySchema=[
{
Expand All @@ -31,11 +33,13 @@
)

# Wait until the table exists
table.meta.client.get_waiter('table_exists').wait(TableName='Recipe')
recipe_table.meta.client.get_waiter('table_exists').wait(TableName='Recipe')

print("Recipe table", recipe_table)

print("Recipe table", table)
db_local.Table('Replacement').delete()

table2 = db_local.create_table(
replacement_table = db_local.create_table(
TableName='Replacement',
KeySchema=[
{
Expand Down Expand Up @@ -70,6 +74,6 @@
)

# Wait until the table exists
table2.meta.client.get_waiter('table_exists').wait(TableName='Replacement')
replacement_table.meta.client.get_waiter('table_exists').wait(TableName='Replacement')

print("Replacement table", table2)
print("Replacement table", replacement_table)
Loading

0 comments on commit fd0bd01

Please sign in to comment.