Skip to content

Commit 8bb5958

Browse files
committed
fix migrations
1 parent 5db1f74 commit 8bb5958

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,22 @@ Python >= 3.11
1010
`nim >=2.0.0` (https://nim-lang.org/install.html)
1111
(Note that Debian distros have only packaged `1.6.x` as of Jan 2024)
1212

13-
## FrameOS Backend
13+
## FrameOS Frontend
14+
15+
```bash
16+
cd frontend
17+
npm install
18+
npm run dev
19+
```
1420

21+
## FrameOS Backend
1522

1623
```bash
1724
cd backend
1825
python3 -m venv env
1926
source env/bin/activate
20-
pip install -r requirements.txt
21-
flask db upgrade
27+
uv pip install -r requirements.txt
28+
DEBUG=1 alembic ugprade head
2229

2330
cd ../frontend
2431
npm install
@@ -32,17 +39,17 @@ cd ..
3239
# start a redis server
3340
redis-server --daemonize yes
3441

35-
honcho start
42+
DEBUG=1 python -m app.fastapi
3643
```
3744

3845
## Running migrations
3946

4047
```bash
4148
cd backend
4249
# create migration after changing a model
43-
flask db migrate -m "something changed"
50+
DEBUG=1 python -m alembic revision --autogenerate -m "name of migration"
4451
# apply the migrations
45-
flask db upgrade
52+
DEBUG=1 python -m alembic upgrade head
4653
```
4754

4855
## Installing pre-commit
@@ -60,7 +67,7 @@ pre-commit uninstall
6067

6168
```bash
6269
cd backend
63-
bin/tests
70+
pytest
6471
```
6572

6673
## FrameOS on-frame software

backend/alembic.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ script_location = migrations
1212

1313
# Logging configuration
1414
[loggers]
15-
keys = root,sqlalchemy,alembic,flask_migrate
15+
keys = root,sqlalchemy,alembic
1616

1717
[handlers]
1818
keys = console
@@ -35,11 +35,6 @@ level = INFO
3535
handlers =
3636
qualname = alembic
3737

38-
[logger_flask_migrate]
39-
level = INFO
40-
handlers =
41-
qualname = flask_migrate
42-
4338
[handler_console]
4439
class = StreamHandler
4540
args = (sys.stderr,)

backend/app/database.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ def get_db():
1313
yield db
1414
finally:
1515
db.close()
16-
17-
def create_db():
18-
Base.metadata.create_all(bind=engine)

backend/migrations/env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
# Import your Base from the FastAPI application
88
from app.database import Base
9+
from app.models import * # noqa
910
from app.config import get_config
1011

1112
# this is the Alembic Config object, which provides

0 commit comments

Comments
 (0)