Scheduling infrastructure for absolutely everyone.
Docs/prisma commands on docs (#1875)
Miguel Nieto Ae36428de5d9c
diff --git a/README.md b/README.mdindex 45723a9fe40..925b32a38ff 100644--- a/README.md+++ b/README.md@@ -164,7 +164,7 @@ yarn dx1. Set up the database using the Prisma schema (found in `apps/web/prisma/schema.prisma`)```sh- yarn workspace @calcom/web prisma migrate deploy+ yarn workspace @calcom/prisma db-deploy```1. Run (in development mode)@@ -211,7 +211,7 @@ yarn workspace @calcom/web playwright-reportIn a development environment, run:```sh- yarn workspace @calcom/web prisma migrate dev+ yarn workspace @calcom/prisma db-migrate```(this can clear your development database in some cases)@@ -219,7 +219,7 @@ yarn workspace @calcom/web playwright-reportIn a production environment, run:```sh- yarn workspace @calcom/web prisma migrate deploy+ yarn workspace @calcom/prisma db-deploy```3. Check the `.env.example` and compare it to your current `.env` file. In case there are any fields not presentdiff --git a/apps/docs/pages/developer/migrations.mdx b/apps/docs/pages/developer/migrations.mdxindex 04d1de9d2a0..f4dde2a31b2 100644--- a/apps/docs/pages/developer/migrations.mdx+++ b/apps/docs/pages/developer/migrations.mdx@@ -1,5 +1,5 @@# Database Migrations-As described in the [upgrade guide](https://docs.cal.com/self-hosting/upgrading.md), you should use the `npx prisma migrate dev` or `npx prisma migrate deploy` command to update the database.+As described in the [upgrade guide](https://docs.cal.com/self-hosting/upgrade), you should use the `yarn workspace @calcom/prisma db-migrate` or `yarn workspace @calcom/prisma db-deploy` command to update the database.We use database migrations in order to handle changes to the database schema in a more secure and stable way. This is actually very common. The thing is that when just changing the schema in `schema.prisma` without creating migrations, the update to the newer database schema can damage or delete all data in production mode, since the system sometimes doesn't know how to transform the data from A to B. Using migrations, each step is reproducable, transparent and can be undone in a simple way.@@ -7,8 +7,8 @@ We use database migrations in order to handle changes to the database schema inIf you are modifying the codebase and make a change to the `schema.prisma` file, you must create a migration.To create a migration for your previously changed `schema.prisma`, simply run the following:-```-npx prisma migrate dev+```sh+yarn workspace @calcom/prisma db-migrate```Now, you must create a short name for your migration to describe what changed (for example, "user_add_email_verified"). Then just add and commit it with the corresponding code that uses your new database schema.@@ -21,7 +21,7 @@ Always keep an eye on what migrations Prisma is generating. Prisma often happily## Error: The database schema is not emptyPrisma uses a database called `_prisma_migrations` to keep track of which migrations have been applied and which haven't. If your local migrations database doesn't match up with what's in the actual database, then Prisma will throw the following error:-```+```textError: P3005The database schema for `localhost:5432` is not empty. Read more about how to baseline an existing production database: https://pris.ly/d/migrate-baseline@@ -30,8 +30,8 @@ The database schema for `localhost:5432` is not empty. Read more about how to baIn order to fix this, we need to tell Prisma which migrations have already been applied.This can be done by running the following command, replacing `migration_name` with each migration that you have already applied:-```-npx prisma migrate resolve --applied migration_name+```sh+yarn prisma migrate resolve --applied migration_name```-You will need to run the command for each migration that you want to mark as applied.\ No newline at end of file+You will need to run the command for each migration that you want to mark as applied.diff --git a/apps/docs/pages/self-hosting/docker.mdx b/apps/docs/pages/self-hosting/docker.mdxindex da71e384768..bb8668e4331 100644--- a/apps/docs/pages/self-hosting/docker.mdx+++ b/apps/docs/pages/self-hosting/docker.mdx@@ -15,7 +15,7 @@ Make sure you have `docker` & `docker-compose` installed on the server / system.```bashdocker pull calendso/calendso```-+or### Option #2: Cloning@@ -30,12 +30,12 @@ or3. Build and start calendso- ```+ ```bashdocker-compose up --build```4. Start prisma studio- ```+ ```bashdocker-compose exec calendso -- npx prisma studio```5. Open a browser to [port 5555](http://localhost:5555) on your localhost to look at or modify the database content.diff --git a/apps/docs/pages/self-hosting/install.mdx b/apps/docs/pages/self-hosting/install.mdxindex da881b65a60..029bfb2fbb0 100644--- a/apps/docs/pages/self-hosting/install.mdx+++ b/apps/docs/pages/self-hosting/install.mdx@@ -102,7 +102,7 @@ yarn dx1. Set up the database using the Prisma schema (found in `packages/prisma/schema.prisma`)```sh- npx prisma migrate deploy+ yarn workspace @calcom/prisma db-deploy```1. Run (in development mode)diff --git a/apps/docs/pages/self-hosting/upgrade.mdx b/apps/docs/pages/self-hosting/upgrade.mdxindex 2db0ff7f767..edab1026165 100644--- a/apps/docs/pages/self-hosting/upgrade.mdx+++ b/apps/docs/pages/self-hosting/upgrade.mdx@@ -3,23 +3,23 @@**Warning**: When performing database migrations, you may lose data if the migration is not done properly.1. Pull the current version:- ```+ ```shgit pull```2. Apply database migrations by running <b>one of</b> the following commands:In a development environment, run:- ```- npx prisma migrate dev+ ```sh+ yarn workspace @calcom/prisma db-migrate```(this can clear your development database in some cases)In a production environment, run:- ```- npx prisma migrate deploy+ ```sh+ yarn workspace @calcom/prisma db-deploy```3. Check the `.env.example` and compare it to your current `.env` file. In case there are any fields not present@@ -27,17 +27,17 @@For the current version, especially check if the variable `BASE_URL` is present and properly set in your environment, for example:- ```+ ```textBASE_URL='https://yourdomain.com'```4. Start the server. In a development environment, just do:- ```+ ```shyarn dev```For a production build, run for example:- ```+ ```shyarn buildyarn start```-5. Enjoy the new version.\ No newline at end of file+5. Enjoy the new version.diff --git a/apps/docs/pages/self-hosting/vercel.mdx b/apps/docs/pages/self-hosting/vercel.mdxindex b92daf79c4c..68d12d04cac 100644--- a/apps/docs/pages/self-hosting/vercel.mdx+++ b/apps/docs/pages/self-hosting/vercel.mdx@@ -22,10 +22,10 @@ You need a PostgresDB database hosted somewhere. [Heroku](https://www.heroku.comyarn install```-4. Set up the database using the Prisma schema (found in `prisma/schema.prisma`)+4. Set up the database using the Prisma schema (found in `packages/prisma/schema.prisma`)```sh- npx prisma migrate deploy+ yarn workspace @calcom/prisma db-deploy```5. Open [Prisma Studio](https://www.prisma.io/studio) to look at or modify the database content: