"""DDL export for Todos - app-level migrations."""

from __future__ import annotations


def get_todo_ddl() -> list[str]:
    """Dialect-agnostic DDL for the todos table."""
    return [
        """
        CREATE TABLE IF NOT EXISTS todos (
            id TEXT PRIMARY KEY,
            user_id TEXT NOT NULL,
            topic_id TEXT NOT NULL,
            content TEXT NOT NULL,
            status TEXT NOT NULL DEFAULT 'pending',
            created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
            updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
        )
        """,
        "CREATE INDEX IF NOT EXISTS idx_todos_user_topic ON todos(user_id, topic_id)",
    ]
