Remove seeds for legacy tables

This commit is contained in:
Midgard 2019-12-01 21:05:19 +01:00
parent ca199f4a3b
commit 0d7b43705b
Signed by: midgard
GPG key ID: 511C112F1331BBB4
7 changed files with 2 additions and 441 deletions

View file

@ -1,38 +0,0 @@
"Script to add Fitchen to Haldis"
from app import db
from models import Location, Product
menuitems = [
"Spicy Chicken",
"Advocado Chick",
"Indian Summer",
"Olive Garden",
"Advocado Spring",
"Spicy Mexican",
"Beefcake",
"Iron Man",
"Fitalian",
"Captain",
"Sea Breeze",
"Vegan Market",
"Sunset Beach",
"Hot Tofu",
"Vegan Advocado Spring",
]
pricedict = {"Small": 799, "Medium": 999, "Large": 1199}
def add() -> None:
"Add Fitchen to the database"
fitchen = Location()
fitchen.configure("Fitchen", "?", "?", "https://www.fitchen.be/")
db.session.add(fitchen)
for menuitem in menuitems:
for size, price in pricedict.items():
for container in ["bowl", "wrap"]:
name = "%s %s in %s" % (size, menuitem, container)
entry = Product()
entry.configure(fitchen, name, price)
db.session.add(entry)

View file

@ -1,56 +0,0 @@
"Script to add Ocean Garden to Haldis"
from itertools import product
from app import db
from models import Location, Product
zetmelen = ["Nasi", "Bami"]
vlezen = ["Rundsvlees", "Varkensvlees", "Kippenstukkjes"]
sauzen = [
"Balisaus",
"Yu siang saus",
"Gon boa saus",
"Curry saus",
"Oestersaus",
"Zwarte pepersaus",
"Champignons",
"Chinese champignons",
"A la Maleisïe",
]
specials = [
"Nasi Kippenbolletjes Zoetzuur",
"Bami Kippenbolletjes Zoetzuur",
"Nasi Varkenbolletjes Zoetzuur",
"Bami Varkenbolletjes Zoetzuur",
"Nasi Babi Pangang",
"Bami Babi Pangang",
"Diverse Groenten met Bami",
"Diverse Groenten met Nasi",
]
def add() -> None:
"Add Ocean Garden to the database"
chinees = Location()
chinees.configure(
"Oceans's Garden",
"Zwijnaardsesteenweg 399 9000 Gent",
"tel: 09/222.72.74",
"http://oceangarden.byethost3.com/studentenmenus.html",
)
db.session.add(chinees)
def chinees_create_entry(name) -> None:
entry = Product()
entry.configure(chinees, name, 550)
db.session.add(entry)
def chinees_create_regulat(zetmeel, vlees="", saus="") -> None:
chinees_create_entry("{} {} {}".format(zetmeel, vlees, saus).rstrip())
for z, v, s in product(zetmelen, vlezen, sauzen):
chinees_create_regulat(z, v, s)
for special in specials:
chinees_create_entry(special)

View file

@ -1,121 +0,0 @@
"Script to add Primadonna to Haldis"
from app import db
from models import Location, Product
def add():
"Add Primadonna to the database"
addTA()
addAfhalen()
pizzasTA = {
"Peperoni": 750,
"Basis pizza (extra garneringen zie site)": 600,
"Parma": 750,
"Margharita": 600,
"Funghi": 715,
"Mamma mia": 715,
"Napoletana": 750,
"Exotic": 750,
"Siciliana": 750,
"Michelangelo": 750,
"Roma": 750,
"Torno": 750,
"Bolognese": 780,
"Hawai": 910,
"Cipolla": 910,
"Dolce vita": 910,
"Valentino": 910,
"Vegateriana": 1000,
"La donna": 1000,
"Tropical": 1000,
"Quattro Stagioni": 1000,
"Romana": 1000,
"Diabolo": 1000,
"Turkish": 1000,
"Cesar": 1000,
"Calzone": 1040,
"Calzone Vegetariana": 1040,
"Quattro Formaggi": 1040,
"Frutti di mare": 1040,
"Gerookte ham en rucola": 1040,
"Van de chef": 1170,
"Milano": 1170,
"Soronto": 1260,
"Primma Donna": 1260,
"Pasta (zie site voor opties)": 900,
}
def addTA() -> None:
"Add Primadonna on takeaway.com to the database"
primadonna_takeaway = Location()
primadonna_takeaway.configure(
"Primadonna (takeaway laten bezorgen)",
"Overpoortstraat 46 9000 Gent",
"tel: 0475 40 13 00",
"https://www.takeaway.com/be-en/prima-donna",
)
db.session.add(primadonna_takeaway)
for pizza, price in pizzasTA.items():
entry = Product()
entry.configure(primadonna_takeaway, pizza, price)
db.session.add(entry)
pizzasAfhalen = {
"Peperoni": 575,
"Basis pizza (extra garneringen zie site)": 450,
"Parma": 575,
"Margharita": 450,
"Funghi": 550,
"Mamma mia": 550,
"Napoletana": 575,
"Exotic": 575,
"Siciliana": 575,
"Michelangelo": 575,
"Roma": 575,
"Torno": 575,
"Bolognese": 600,
"Hawai": 700,
"Cipolla": 700,
"Dolce vita": 700,
"Valentino": 700,
"Vegateriana": 770,
"La donna": 770,
"Tropical": 770,
"Quattro Stagioni": 770,
"Romana": 770,
"Diabolo": 770,
"Turkish": 770,
"Cesar": 770,
"Calzone": 800,
"Calzone Vegetariana": 800,
"Quattro Formaggi": 800,
"Frutti di mare": 800,
"Gerookte ham en rucola": 800,
"Van de chef": 900,
"Milano": 900,
"Soronto": 970,
"Primma Donna": 970,
"Pasta (zie site voor opties)": 700,
}
def addAfhalen() -> None:
"Add Primadonna to takeaway to the database"
primadonna_afhalen = Location()
primadonna_afhalen.configure(
"Primadonna (bellen en afhalen)",
"Overpoortstraat 46 9000 Gent",
"tel: 0475 40 13 00",
"http://primadonnagent.be/Menu.html",
)
db.session.add(primadonna_afhalen)
for pizza, price in pizzasAfhalen.items():
entry = Product()
entry.configure(primadonna_afhalen, pizza, price)
db.session.add(entry)

View file

@ -1,51 +0,0 @@
"Script to add SimPizza to Haldis"
from app import db
from models import Location, Product
pizzas = [
"Bolognese de luxe",
"Hawaï",
"Popeye",
"Pepperoni",
"Seafood",
"Hot pizzaaah!!!",
"Salmon delight",
"Full option",
"Pitza kebab",
"Multi cheese",
"4 Seasons",
"Mega fish",
"Creamy multi cheese",
"Green fiësta",
"Chicken bbq",
"Funky chicken",
"Veggie",
"Meat lovers",
"Scampi mampi",
"Tabasco",
"Chicken time",
"Meatballs",
"Tuna",
"Anchovy",
"Calzone",
"Bbq meatballs",
"Creamy chicken",
"Hot bolognese",
]
def add() -> None:
"Add Simpizza to the database"
simpizza = Location()
simpizza.configure(
"Sim-pizza",
"De Pintelaan 252 9000 Gent",
"tel: 09/321.02.00",
"http://simpizza.be",
)
db.session.add(simpizza)
for pizza in pizzas:
entry = Product()
entry.configure(simpizza, pizza, 1195)
db.session.add(entry)

View file

@ -1,139 +0,0 @@
"Script to add Stefanos to Haldis"
from app import db
from models import Location, Product
bickies = {
"Bicky Burger Original": 330,
"Bicky Burger": 300,
"Bicky Glenniei": 330,
"Bicky Capoentje": 330,
"Bicky Chicken": 350,
"Bicky Fish": 350,
"Bicky Veggie": 350,
}
sauskes = {
"american": 70,
"andalouse": 70,
"bicky saus": 70,
"cocktail": 70,
"curryketchu": 70,
"gele curry saus": 70,
"hannibal": 70,
"jamballa": 70,
"joppie": 70,
"loempiasaus": 70,
"looksaus": 70,
"mammout saus": 70,
"mayo": 70,
"mosterd": 70,
"pepersaus": 70,
"pickles": 70,
"pili-pili saus": 70,
"samurai": 70,
"tartare": 70,
"ketchup": 70,
"toscanse saus": 70,
"zoete mayo": 70,
"stoverijsaus": 130,
"special op vlees": 80,
"speciaal op friet": 160,
}
special_bickies = {
"Bicky Yellow": 400,
"Bicky Hermes": 500,
"Bicky Grand Cru": 530,
"Bicky Royal": 600,
"Bicky Wrap": 400,
"Bicky Rib": 450,
"Lloydje/Plankske": 600,
}
specials = {
"Julientje": 650,
"Julientje Dubbel": 800,
"Veggie Julientje": 700,
"Veggie Julientje Dubbel": 800,
"Rombautje": 700,
"Rombautje Dubbel": 900,
"Bolleke": 650,
"Bolleke Dubbel": 800,
"Hendrik": 700,
"Hendrik Dubbel": 900,
"Lieveke": 700,
"Molleke": 850,
"Molleke Dubbel": 1200,
"Stefano": 650,
"Stefano Dubbel": 800,
"Picasso": 1350,
}
vlezekes = {
"Ardeense sate": 350,
"Bamischijf": 200,
"5 Bitterballen": 150,
"Jagerworst": 300,
"Boulet": 200,
"Chixfingers": 350,
"Chicken Nuggets": 350,
"Crizzly Pikant": 350,
"Frikandel": 100,
"Garnaalballetjes": 350,
"Garnaalkroket": 300,
"Kaasballetjes": 250,
"Kaaskroket": 100,
"Kipcorn": 200,
"Kipsate": 400,
"Loempia met kip": 350,
"Lookworst": 300,
"Merguez": 350,
"Mexicano": 200,
"Mini Loempia's met saus": 300,
"Mini Lucifers": 300,
"Ragouzi": 250,
"stoofvlees": 450,
}
friet = {"Klein pak": 200, "Midden pak": 250, "Groot pak": 300}
data = [special_bickies, specials, vlezekes, friet]
def add() -> None:
"Add Stefanos to the database"
stefanos = Location()
stefanos.configure(
"Stefano's Place",
"Overpoortstraat 12 9000 Gent",
"tel: geen",
"https://www.facebook.com/pages/category/Fast-Food-Restaurant/Stefanos-Place-370774480004139/", # pylint: disable=C0301
)
db.session.add(stefanos)
# sommige bickies kunde met een schel kaas bestellen
for name, price in bickies.items():
bicky = Product()
bicky.configure(stefanos, name, price)
db.session.add(bicky)
bicky_cheese = Product()
bicky_cheese.configure(stefanos, name + " cheese", price + 30)
db.session.add(bicky_cheese)
for dictionary in data:
for name, price in dictionary.items():
item = Product()
item.configure(stefanos, name, price)
db.session.add(item)
# saus in een potteke bestellen is 10 cent extra
for name, price in sauskes.items():
saus = Product()
saus.configure(stefanos, name, price)
db.session.add(saus)
saus_apart = Product()
saus_apart.configure(stefanos, name + " apart", price + 10)
db.session.add(saus_apart)

View file

@ -1,24 +0,0 @@
from app import db
from models import Location, Product
STUFFS = [
("Broodje zever", 540),
("Broodje aap", 0),
("Broodje goud", 500000),
]
def add() -> None:
testlocation = Location()
testlocation.configure(
"Testlocation",
"Please ignore!",
"0469 69 69 69",
"http://localhost:8000/",
)
db.session.add(testlocation)
for stuff in STUFFS:
entry = Product()
entry.configure(testlocation, *stuff)
db.session.add(entry)

View file

@ -1,19 +1,9 @@
"Script for interaction and changes to the database"
import add_admins
import add_fitchen
import add_oceans_garden
import add_primadonna
import add_simpizza
import add_testlocation
from app import db, create_app
entry_sets = {
"Admins": add_admins.add,
"Testlocation": add_testlocation.add,
"Ocean's Garden": add_oceans_garden.add,
"SimPizza": add_simpizza.add,
"Primadonna": add_primadonna.add,
"Fitchen": add_fitchen.add,
"admins": add_admins.add,
}
yes = ["yes", "y"]
@ -42,7 +32,7 @@ def add_all() -> None:
def recreate_from_scratch() -> None:
"Recreate a completely new database"
confirmation = "Are you very very sure? (Will delete previous entries!) (y/N) "
if input(confirmation) in yes:
if input(confirmation).lower() in yes:
print("Resetting the database!")
db.drop_all()
db.create_all()