This repository was archived by the owner on Sep 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.21 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
init:
docker compose -f ./compose/postgres.yaml up -d
docker exec -ti postgres_chatbot psql -U postgres -c "CREATE DATABASE chatbot"
drop-table-files:
docker exec -ti postgres_chatbot psql -U postgres -d chatbot -c "DROP TABLE files"
drop-alembic-db:
docker exec -ti postgres_chatbot psql -U postgres -d chatbot -c "DROP TABLE alembic_version;"
reset-files-table:
docker exec -ti postgres_chatbot psql -U postgres -d chatbot -c "TRUNCATE TABLE files; DROP SEQUENCE files_id_seq;"
migrate-up:
alembic upgrade +1
migrate-down:
alembic downgrade -1
migrate-commit:
@if [ -z "$(m)" ]; then \
echo "Commit message is required. Usage: make migratecommit m=\"your message\""; \
exit 1; \
fi
alembic revision --autogenerate -m "$(m)"
migrate-history:
alembic history
migrate-checkout:
@if [ -z "$(r)" ]; then \
echo "Revision ID is required. Usage: make migrate-checkout r=<revision-id>"; \
exit 1; \
fi
alembic upgrade $(r)
db-up:
docker compose -f ./compose/postgres.yaml up -d
db-down:
docker compose -f ./compose/postgres.yaml up -d
docker-start:
docker compose up -d
start:
python3 app.py
start-test:
alembic upgrade head
python3 app.py test
start-deploy:
alembic upgrade head
fastapi run app.py