Major changes across backend, frontend, infrastructure: - Provider system with model selection (Google, DeepL, OpenAI, Ollama, Google Cloud) - Admin panel: user management, pricing, settings - Glossary system with CSV import/export - Subscription and tier quota management - Security hardening (rate limiting, API key auth, path traversal fixes) - Docker compose for dev, prod, and IONOS deployment - Alembic migrations for new tables - Frontend: dashboard, pricing page, landing page, i18n (en/fr) - Test suite and verification scripts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
57 lines
1.9 KiB
Python
57 lines
1.9 KiB
Python
"""
|
|
Alembic migration script template
|
|
add_glossaries_tables
|
|
|
|
Revision ID: cb71a958ad92
|
|
Revises: 003_add_revoked_at
|
|
Create Date: 2026-02-22 15:13:10.685242
|
|
|
|
Story 3.9: Glossaires - Endpoint CRUD
|
|
"""
|
|
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision: str = "cb71a958ad92"
|
|
down_revision: Union[str, None] = "003_add_revoked_at"
|
|
branch_labels: Union[str, Sequence[str], None] = None
|
|
depends_on: Union[str, Sequence[str], None] = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"glossaries",
|
|
sa.Column("id", sa.String(length=36), nullable=False),
|
|
sa.Column("user_id", sa.String(length=36), nullable=False),
|
|
sa.Column("name", sa.String(length=255), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(), nullable=True),
|
|
sa.Column("updated_at", sa.DateTime(), nullable=True),
|
|
sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="CASCADE"),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index("ix_glossaries_user_id", "glossaries", ["user_id"], unique=False)
|
|
|
|
op.create_table(
|
|
"glossary_terms",
|
|
sa.Column("id", sa.String(length=36), nullable=False),
|
|
sa.Column("glossary_id", sa.String(length=36), nullable=False),
|
|
sa.Column("source", sa.String(length=500), nullable=False),
|
|
sa.Column("target", sa.String(length=500), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(), nullable=True),
|
|
sa.ForeignKeyConstraint(["glossary_id"], ["glossaries.id"], ondelete="CASCADE"),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index(
|
|
"ix_glossary_terms_glossary_id", "glossary_terms", ["glossary_id"], unique=False
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_glossary_terms_glossary_id", table_name="glossary_terms")
|
|
op.drop_table("glossary_terms")
|
|
op.drop_index("ix_glossaries_user_id", table_name="glossaries")
|
|
op.drop_table("glossaries")
|