Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
230b72a
basic Flask scaffold
TheMiloAnderson Mar 18, 2019
e683146
fixes
TheMiloAnderson Mar 18, 2019
67b530f
Merge pull request #22 from python-401d11/project-scaffold
TheMiloAnderson Mar 18, 2019
5cd5d2e
blank route functions
TheMiloAnderson Mar 18, 2019
2c1c1ae
Merge pull request #24 from python-401d11/milo-mon-routes
schoentr Mar 18, 2019
a3b07e1
db table model enpty classes created
TheMiloAnderson Mar 18, 2019
9104a6b
HTML started
schoentr Mar 18, 2019
befee02
db model classes filled in
TheMiloAnderson Mar 18, 2019
a95b407
order.html
schoentr Mar 18, 2019
9d78448
Merge pull request #25 from python-401d11/tim-mon
danhuyle508 Mar 18, 2019
75f353e
bug fixes
TheMiloAnderson Mar 18, 2019
80bb4b7
Merge pull request #27 from python-401d11/dev
danhuyle508 Mar 18, 2019
03b83c0
Merge pull request #26 from python-401d11/milo-mon-models
danhuyle508 Mar 18, 2019
ebd5538
bug fix & first migration
TheMiloAnderson Mar 18, 2019
87fd766
register and items form added
danhuyle508 Mar 18, 2019
260916b
Merge pull request #29 from python-401d11/routes
danhuyle508 Mar 18, 2019
6f5ddf4
db stuff started
danhuyle508 Mar 18, 2019
328ca0e
Merge pull request #28 from python-401d11/milo-mon-models
danhuyle508 Mar 18, 2019
380d6a2
Merge pull request #30 from python-401d11/routes
danhuyle508 Mar 18, 2019
65b8c7d
created standard pytest fixtures, plus customer, manager, employee, item
TheMiloAnderson Mar 18, 2019
6861e55
Merge pull request #31 from python-401d11/milo-mon-testing
schoentr Mar 18, 2019
44863e2
added pytest fixture for orders
TheMiloAnderson Mar 18, 2019
1815b50
hot garbage
danhuyle508 Mar 18, 2019
b74f882
first models tests
TheMiloAnderson Mar 18, 2019
c17a7b7
Merge pull request #32 from python-401d11/routes
danhuyle508 Mar 18, 2019
b7af0fa
Merge branch 'dev' into milo-mon-testing
danhuyle508 Mar 18, 2019
8aa50f8
Merge pull request #33 from python-401d11/milo-mon-testing
danhuyle508 Mar 18, 2019
146369c
registration bug fixes
TheMiloAnderson Mar 18, 2019
d30adb5
Merge pull request #34 from python-401d11/milo-mon-testing
schoentr Mar 18, 2019
3aa36c3
fixed model relations
TheMiloAnderson Mar 18, 2019
ea53b30
Merge pull request #35 from python-401d11/milo-mon-testing
TheMiloAnderson Mar 18, 2019
8c44fbc
orders model test working
TheMiloAnderson Mar 18, 2019
5e50814
order form rendering in html
schoentr Mar 18, 2019
96e05c6
Merge pull request #37 from python-401d11/tim-mon
TheMiloAnderson Mar 18, 2019
014863c
Merge branch 'dev' of https://github.com/python-401d11/py_cafe into m…
TheMiloAnderson Mar 18, 2019
7936c89
Merge pull request #36 from python-401d11/milo-mon-testing
schoentr Mar 18, 2019
7385f1b
Merge branch 'dev' of https://github.com/python-401d11/py_cafe into m…
TheMiloAnderson Mar 18, 2019
e3cb12c
orders dropdown working.. not saving in db
schoentr Mar 18, 2019
d266009
Merge pull request #38 from python-401d11/tim-mon
schoentr Mar 18, 2019
fdfd08e
testing & troubleshooting
TheMiloAnderson Mar 18, 2019
233bc79
Merge pull request #39 from python-401d11/milo-mon-testing
TheMiloAnderson Mar 18, 2019
1603469
auth routes & functions
TheMiloAnderson Mar 19, 2019
bd3d0e8
Manager and Customer classes both inherit from User class
TheMiloAnderson Mar 19, 2019
418897f
Employee class inherits from User
TheMiloAnderson Mar 19, 2019
64761d7
login form & route working with User model inheritance; added employe…
TheMiloAnderson Mar 19, 2019
2882ace
Merge pull request #40 from python-401d11/milo-mon
schoentr Mar 19, 2019
fbb4b3c
Merge pull request #41 from python-401d11/milo-mon
danhuyle508 Mar 19, 2019
c1b806f
update and delete started for items
danhuyle508 Mar 19, 2019
f907396
employee not required for orders; logout function; exception routing
TheMiloAnderson Mar 19, 2019
0d85929
Merge branch 'dev' into routes
danhuyle508 Mar 19, 2019
c8c91a8
Merge pull request #42 from python-401d11/routes
danhuyle508 Mar 19, 2019
1b77e78
started authorization decorator; added cutomers to orders route
TheMiloAnderson Mar 19, 2019
162f4b8
Merge pull request #43 from python-401d11/milo-mon
TheMiloAnderson Mar 19, 2019
90f2303
delete kind of working
danhuyle508 Mar 19, 2019
0436456
Merge pull request #44 from python-401d11/routes
TheMiloAnderson Mar 19, 2019
8da85d0
delete works
danhuyle508 Mar 19, 2019
53ef180
Merge pull request #45 from python-401d11/routes
danhuyle508 Mar 19, 2019
d322b03
role-based authorization is working; orders-create form is saving to DB
TheMiloAnderson Mar 19, 2019
5b63327
Merge branch 'dev' into milo-tues
TheMiloAnderson Mar 19, 2019
22ddf2e
Merge pull request #46 from python-401d11/milo-tues
TheMiloAnderson Mar 19, 2019
a903079
migrate db
schoentr Mar 19, 2019
fb179d8
Merge pull request #47 from python-401d11/tuesday
schoentr Mar 19, 2019
06da7a2
put is working for items
schoentr Mar 19, 2019
24d2b84
Merge pull request #48 from python-401d11/tuesday
danhuyle508 Mar 19, 2019
d41c8e6
orders form supports adding multiple items, saving to DB
TheMiloAnderson Mar 19, 2019
e2de8af
Merge branch 'dev' into milo-tues
TheMiloAnderson Mar 19, 2019
40b8d85
Merge pull request #49 from python-401d11/milo-tues
TheMiloAnderson Mar 19, 2019
529013e
dont use the delete user button
danhuyle508 Mar 19, 2019
e3fa180
Merge branch 'dev' into routes
danhuyle508 Mar 19, 2019
6e9b20d
Merge pull request #50 from python-401d11/routes
danhuyle508 Mar 19, 2019
c08ea19
started building customer-items report model
TheMiloAnderson Mar 19, 2019
a8193ea
Merge branch 'dev' into milo-tues
TheMiloAnderson Mar 19, 2019
dde1a16
Merge pull request #51 from python-401d11/milo-tues
TheMiloAnderson Mar 19, 2019
a819b23
order creation updates item inventory_count
TheMiloAnderson Mar 19, 2019
0c4dcce
Merge branch 'dev' of https://github.com/python-401d11/py_cafe into m…
TheMiloAnderson Mar 19, 2019
d22bf70
Merge pull request #52 from python-401d11/milo-tues
danhuyle508 Mar 19, 2019
c850165
user can delete items from order before submitting
TheMiloAnderson Mar 20, 2019
256e466
Merge pull request #53 from python-401d11/milo-tues
schoentr Mar 20, 2019
44c498f
fixed orders total price calculation
TheMiloAnderson Mar 20, 2019
a766fb2
basic CSS styling & template cleanup
TheMiloAnderson Mar 20, 2019
ccad14d
sales by scustomer working
schoentr Mar 20, 2019
ea4f96f
Merge pull request #55 from python-401d11/tim-wed
TheMiloAnderson Mar 20, 2019
abd54fa
Merge branch 'dev' into milo-wed
schoentr Mar 20, 2019
c2902d9
Merge pull request #54 from python-401d11/milo-wed
schoentr Mar 20, 2019
e508eef
progress on site authorization & navigation
TheMiloAnderson Mar 20, 2019
5299804
can create new managers
TheMiloAnderson Mar 20, 2019
67b2e4b
file reorg & cleanup
TheMiloAnderson Mar 20, 2019
82d50fc
report by item working
schoentr Mar 20, 2019
856587d
Merge pull request #56 from python-401d11/milo-wed
schoentr Mar 20, 2019
ab64f3a
reservations does not work
danhuyle508 Mar 20, 2019
3eba735
Merge branch 'dev' into tim-wed
TheMiloAnderson Mar 20, 2019
6bcf80f
Merge pull request #57 from python-401d11/tim-wed
TheMiloAnderson Mar 20, 2019
1f1b48e
created reports index page
TheMiloAnderson Mar 20, 2019
33faf59
can create employee users
TheMiloAnderson Mar 20, 2019
fdc7735
mobile CSS
TheMiloAnderson Mar 20, 2019
6003240
reservation works
danhuyle508 Mar 20, 2019
5ba75aa
Merge pull request #58 from python-401d11/milo-wed
danhuyle508 Mar 20, 2019
cdcfe3e
Merge branch 'dev' into css
TheMiloAnderson Mar 20, 2019
278c48f
Merge pull request #59 from python-401d11/css
TheMiloAnderson Mar 20, 2019
868d7f4
Update routes.py
danhuyle508 Mar 20, 2019
79fbbfc
wed night fix & refactor
TheMiloAnderson Mar 21, 2019
43dc4b9
orders.cust_id is no longer required
TheMiloAnderson Mar 21, 2019
ed7f35f
migration
TheMiloAnderson Mar 21, 2019
8f6534a
Merge branch 'dev' into milo-wed
schoentr Mar 21, 2019
2252f42
Merge pull request #60 from python-401d11/milo-wed
schoentr Mar 21, 2019
682e9ca
fixed reservations pkey issue
TheMiloAnderson Mar 21, 2019
ffb517f
Merge pull request #61 from python-401d11/milo-thurs
danhuyle508 Mar 21, 2019
9a0ba15
items delete issue tentatively fixed
TheMiloAnderson Mar 21, 2019
a2f4305
changed items delete to active=False; fixed orders bug
TheMiloAnderson Mar 21, 2019
489df1e
bug fix
TheMiloAnderson Mar 21, 2019
6fc3fd7
res bugs fixed and dic strings started
danhuyle508 Mar 21, 2019
e21da50
time report working
schoentr Mar 21, 2019
f64d13d
added route authorization restrictions
TheMiloAnderson Mar 21, 2019
7dcf2ca
Merge pull request #63 from python-401d11/reservation-bugs
TheMiloAnderson Mar 21, 2019
4b9f5d2
Merge branch 'dev' into tim-thurs
TheMiloAnderson Mar 21, 2019
c8c4086
Merge pull request #64 from python-401d11/tim-thurs
TheMiloAnderson Mar 21, 2019
63ad110
Merge branch 'dev' into milo-thurs
danhuyle508 Mar 21, 2019
a3adcb8
Merge pull request #62 from python-401d11/milo-thurs
danhuyle508 Mar 21, 2019
1a067aa
routes bug fix
TheMiloAnderson Mar 21, 2019
82b517b
Merge pull request #65 from python-401d11/milo-thurs
schoentr Mar 21, 2019
602fb7e
time - cheeseburger bug fixed
schoentr Mar 21, 2019
7b9a4c8
fixed orders bug for real this time
TheMiloAnderson Mar 21, 2019
48f15bf
about me updated --tim
schoentr Mar 21, 2019
0d12c82
DS_Store added to git ignore
schoentr Mar 21, 2019
6778ffe
Merge pull request #66 from python-401d11/tim-thurs
TheMiloAnderson Mar 21, 2019
0b49076
existing models & routes tests are passing
TheMiloAnderson Mar 21, 2019
37f8b65
routes & orders testing
TheMiloAnderson Mar 21, 2019
c3d5af2
Merge pull request #67 from python-401d11/milo-thurs
TheMiloAnderson Mar 21, 2019
7d6d480
Update about_us.html
danhuyle508 Mar 21, 2019
80d815d
added items tests
TheMiloAnderson Mar 21, 2019
3c533c1
Merge branch 'dev' of https://github.com/python-401d11/py_cafe into m…
TheMiloAnderson Mar 21, 2019
1b4df67
items routes tests are done & passing
TheMiloAnderson Mar 21, 2019
3c2c396
res tests added
danhuyle508 Mar 21, 2019
7a0e1ed
model testing for reports at 83%
schoentr Mar 21, 2019
687139f
Merge pull request #68 from python-401d11/milo-thurs
schoentr Mar 21, 2019
28436c2
Merge pull request #70 from python-401d11/tim-thurs
TheMiloAnderson Mar 21, 2019
5db379f
Merge branch 'dev' into reservation-bugs
schoentr Mar 21, 2019
6474926
Merge branch 'dev' into reservation-bugs
schoentr Mar 21, 2019
38e93af
Merge pull request #69 from python-401d11/reservation-bugs
schoentr Mar 21, 2019
cd014e4
fixed tests
TheMiloAnderson Mar 21, 2019
94fd34e
Merge pull request #71 from python-401d11/milo-thurs
TheMiloAnderson Mar 21, 2019
b9ce1c6
Update README.md
danhuyle508 Mar 21, 2019
b807cc1
updated About Us page
TheMiloAnderson Mar 21, 2019
db0ac0c
readme
schoentr Mar 21, 2019
341d247
Merge pull request #72 from python-401d11/milo-thurs
schoentr Mar 21, 2019
84a79a3
Merge branch 'dev' into tim-thurs
schoentr Mar 21, 2019
20d93b5
Merge pull request #73 from python-401d11/tim-thurs
schoentr Mar 21, 2019
5e45a24
user tests
TheMiloAnderson Mar 21, 2019
7cbab93
Merge pull request #74 from python-401d11/milo-thurs
TheMiloAnderson Mar 21, 2019
3169fea
Merge pull request #75 from python-401d11/dev
danhuyle508 Mar 21, 2019
3267bf5
kill migrations, hopefully fix deployment issue
TheMiloAnderson Mar 22, 2019
247f5c0
delete old files
TheMiloAnderson Mar 22, 2019
529d220
Merge pull request #76 from python-401d11/milo-thurs
TheMiloAnderson Mar 22, 2019
b198d52
Merge pull request #77 from python-401d11/dev
TheMiloAnderson Mar 22, 2019
5e3ce60
new report - employee items totals
TheMiloAnderson Mar 22, 2019
3528479
fixed items delete bug
TheMiloAnderson Mar 22, 2019
12821e9
Merge pull request #78 from python-401d11/milo-fri
schoentr Mar 22, 2019
d54038d
Merge pull request #79 from python-401d11/dev
schoentr Mar 22, 2019
0820558
minor UX nits
TheMiloAnderson Mar 22, 2019
936221e
items report UX
TheMiloAnderson Mar 22, 2019
c34edd8
update items can change active
TheMiloAnderson Mar 22, 2019
32c8507
Merge pull request #80 from python-401d11/milo-fri
schoentr Mar 22, 2019
29caa8b
items update bug fix
TheMiloAnderson Mar 22, 2019
e54a987
Merge pull request #81 from python-401d11/milo-fri
TheMiloAnderson Mar 22, 2019
7631292
nav styling nit
TheMiloAnderson Mar 22, 2019
68668d5
Merge pull request #82 from python-401d11/milo-fri
TheMiloAnderson Mar 22, 2019
6464a49
Merge pull request #83 from python-401d11/dev
TheMiloAnderson Mar 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[report]
omit = src/tests/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -80,6 +82,7 @@ celerybeat-schedule

# SageMath parsed files
*.sage.py
.DS_Store

# Environments
.env
Expand Down
25 changes: 25 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest = "*"
pytest-watch = "*"
pytest-cov = "*"
pep8 = "*"
autopep8 = "*"

[packages]
requests = "*"
flask = "*"
flask-sqlalchemy = "*"
psycopg2-binary = "*"
flask-migrate = "*"
python-dotenv = "*"
flask-wtf = "*"
passlib = "*"
sqlalchemy = "*"

[requires]
python_version = "3.7"
423 changes: 423 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

58 changes: 51 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,58 @@
# py_cafe

**Authors**: Dan Huyle, Tim Schoen, Milo Anderson
**Authors**: Dan-Huy Le, Tim Schoen, Milo Anderson

**Version**: 0.0.0
**Version**: 1.1.0

## Overview
py_cafe allows restauranteurs to integrate front-of-house data (customer identity, table reservations) with point-of-sale data (menu orders). Managers can view detailed reports on customer preferences & behavior; customers can accumulate reward points or participate in special offers.
## Overview:
Py_cafe allows restauranteurs to integrate front-of-house data (customer identity, table reservations) with point-of-sale data (menu orders). Managers can view detailed reports on customer preferences & behavior; customers can accumulate reward points or participate in special offers.

## Features
More to come
* Allow users to register as customers.
* As Customers users are able to make reservations and place orders.
* Customers are able update order by adding or removing items.
* As Orders are being generated users are able to see the grand-total of items in order.
* Managers are allowed to create, both customer and managers roles.
* As a Manager, you have the ability to add, remove, and update items from the menu.
* Items have the attributes of (Name, Price, Cost (cost of goods sold), and Inventory Count.
* As Orders are being placed, the inventory count reflects changes in real-time.
* As a Manager you have the ability, to run reports which include:
** Users Sales ( how much of each item a selected used has ordered)
** Item Sales(how many times each user as ordered a selected item)
** Timely Sales( All Sales detail (User, Item, Quantity, Time) with in a selected time window.

## Getting Started
We will let you know

## Getting Started — Running local


1. Clone Repo to local machine.
2. Set up a Virtual Environment using PIPENV SHELL
3. Create a database and in your .env file DATABASE_URL = << your data base >>
4. Add a secret key to you .env file. SECRET_KEY = <<your secret key (UUID) >>
5. Install dependencies using. PIPENV INSTALL
6. Run the app FLASK RUN
7. In your browser go to localhost:5000
8. In order to set up first manager role go to localhost:5000/user/manager


## Tools Used:
* Vue.js
* flask
* sqlalchemy
* wtforms
* SQL
* postgres

## Deployment:
* Deployed on AWS - ES2 (server)
* AWS - RDS (database)
* guincorn -- Python Web Server Gateway Interface HTTP server
* nginx -- web server which can also be used as a reverse proxy, load balancer.

## Credits

* CSS Skeleton V2.04 was used Copyright 2014, Dave Gamache, Free to use under MIT license.
* CSS Inspired by bitsofco.de/holy-grail-layout-css-grid



1 change: 1 addition & 0 deletions migrations/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generic single-database configuration.
45 changes: 45 additions & 0 deletions migrations/alembic.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# A generic, single database configuration.

[alembic]
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false


# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
95 changes: 95 additions & 0 deletions migrations/env.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
from __future__ import with_statement

import logging
from logging.config import fileConfig

from sqlalchemy import engine_from_config
from sqlalchemy import pool

from alembic import context

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config

# Interpret the config file for Python logging.
# This line sets up loggers basically.
fileConfig(config.config_file_name)
logger = logging.getLogger('alembic.env')

# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
from flask import current_app
config.set_main_option('sqlalchemy.url',
current_app.config.get('SQLALCHEMY_DATABASE_URI'))
target_metadata = current_app.extensions['migrate'].db.metadata

# other values from the config, defined by the needs of env.py,
# can be acquired:
# my_important_option = config.get_main_option("my_important_option")
# ... etc.


def run_migrations_offline():
"""Run migrations in 'offline' mode.

This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.

Calls to context.execute() here emit the given string to the
script output.

"""
url = config.get_main_option("sqlalchemy.url")
context.configure(
url=url, target_metadata=target_metadata, literal_binds=True
)

with context.begin_transaction():
context.run_migrations()


def run_migrations_online():
"""Run migrations in 'online' mode.

In this scenario we need to create an Engine
and associate a connection with the context.

"""

# this callback is used to prevent an auto-migration from being generated
# when there are no changes to the schema
# reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html
def process_revision_directives(context, revision, directives):
if getattr(config.cmd_opts, 'autogenerate', False):
script = directives[0]
if script.upgrade_ops.is_empty():
directives[:] = []
logger.info('No changes in schema detected.')

connectable = engine_from_config(
config.get_section(config.config_ini_section),
prefix='sqlalchemy.',
poolclass=pool.NullPool,
)

with connectable.connect() as connection:
context.configure(
connection=connection,
target_metadata=target_metadata,
process_revision_directives=process_revision_directives,
**current_app.extensions['migrate'].configure_args
)

with context.begin_transaction():
context.run_migrations()


if context.is_offline_mode():
run_migrations_offline()
else:
run_migrations_online()
24 changes: 24 additions & 0 deletions migrations/script.py.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""${message}

Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}

"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}


def upgrade():
${upgrades if upgrades else "pass"}


def downgrade():
${downgrades if downgrades else "pass"}
94 changes: 94 additions & 0 deletions migrations/versions/43afb694bcba_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
"""empty message

Revision ID: 43afb694bcba
Revises:
Create Date: 2019-03-21 17:27:23.180765

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '43afb694bcba'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('items',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=256), nullable=False),
sa.Column('price', sa.Numeric(precision=10, scale=2), nullable=True),
sa.Column('cog', sa.Numeric(precision=10, scale=2), nullable=True),
sa.Column('inventory_count', sa.Integer(), nullable=True),
sa.Column('active', sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('users',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=256), nullable=True),
sa.Column('email', sa.String(length=256), nullable=True),
sa.Column('password', sa.String(length=256), nullable=True),
sa.Column('type', sa.String(length=64), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('customers',
sa.Column('phone', sa.String(length=32), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['id'], ['users.id'], onupdate='CASCADE', ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_table('employees',
sa.Column('pay_rate', sa.Numeric(precision=5, scale=2), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['id'], ['users.id'], onupdate='CASCADE', ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_table('managers',
sa.Column('id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['id'], ['users.id'], onupdate='CASCADE', ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_table('orders',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('date_created', sa.DateTime(), nullable=True),
sa.Column('cust_id', sa.Integer(), nullable=True),
sa.Column('empl_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['cust_id'], ['customers.id'], ),
sa.ForeignKeyConstraint(['empl_id'], ['employees.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('reservations',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('cust_id', sa.Integer(), nullable=True),
sa.Column('date', sa.String(length=32), nullable=True),
sa.Column('time', sa.String(length=32), nullable=True),
sa.Column('party', sa.String(length=32), nullable=True),
sa.ForeignKeyConstraint(['cust_id'], ['customers.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
)
op.create_table('order_items',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('order_id', sa.Integer(), nullable=False),
sa.Column('item_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['item_id'], ['items.id'], ),
sa.ForeignKeyConstraint(['order_id'], ['orders.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('order_items')
op.drop_table('reservations')
op.drop_table('orders')
op.drop_table('managers')
op.drop_table('employees')
op.drop_table('customers')
op.drop_table('users')
op.drop_table('items')
# ### end Alembic commands ###
24 changes: 24 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
alembic==1.0.8
certifi==2019.3.9
chardet==3.0.4
Click==7.0
Flask==1.0.2
Flask-Migrate==2.4.0
Flask-SQLAlchemy==2.3.2
Flask-WTF==0.14.2
idna==2.8
itsdangerous==1.1.0
Jinja2==2.10
Mako==1.0.7
MarkupSafe==1.1.1
passlib==1.7.1
psycopg2-binary==2.7.7
python-dateutil==2.8.0
python-dotenv==0.10.1
python-editor==1.0.4
requests==2.21.0
six==1.12.0
SQLAlchemy==1.3.1
urllib3==1.24.1
Werkzeug==0.14.1
WTForms==2.2.1
Loading