Commit Graph

12 Commits

Author SHA1 Message Date
06238f958a fix(entrypoint): drop prisma db push; add NextAuth DDL to SQL bootstrap
prisma db push compared DB to schema-only NextAuth models and proposed
dropping fs_*, agent_*, atlas_*, etc. on every container start.
Use CREATE TABLE IF NOT EXISTS for users/accounts/sessions/verification_tokens
plus existing app tables — same pattern as admin migrate.

Made-with: Cursor
2026-04-01 13:10:00 -07:00
26429f3517 feat(agent): event timeline API, SSE stream, Coolify DDL, env template
- Add agent_session_events table + GET/POST events + SSE stream routes
- Build Agent tab: hydrate from events + EventSource while running
- entrypoint: create agent_sessions + agent_session_events on container start
- .env.example for AGENT_RUNNER_URL, AGENT_RUNNER_SECRET, DATABASE_URL

Made-with: Cursor
2026-04-01 11:48:55 -07:00
35675b7d86 fix: stop prisma from dropping custom tables on every deploy
entrypoint.sh: removed --accept-data-loss from prisma db push.
That flag was silently dropping fs_users, fs_projects etc. on every
container restart, wiping all user/project data. Made the push
non-fatal so a schema mismatch doesn't block startup.

create/route.ts: fixed same broken ON CONFLICT expression as
authOptions.ts — replaced with explicit SELECT + INSERT/UPDATE
to reliably upsert fs_users before inserting the project.

Made-with: Cursor
2026-02-27 19:15:55 -08:00
ef7a88e913 migrate: replace Firebase with PostgreSQL across core routes
- chat-context.ts: session history now from fs_sessions
- /api/sessions: reads from fs_sessions (NextAuth session auth)
- /api/github/connect: NextAuth session + stores in fs_users.data
- /api/user/api-key: NextAuth session + stores in fs_users.data
- /api/projects/[id]/vision: PATCH to fs_projects JSONB
- /api/projects/[id]/knowledge/items: reads from fs_knowledge_items
- /api/projects/[id]/knowledge/import-ai-chat: uses pg createKnowledgeItem
- lib/server/knowledge.ts: fully rewritten to use PostgreSQL
- entrypoint.sh: add fs_knowledge_items and chat_conversations tables

Made-with: Cursor
2026-02-27 13:25:38 -08:00
0625943cc1 fix: remove SSL from internal DB connection in entrypoint
Made-with: Cursor
2026-02-27 12:51:50 -08:00
cb0ece541f fix: ensure fs_ app tables created on every startup via node/pg
Made-with: Cursor
2026-02-27 12:48:02 -08:00
17056ea00c fix: restore auth fixes — next-auth prisma adapter, serverExternalPackages, prisma db push on start
Made-with: Cursor
2026-02-27 12:30:52 -08:00
1f13d4ef74 fix: remove prisma db push from entrypoint (was dropping fs_* tables!) 2026-02-18 01:39:47 +00:00
bc17ee661f fix: use global prisma cli in entrypoint 2026-02-18 01:35:25 +00:00
5986dfd50c fix: use local prisma binary in entrypoint (avoid npx downloading wrong version) 2026-02-18 01:34:50 +00:00
89cc366175 fix: remove --skip-generate from prisma db push (not a valid flag) 2026-02-18 01:31:09 +00:00
1f62ab09a5 Add entrypoint script to run prisma db push on startup 2026-02-18 00:56:33 +00:00