Skip to content

Commit b793c57

Browse files
refactor: migrate from better-sqlite3 to Prisma (#170)
* refactor: migrate from better-sqlite3 to Prisma - Install Prisma dependencies and initialize with SQLite - Create Prisma schema matching existing database structure - Replace database.js with Prisma-based database service - Update all API routes, tRPC routers, and WebSocket handler - Convert TypeScript types to match Prisma schema - Update build process to include Prisma migrations - Remove better-sqlite3 dependency All database operations now use Prisma while maintaining SQLite backend. * fix: flatten server data in installed scripts API responses - Transform Prisma nested server objects to flattened fields expected by frontend - Update getAllInstalledScripts, getInstalledScriptsByServer, and getInstalledScriptById - Server names should now display correctly in the installed scripts table - Use nullish coalescing operators for better null handling * fix: ensure DATABASE_URL is set in .env for Prisma during updates - Add ensure_database_url() function to update.sh - Function checks if .env exists and creates from .env.example if needed - Automatically adds DATABASE_URL if not present - Call function after restore_backup_files() in update flow - Fixes Prisma client generation error during updates
1 parent 6b45c41 commit b793c57

File tree

21 files changed

+1181
-961
lines changed

21 files changed

+1181
-961
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ yarn-error.log*
4949
*.tsbuildinfo
5050

5151
# idea files
52-
.idea
52+
.idea
53+
/generated/prisma

0 commit comments

Comments
 (0)