Docs
Tutorial

Database Setup

Set up PostgreSQL, MySQL, or SQLite for TikShip

PostgreSQL

Recommended for production.

  1. Install PostgreSQL and create a database:
createdb tikship
  1. Update .env:
DATABASE_URL="postgresql://postgres:password@localhost:5432/tikship"
  1. Run migrations:
npx prisma migrate deploy

MySQL

  1. Create a database:
CREATE DATABASE tikship;
  1. Update .env:
DATABASE_URL="mysql://root:password@localhost:3306/tikship"
  1. Run migrations:
npx prisma migrate deploy

SQLite

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:

  1. Create and apply a migration (development):
npx prisma migrate dev
  1. Regenerate the Prisma client:
npm run db:generate
  1. Optionally open Prisma Studio to inspect data:
npm run db:studio

Migration files are split per database engine under prisma/migrations-postgresql/, prisma/migrations-mysql/, and prisma/migrations-sqlite/.

Database Setup | Tikship