Implement AI orchestration wedding demo
This commit is contained in:
35
backend/alembic/env.py
Normal file
35
backend/alembic/env.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from logging.config import fileConfig
|
||||
|
||||
from alembic import context
|
||||
from sqlalchemy import engine_from_config, pool
|
||||
|
||||
from app.config import get_settings
|
||||
from app.infrastructure.database import Base
|
||||
|
||||
config = context.config
|
||||
config.set_main_option("sqlalchemy.url", get_settings().database_url)
|
||||
|
||||
if config.config_file_name is not None:
|
||||
fileConfig(config.config_file_name)
|
||||
|
||||
target_metadata = Base.metadata
|
||||
|
||||
|
||||
def run_migrations_offline() -> None:
|
||||
context.configure(url=get_settings().database_url, target_metadata=target_metadata, literal_binds=True)
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
def run_migrations_online() -> None:
|
||||
connectable = engine_from_config(config.get_section(config.config_ini_section), prefix="sqlalchemy.", poolclass=pool.NullPool)
|
||||
with connectable.connect() as connection:
|
||||
context.configure(connection=connection, target_metadata=target_metadata)
|
||||
with context.begin_transaction():
|
||||
context.run_migrations()
|
||||
|
||||
|
||||
if context.is_offline_mode():
|
||||
run_migrations_offline()
|
||||
else:
|
||||
run_migrations_online()
|
||||
70
backend/alembic/versions/0001_initial.py
Normal file
70
backend/alembic/versions/0001_initial.py
Normal file
@@ -0,0 +1,70 @@
|
||||
"""initial schema
|
||||
|
||||
Revision ID: 0001_initial
|
||||
Revises:
|
||||
Create Date: 2026-06-26 00:00:00.000000
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = "0001_initial"
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.create_table(
|
||||
"tasks",
|
||||
sa.Column("id", sa.Integer(), primary_key=True),
|
||||
sa.Column("title", sa.String(length=240), nullable=False),
|
||||
sa.Column("assignee", sa.String(length=120), nullable=True),
|
||||
sa.Column("due_date", sa.DateTime(), nullable=True),
|
||||
sa.Column("status", sa.String(length=40), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(), nullable=False),
|
||||
)
|
||||
op.create_table(
|
||||
"notes",
|
||||
sa.Column("id", sa.Integer(), primary_key=True),
|
||||
sa.Column("content", sa.String(length=2000), nullable=False),
|
||||
sa.Column("category", sa.String(length=40), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(), nullable=False),
|
||||
)
|
||||
op.create_table(
|
||||
"reservations",
|
||||
sa.Column("id", sa.Integer(), primary_key=True),
|
||||
sa.Column("vendor", sa.String(length=180), nullable=False),
|
||||
sa.Column("reservation_date", sa.DateTime(), nullable=False),
|
||||
sa.Column("status", sa.String(length=40), nullable=False),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(), nullable=False),
|
||||
)
|
||||
op.create_table(
|
||||
"pending_actions",
|
||||
sa.Column("id", sa.Integer(), primary_key=True),
|
||||
sa.Column("meeting_id", sa.String(length=120), nullable=False),
|
||||
sa.Column("tool", sa.String(length=120), nullable=False),
|
||||
sa.Column("intent", sa.String(length=120), nullable=False),
|
||||
sa.Column("reasoning", sa.String(length=1000), nullable=False),
|
||||
sa.Column("confidence", sa.Float(), nullable=False),
|
||||
sa.Column("payload", sa.JSON(), nullable=False),
|
||||
sa.Column("extracted_entities", sa.JSON(), nullable=False),
|
||||
sa.Column("validation", sa.JSON(), nullable=False),
|
||||
sa.Column("policy", sa.JSON(), nullable=False),
|
||||
sa.Column("status", sa.String(length=40), nullable=False),
|
||||
sa.Column("execution_result", sa.JSON(), nullable=True),
|
||||
sa.Column("created_at", sa.DateTime(), nullable=False),
|
||||
sa.Column("updated_at", sa.DateTime(), nullable=False),
|
||||
)
|
||||
op.create_index("ix_pending_actions_meeting_id", "pending_actions", ["meeting_id"])
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index("ix_pending_actions_meeting_id", table_name="pending_actions")
|
||||
op.drop_table("pending_actions")
|
||||
op.drop_table("reservations")
|
||||
op.drop_table("notes")
|
||||
op.drop_table("tasks")
|
||||
Reference in New Issue
Block a user