finally got alembic working

This commit is contained in:
maxDorninger
2025-04-26 19:16:27 +02:00
parent 3fa50313b8
commit 33e05a93a3
3 changed files with 15 additions and 10 deletions

9
.gitignore vendored
View File

@@ -3,4 +3,11 @@ venv
MediaManager.iml
backend/res
backend/res/.env
docker-compose.yml
docker-compose.yml
data/*
movie/*
torrent/*
tv/*
log.txt
res/*
/backend/src/indexer/indexers/prowlarr.http

View File

@@ -1,5 +1,8 @@
import os
import sys
sys.path = ['', '..'] + sys.path[1:]
from logging.config import fileConfig
from alembic import context
@@ -7,12 +10,6 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
from sqlalchemy import engine_from_config
from sqlalchemy import pool
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.insert(0, project_root)
# SQLAlchemy Base
from ..src.database import Base
# All Tables
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
@@ -27,6 +24,7 @@ if config.config_file_name is not None:
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
from backend.src.database import Base
target_metadata = Base.metadata

View File

@@ -4,7 +4,7 @@ services:
restart: unless-stopped
container_name: postgres
volumes:
- .\backend\res\postgres:/var/lib/postgresql/data
- .\res\postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: MediaManager
POSTGRES_DB: MediaManager
@@ -19,7 +19,7 @@ services:
- PGID=1000
- TZ=Etc/UTC
volumes:
- .\backend\res\prowlarr:/config
- .\res\prowlarr:/config
ports:
- "9696:9696"
qbittorrent: