mirror of
https://github.com/furyhawk/ai_agent.git
synced 2026-07-21 02:05:42 +00:00
- 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`.
56 lines
2.0 KiB
Python
56 lines
2.0 KiB
Python
"""create users table
|
|
|
|
Revision ID: 0000_users
|
|
Revises:
|
|
Create Date: 2026-06-11T07:19:21.193991+00:00
|
|
|
|
Base table required by every later migration. Mirrors the current User model
|
|
including is_app_admin (later flagged in 0003 — included here so the table
|
|
is usable immediately when enable_teams=false) and onboarding_completed_at
|
|
(0016 mirror — same reason). OAuth columns are present only when an OAuth
|
|
provider was selected, keeping the schema minimal for password-only setups.
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects.postgresql import UUID as PG_UUID
|
|
|
|
from alembic import op
|
|
|
|
revision = "0000_users"
|
|
down_revision = None
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"users",
|
|
sa.Column(
|
|
"id",
|
|
PG_UUID(as_uuid=True),
|
|
primary_key=True,
|
|
server_default=sa.text("gen_random_uuid()"),
|
|
),
|
|
sa.Column("email", sa.String(255), nullable=False, unique=True, index=True),
|
|
sa.Column("hashed_password", sa.String(255), nullable=True),
|
|
sa.Column("full_name", sa.String(255), nullable=True),
|
|
sa.Column("is_active", sa.Boolean(), nullable=False, server_default=sa.true()),
|
|
sa.Column("role", sa.String(50), nullable=False, server_default="user"),
|
|
sa.Column("is_app_admin", sa.Boolean(), nullable=False, server_default=sa.false()),
|
|
sa.Column("avatar_url", sa.String(500), nullable=True),
|
|
sa.Column("onboarding_completed_at", sa.DateTime(timezone=True), nullable=True),
|
|
sa.Column("oauth_provider", sa.String(32), nullable=True, index=True),
|
|
sa.Column("oauth_id", sa.String(255), nullable=True, index=True),
|
|
sa.Column(
|
|
"created_at",
|
|
sa.DateTime(timezone=True),
|
|
server_default=sa.func.now(),
|
|
nullable=False,
|
|
),
|
|
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=True),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("users")
|