Tutorial
Database Setup
Set up PostgreSQL, MySQL, or SQLite for TikShip
PostgreSQL
Recommended for production.
- Install PostgreSQL and create a database:
createdb tikship- Update
.env:
DATABASE_URL="postgresql://postgres:password@localhost:5432/tikship"- Run migrations:
npx prisma migrate deployMySQL
- Create a database:
CREATE DATABASE tikship;- Update
.env:
DATABASE_URL="mysql://root:password@localhost:3306/tikship"- Run migrations:
npx prisma migrate deploySQLite
Zero-config, great for local development.
DATABASE_URL="file:./dev.db"SQLite is not recommended for production use.
Schema Changes
When you modify prisma/schema.prisma:
- Create and apply a migration (development):
npx prisma migrate dev- Regenerate the Prisma client:
npm run db:generate- Optionally open Prisma Studio to inspect data:
npm run db:studioMigration files are split per database engine under prisma/migrations-postgresql/, prisma/migrations-mysql/, and prisma/migrations-sqlite/.