diff --git a/.github/workflows/gated-ci-atomic.yml b/.github/workflows/gated-ci-atomic.yml index d6487c808..f529d9cc2 100644 --- a/.github/workflows/gated-ci-atomic.yml +++ b/.github/workflows/gated-ci-atomic.yml @@ -76,7 +76,7 @@ jobs: DATABASE_URL: file:./dev.db - name: Validate Prisma Schema - run: bunx prisma validate + run: bunx prisma validate --schema=../../prisma/schema.prisma env: DATABASE_URL: file:./dev.db diff --git a/.github/workflows/gated-ci.yml b/.github/workflows/gated-ci.yml index 7cfc8e26a..4936c697e 100644 --- a/.github/workflows/gated-ci.yml +++ b/.github/workflows/gated-ci.yml @@ -66,7 +66,7 @@ jobs: DATABASE_URL: file:./dev.db - name: Validate Prisma Schema - run: bunx prisma validate + run: bunx prisma validate --schema=../../prisma/schema.prisma env: DATABASE_URL: file:./dev.db diff --git a/.github/workflows/gated-deployment.yml b/.github/workflows/gated-deployment.yml index b86d70825..075555829 100644 --- a/.github/workflows/gated-deployment.yml +++ b/.github/workflows/gated-deployment.yml @@ -77,7 +77,7 @@ jobs: DATABASE_URL: file:./dev.db - name: Validate database schema - run: bunx prisma validate + run: bunx prisma validate --schema=../../prisma/schema.prisma env: DATABASE_URL: file:./dev.db diff --git a/README.md b/README.md index a52b33a18..4f07e5635 100644 --- a/README.md +++ b/README.md @@ -76,10 +76,16 @@ This spins up: ```bash # Clone and install git clone -cd metabuilder/frontends/nextjs -npm install +cd metabuilder -# Set up database +# Option 1: Run from root (recommended for quick setup) +npm install +npm run db:generate +npm run db:push + +# Option 2: Run from frontends/nextjs +cd frontends/nextjs +npm install npm run db:generate npm run db:push @@ -87,8 +93,12 @@ npm run db:push cd ../../deployment ./scripts/bootstrap-system.sh -# Start development -cd ../frontends/nextjs +# Start development (from root) +cd .. +npm run dev + +# Or from frontends/nextjs +cd frontends/nextjs npm run dev ``` @@ -492,11 +502,16 @@ const result = await adapter.list('InstalledPackage', { ### Database Commands ```bash -# Development +# Development (can be run from root or frontends/nextjs) npm run db:generate # Generate Prisma client npm run db:push # Apply schema changes npm run db:migrate # Create migration -npm run db:studio # Open database UI + +# From root directory +npm run db:generate # Delegates to frontends/nextjs + +# From frontends/nextjs directory +npm run db:generate # Uses --schema=../../prisma/schema.prisma # Production (via Docker) docker exec -it metabuilder-postgres-prod psql -U metabuilder