This is a Next.js project bootstrapped with create-next-app.
This project uses Drizzle ORM for database management. The schema is defined in src/db/schema.ts.
The kv table in src/db/schema.ts is a required built-in table that must never be removed or modified. Deleting or editing this table definition will cause:
- Database schema conflicts during deployment
- Interactive prompts during
drizzle-kit pushthat block app startup - Deployment failures and health check timeouts
Rules for the kv table:
- ❌ Never delete the table definition
- ❌ Never modify the table name, fields, or types
- ❌ Never rename or comment out the table
- ✅ Always keep it exactly as defined in the template
Always keep the kv table definition unchanged in your schema file, even if you don't use it.
Add your custom table definitions below the kv table in src/db/schema.ts. See the examples in that file for reference.
The db:push command uses drizzle-kit push to synchronize your schema with the database. This command is configured to fail fast rather than prompt for user input.
Important behavior:
- The push command will fail immediately if there are ambiguous or destructive schema changes
- This is intentional to prevent blocking deployments
- Common failure scenarios:
- Renaming columns (Drizzle can't distinguish rename from delete+add)
- Renaming tables
- Adding constraints to tables with existing data
- Ambiguous schema changes
When the push fails, you should:
- Make non-destructive changes instead:
- Instead of renaming columns: Add a new column, migrate data, then remove the old column in a separate change
- Instead of renaming tables: Create a new table with the desired name
- Instead of adding unique constraints to populated tables: Clear data first or use nullable fields
- Review the error message from
drizzle-kit pushto understand what change is ambiguous - Adjust your schema to be more explicit and non-destructive
First, run the development server:
pnpm run dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.