From 5e2287cf3c4667608f483da9a155d03a00c8093e Mon Sep 17 00:00:00 2001 From: orta Date: Mon, 12 Jun 2023 12:03:36 +0100 Subject: [PATCH 1/3] Adds a note about the two commands you will use with your schema to the top of the schema file --- packages/create-redwood-app/templates/js/api/db/schema.prisma | 3 +++ packages/create-redwood-app/templates/ts/api/db/schema.prisma | 3 +++ 2 files changed, 6 insertions(+) diff --git a/packages/create-redwood-app/templates/js/api/db/schema.prisma b/packages/create-redwood-app/templates/js/api/db/schema.prisma index 3dea71a68f23..fc2eb38dfcdf 100644 --- a/packages/create-redwood-app/templates/js/api/db/schema.prisma +++ b/packages/create-redwood-app/templates/js/api/db/schema.prisma @@ -1,3 +1,6 @@ +// Update db during dev, creates no migration files: yarn rw prisma db push +// When you're ready to commit: yarn rw prisma migrate dev + datasource db { provider = "sqlite" url = env("DATABASE_URL") diff --git a/packages/create-redwood-app/templates/ts/api/db/schema.prisma b/packages/create-redwood-app/templates/ts/api/db/schema.prisma index 3dea71a68f23..fc2eb38dfcdf 100644 --- a/packages/create-redwood-app/templates/ts/api/db/schema.prisma +++ b/packages/create-redwood-app/templates/ts/api/db/schema.prisma @@ -1,3 +1,6 @@ +// Update db during dev, creates no migration files: yarn rw prisma db push +// When you're ready to commit: yarn rw prisma migrate dev + datasource db { provider = "sqlite" url = env("DATABASE_URL") From 0c7d8226a286f0f01e60d0a6cd313ef4b482f45e Mon Sep 17 00:00:00 2001 From: Dominic Saadi Date: Wed, 27 Dec 2023 11:46:14 -0800 Subject: [PATCH 2/3] Apply suggestions from code review --- .../create-redwood-app/templates/js/api/db/schema.prisma | 7 +++++-- .../create-redwood-app/templates/ts/api/db/schema.prisma | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/create-redwood-app/templates/js/api/db/schema.prisma b/packages/create-redwood-app/templates/js/api/db/schema.prisma index fc2eb38dfcdf..8c8666606f09 100644 --- a/packages/create-redwood-app/templates/js/api/db/schema.prisma +++ b/packages/create-redwood-app/templates/js/api/db/schema.prisma @@ -1,5 +1,8 @@ -// Update db during dev, creates no migration files: yarn rw prisma db push -// When you're ready to commit: yarn rw prisma migrate dev +// Don't forget to tell Prisma about your edits to this file using +// `yarn rw prisma migrate dev` or `yarn rw prisma db push`. +// `migrate` is like committing while `push` is for prototyping. +// Read more about both here: +// https://www.prisma.io/docs/orm/prisma-migrate datasource db { provider = "sqlite" diff --git a/packages/create-redwood-app/templates/ts/api/db/schema.prisma b/packages/create-redwood-app/templates/ts/api/db/schema.prisma index fc2eb38dfcdf..8c8666606f09 100644 --- a/packages/create-redwood-app/templates/ts/api/db/schema.prisma +++ b/packages/create-redwood-app/templates/ts/api/db/schema.prisma @@ -1,5 +1,8 @@ -// Update db during dev, creates no migration files: yarn rw prisma db push -// When you're ready to commit: yarn rw prisma migrate dev +// Don't forget to tell Prisma about your edits to this file using +// `yarn rw prisma migrate dev` or `yarn rw prisma db push`. +// `migrate` is like committing while `push` is for prototyping. +// Read more about both here: +// https://www.prisma.io/docs/orm/prisma-migrate datasource db { provider = "sqlite" From 17464ec481acc9efdfed394e75c4101d5b63d375 Mon Sep 17 00:00:00 2001 From: Dominic Saadi Date: Wed, 27 Dec 2023 11:49:13 -0800 Subject: [PATCH 3/3] chore: update test project --- __fixtures__/test-project/api/db/schema.prisma | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/__fixtures__/test-project/api/db/schema.prisma b/__fixtures__/test-project/api/db/schema.prisma index 9c4abd54f91f..9e5a470510e3 100644 --- a/__fixtures__/test-project/api/db/schema.prisma +++ b/__fixtures__/test-project/api/db/schema.prisma @@ -1,3 +1,9 @@ +// Don't forget to tell Prisma about your edits to this file using +// `yarn rw prisma migrate dev` or `yarn rw prisma db push`. +// `migrate` is like committing while `push` is for prototyping. +// Read more about both here: +// https://www.prisma.io/docs/orm/prisma-migrate + datasource db { provider = "sqlite" url = env("DATABASE_URL") @@ -45,4 +51,4 @@ model Contact { email String message String createdAt DateTime @default(now()) -} \ No newline at end of file +}