2026-02-25 16:51:12 +08:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
2026-02-26 17:58:37 +08:00
|
|
|
def test_initial_migration_exists_and_creates_expected_tables() -> None:
|
2026-02-25 16:51:12 +08:00
|
|
|
versions_dir = Path(__file__).resolve().parents[3] / "alembic" / "versions"
|
2026-02-26 17:58:37 +08:00
|
|
|
migration_files = sorted(versions_dir.glob("20260226_*.py"))
|
|
|
|
|
assert len(migration_files) == 5, "split initial migrations should exist"
|
2026-02-25 16:51:12 +08:00
|
|
|
|
2026-02-26 17:58:37 +08:00
|
|
|
content = "\n".join(m.read_text(encoding="utf-8") for m in migration_files)
|
2026-02-25 16:51:12 +08:00
|
|
|
|
2026-02-26 17:58:37 +08:00
|
|
|
# New tables from social data model redesign
|
|
|
|
|
assert "create_table(" in content and "automation_jobs" in content
|
|
|
|
|
assert "create_table(" in content and "user_agents" in content
|
|
|
|
|
assert "create_table(" in content and "memories" in content
|
|
|
|
|
assert "create_table(" in content and "friendships" in content
|
|
|
|
|
assert "create_table(" in content and "groups" in content
|
|
|
|
|
assert "create_table(" in content and "group_members" in content
|
|
|
|
|
assert "create_table(" in content and "schedule_items" in content
|
|
|
|
|
assert "create_table(" in content and "schedule_subscriptions" in content
|
|
|
|
|
assert "create_table(" in content and "inbox_messages" in content
|
|
|
|
|
assert "create_table(" in content and "todos" in content
|
|
|
|
|
assert "create_table(" in content and "todo_sources" in content
|
|
|
|
|
assert "create_table(" in content and "profiles" in content
|
|
|
|
|
assert "create_table(" in content and "sessions" in content
|
|
|
|
|
assert "create_table(" in content and "messages" in content
|