Fix DB issues

This commit is contained in:
Urtzi Alfaro
2025-09-30 13:32:51 +02:00
parent ec6bcb4c7d
commit 147893015e
51 changed files with 341 additions and 1032 deletions

View File

@@ -17,6 +17,13 @@ COPY shared/ /app/shared/
# Copy application code
COPY services/alert_processor/app/ /app/app/
# Copy migrations and alembic config
COPY services/alert_processor/migrations/ /app/migrations/
COPY services/alert_processor/alembic.ini /app/alembic.ini
# Copy scripts directory
COPY scripts/ /app/scripts/
# Create non-root user
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser

View File

@@ -1 +1,15 @@
# services/alert_processor/app/models/__init__.py
"""
Alert Processor Service Models Package
Import all models to ensure they are registered with SQLAlchemy Base.
"""
# Import all models to register them with the Base metadata
from .alerts import Alert, AlertStatus, AlertSeverity
# List all models for easier access
__all__ = [
"Alert",
"AlertStatus",
"AlertSeverity",
]

View File

@@ -1,29 +0,0 @@
"""Initial alert-processor service tables
Revision ID: 001_initial_alert_processor
Revises:
Create Date: 2024-01-01 12:00:00.000000
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision: str = '001_initial_alert_processor'
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# TODO: Add table creation statements for alert_processor service
# This is a placeholder migration - replace with actual table definitions
pass
def downgrade() -> None:
# TODO: Add table drop statements for alert_processor service
pass