Files
ai_agent/backend/alembic/versions/0016_user_onboarding_at.py
T
furyhawk 8351e73d39 feat: add Zustand stores for conversation, file preview, sidebar, theme, and knowledge base selection
- Implemented `conversation-store` for managing conversations and messages.
- Created `file-preview-store` to handle file preview state.
- Added `sidebar-store` for sidebar visibility management.
- Developed `theme-store` for theme persistence and management.
- Introduced `kb-selection-store` for managing active knowledge base selections with persistence.

chore: define API and chat types

- Added types for API responses, authentication, chat messages, conversations, and projects.
- Defined interfaces for various entities including users, sessions, and message ratings.

build: configure TypeScript and testing setup

- Set up `tsconfig.json` for TypeScript configuration.
- Created `vitest.config.ts` for testing configuration with Vitest.
- Added `vitest.setup.ts` for global test setup including mocks for Next.js router and media queries.
- Configured Vercel deployment settings in `vercel.json`.
2026-06-11 16:54:43 +08:00

45 lines
1.3 KiB
Python

"""add onboarding_completed_at to users
Revision ID: 0016_user_onboarding_at
Revises: 0015_create_mv_usage_daily
Create Date: 2026-05-08T00:00:00+00:00
Adds:
- users.onboarding_completed_at — nullable timestamptz; null means the user
hasn't completed onboarding yet, set when they finish the wizard.
"""
import sqlalchemy as sa
from alembic import op
revision = "0016_user_onboarding_at"
down_revision = "0015_create_mv_usage_daily"
branch_labels = None
depends_on = None
def upgrade() -> None:
# Idempotent — `0000_users` already includes this column when running on a
# fresh DB. Older deployments that stamped past 0000 still need it added.
bind = op.get_bind()
inspector = sa.inspect(bind)
cols = {c["name"] for c in inspector.get_columns("users")}
if "onboarding_completed_at" not in cols:
op.add_column(
"users",
sa.Column(
"onboarding_completed_at",
sa.DateTime(timezone=True),
nullable=True,
),
)
def downgrade() -> None:
bind = op.get_bind()
inspector = sa.inspect(bind)
cols = {c["name"] for c in inspector.get_columns("users")}
if "onboarding_completed_at" in cols:
op.drop_column("users", "onboarding_completed_at")