Skip to content

Commit

Permalink
Only reset and seed meals;
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp-bode committed May 27, 2018
1 parent b31f415 commit 73bf24d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ def get_recipe(name):
@app.route('/api/v1/reset', methods=['GET', 'POST'])
def reset():
db.engine.execute("DELETE FROM meal;")
db.engine.execute("DELETE FROM dish;")
# db.engine.execute("DELETE FROM dish;")
db.engine.execute("ALTER SEQUENCE meal_id_seq RESTART WITH 1")
db.engine.execute("ALTER SEQUENCE dish_id_seq RESTART WITH 1")
# db.engine.execute("ALTER SEQUENCE dish_id_seq RESTART WITH 1")
try:
shutil.rmtree('/tmp/images')
except FileNotFoundError:
Expand Down
12 changes: 6 additions & 6 deletions server/whitelist.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@
}

MEALS_THIS_WEEK = [
"INSERT INTO dish (name, co2) VALUES ('spaghetti', 4.63);",
"INSERT INTO dish (name, co2) VALUES ('schnitzel', 9.26);",
"INSERT INTO dish (name, co2) VALUES ('pancake', 2.41);",
"INSERT INTO dish (name, co2) VALUES ('cereals', 0.8);",
"INSERT INTO dish (name, co2) VALUES ('salad', 1.4);",
"INSERT INTO dish (name, co2) VALUES ('bread', 1.5);",
# "INSERT INTO dish (name, co2) VALUES ('spaghetti', 4.63);",
# "INSERT INTO dish (name, co2) VALUES ('schnitzel', 9.26);",
# "INSERT INTO dish (name, co2) VALUES ('pancake', 2.41);",
# "INSERT INTO dish (name, co2) VALUES ('cereals', 0.8);",
# "INSERT INTO dish (name, co2) VALUES ('salad', 1.4);",
# "INSERT INTO dish (name, co2) VALUES ('bread', 1.5);",

"INSERT INTO meal (created, recipe, picture, label, dish_id) VALUES (to_timestamp('20-05-2018 07:36:38', 'dd-mm-yyyy hh24:mi:ss'), '', '', 'Breakfast', 4);",
"INSERT INTO meal (created, recipe, picture, label, dish_id) VALUES (to_timestamp('21-05-2018 07:36:38', 'dd-mm-yyyy hh24:mi:ss'), '', '', 'Breakfast', 4);",
Expand Down

0 comments on commit 73bf24d

Please sign in to comment.