Skip to content

Commit

Permalink
DB Tables & Seeding (#13)
Browse files Browse the repository at this point in the history
1. SQLAlchemy Models: Implemented models for tables as outlined in the database design, including:

* `MenuModel`
* `IngredientsModel`
* `RecipeIngredientModel`
* `StockModel`

These models represent the core entities and relationships in the database schema, as in the design doc.

2. Seeding and Clearing Scripts: Addition of a script to seed (and clear) the database. Seeding is based on the `/data/*.csv` files, and uses `location_id` to filter and inject data appropriately.

3. Updated the `Dockerfile` to include the `location_id` argument for database seeding, ensuring that the seeding process runs correctly within the Docker container.
  • Loading branch information
PaulJWright authored Aug 5, 2024
1 parent 9c2a883 commit 5890d05
Show file tree
Hide file tree
Showing 17 changed files with 3,145 additions and 1 deletion.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ repos:
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
exclude: ".*(.fits|.fts|.fit|.header|.txt|tca.*|extern.*|.rst|.md|cm/__init__.py|sunpy/extern|docs/conf.py)$"

- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ To get started, run the following (for a full breakdown, see `/docker/README.rst
curl -X 'GET' 'http://localhost:8000/order' -H 'accept: application/json'
{"orders":[]} # empty because the DB is empty
The SQlite DB can be found at `/data/orders.db`, and can easily viewed through a GUI, e.g. https://sqlitebrowser.org/dl/

Developing
==========
Expand Down
Loading

0 comments on commit 5890d05

Please sign in to comment.