Skip to content

fix: to ensure Docker Compose starts without errors, you need to add …#486

Open
AntonyCheng wants to merge 1 commit intodataelement:mainfrom
AntonyCheng:add-notification-to-fix-docker-startup-error
Open

fix: to ensure Docker Compose starts without errors, you need to add …#486
AntonyCheng wants to merge 1 commit intodataelement:mainfrom
AntonyCheng:add-notification-to-fix-docker-startup-error

Conversation

@AntonyCheng
Copy link
Copy Markdown

Summary

Register the Notification model in backend/alembic/env.py so that Alembic detects the notifications table during migrations.

Problem

When running docker compose up, the application fails to start with an error indicating the notifications table cannot be found. This happens because the Notification model was not imported in the Alembic environment file, so SQLAlchemy's Base.metadata never registered it. As a result, Alembic is unaware of the table and cannot manage it through migrations.

Solution

Add the Notification model import alongside the other model imports already present in backend/alembic/env.py:

from app.models.notification import Notification  # noqa: F401

This follows the same pattern used for all other models in the file (e.g., Agent, User, AuditLog, etc.) and ensures Base.metadata includes the notifications table.

Test Plan

  • Run docker compose up and confirm the application starts without the missing table error
  • Run alembic revision --autogenerate -m "description" and verify the notifications table is correctly detected
  • Verify existing migrations continue to apply without issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant