feat: add Participant and MagicToken models with automatic migrations
Implements Phase 2 infrastructure for participant registration and authentication: Database Models: - Add Participant model with exchange scoping and soft deletes - Add MagicToken model for passwordless authentication - Add participants relationship to Exchange model - Include proper indexes and foreign key constraints Migration Infrastructure: - Generate Alembic migration for new models - Create entrypoint.sh script for automatic migrations on container startup - Update Containerfile to use entrypoint script and include uv binary - Remove db.create_all() in favor of migration-based schema management This establishes the foundation for implementing stories 4.1-4.3, 5.1-5.3, and 10.1. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+8
-3
@@ -72,9 +72,14 @@ def create_app(config_name: str | None = None) -> Flask:
|
||||
|
||||
# Import models to ensure they're registered with SQLAlchemy
|
||||
with app.app_context():
|
||||
from src.models import Admin, Exchange, RateLimit # noqa: F401
|
||||
|
||||
db.create_all()
|
||||
from src.models import ( # noqa: F401
|
||||
Admin,
|
||||
Exchange,
|
||||
MagicToken,
|
||||
Participant,
|
||||
RateLimit,
|
||||
)
|
||||
# Schema managed by Alembic migrations (applied via entrypoint script)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user