-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 949 Bytes
/
Copy pathMakefile
File metadata and controls
40 lines (31 loc) · 949 Bytes
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
docker-build:
docker compose build --no-cache
# Start containers
docker-up:
docker compose up -d
# Stop and remove containers
docker-down:
docker compose down
# run through the entire ETL scripts
data:
docker compose exec python_data python main.py
# Set the alembic base command with custom config path
alembic_cmd = docker-compose exec python_data alembic -c ./db/alembic.ini
# Run migrations (upgrades the DB to latest schema)
alembic_migrate:
@echo "⏫ Upgrading to latest schema..."
$(alembic_cmd) upgrade head
# Create a new revision with autogeneration
alembic_revision:
@read -p "Enter migration message: " msg; \
$(alembic_cmd) revision --autogenerate -m "$$msg"
# Downgrade one revision
alembic_downgrade:
@echo "⏬ Downgrading one revision..."
$(alembic_cmd) downgrade -1
# Show current migration status
alembic_current:
$(alembic_cmd) current
# Show full migration history
alembic_history:
$(alembic_cmd) history