Merged
Conversation
- Remove database creation from project creation flow - Add on-demand database creation via "Add Database" button - Update StatusBar to show "Not Configured" when no database - Add createDatabase() and deleteDatabase() server actions - Add AddDatabaseCard component for database page - Add type guards for optional database handling - Update documentation to reflect optional database Breaking Change: New projects will not automatically create a database. Users can add a database on-demand from the project's database page. Existing projects with databases are not affected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
✅ PR Check Results: PassedBuild Checks
✨ Great work!All checks passed successfully. Your PR is ready for review. Details:
🔗 View Details: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the PostgreSQL database an optional, on-demand resource for projects. Previously, every project was created with a database automatically. Now, users can add a database only when needed, reducing resource consumption and simplifying the project creation flow.
Changes
Backend
lib/actions/database.ts(new): Server Actions for creating and deleting databases on-demandlib/actions/project.ts: Removed automatic database creation during project creationapp/api/projects/route.ts: Removed database creation from project API endpointlib/util/type-guards.ts(new): Type guard utilities for project resourceslib/util/projectStatus.ts: Updated comments for empty resource array handlingFrontend
app/(dashboard)/projects/[id]/database/_components/add-database-card.tsx(new): UI component for adding a databaseapp/(dashboard)/projects/[id]/database/page.tsx: Show "Add Database" card when no database existscomponents/layout/status-bar.tsx: Display "Database: Not Configured" when no databaseDocumentation
CLAUDE.md: Updated to reflect the new optional database architectureUser Experience
Before:
After:
Architecture
This change follows the existing reconciliation pattern:
createDatabaseaction creates a Database record with statusCREATINGdatabaseReconcilejob picks it up and provisions the K8s resourcesTesting
Breaking Changes
None. Existing projects with databases continue to work unchanged.~