From 73c6c0adb155fe5965a4ae0b07cb5ba0710bf4b1 Mon Sep 17 00:00:00 2001 From: Taimoor Dawami Date: Thu, 20 Oct 2022 13:08:49 -0400 Subject: [PATCH 1/4] Fixes #3692 by adding database info to file Update docs based on feedback --- .../docs/getting-started/environment-setup.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/web/docusaurus/docs/getting-started/environment-setup.md b/src/web/docusaurus/docs/getting-started/environment-setup.md index 0ffd0d045d..c5c26927a8 100644 --- a/src/web/docusaurus/docs/getting-started/environment-setup.md +++ b/src/web/docusaurus/docs/getting-started/environment-setup.md @@ -240,6 +240,24 @@ Docker builds Telescope's dependencies at launch and keeps them on disk. In some ::: +### Seeding PostgresSQL + +The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data. + +To seed the database with initial data use the command `pnpm db:init` which will run `db:migrate` and `db:seed`. + +#### About `db:migrate` + +Running `db:migrate` , will run a migration to apply new changes to the database if any. + +#### About `db:seed` + +Running this command will populate the database with an initial set of data to make some parts of our application work properly. + +Finally, restart the `parser` container by running `pnpm:services start parser`/ + +More information on our database can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). + ### Start Telescope There are different ways to run the application. By default, [env.development](https://github.com/Seneca-CDOT/telescope/blob/master/config/env.development) will be used. Please read the use cases below to find out what configuration you need to make for different scenarios. From 6f0d433bdea8e349e40c76378bf50e2dba819f98 Mon Sep 17 00:00:00 2001 From: Taimoor Dawami Date: Wed, 26 Oct 2022 16:14:54 -0400 Subject: [PATCH 2/4] Update file with correct steps --- .../docs/getting-started/environment-setup.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/web/docusaurus/docs/getting-started/environment-setup.md b/src/web/docusaurus/docs/getting-started/environment-setup.md index c5c26927a8..f97cc89d6c 100644 --- a/src/web/docusaurus/docs/getting-started/environment-setup.md +++ b/src/web/docusaurus/docs/getting-started/environment-setup.md @@ -242,6 +242,7 @@ Docker builds Telescope's dependencies at launch and keeps them on disk. In some ### Seeding PostgresSQL +<<<<<<< HEAD The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data. To seed the database with initial data use the command `pnpm db:init` which will run `db:migrate` and `db:seed`. @@ -256,7 +257,15 @@ Running this command will populate the database with an initial set of data to m Finally, restart the `parser` container by running `pnpm:services start parser`/ -More information on our database can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). +# More information on our database can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). + +The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data to make some parts of our application work properly. + +To seed the database with initial data use the command `pnpm seed`. + +More information can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). + +> > > > > > > 4debcaf1 (Fixes #3692 by adding database info to file) ### Start Telescope From 0fe78171096dbd23cb5d4bc9bea440bc8c9a7ea5 Mon Sep 17 00:00:00 2001 From: Taimoor Dawami Date: Wed, 26 Oct 2022 16:17:27 -0400 Subject: [PATCH 3/4] Update wit correct steps to seed db --- .../docs/getting-started/environment-setup.md | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/web/docusaurus/docs/getting-started/environment-setup.md b/src/web/docusaurus/docs/getting-started/environment-setup.md index f97cc89d6c..e0869e16a3 100644 --- a/src/web/docusaurus/docs/getting-started/environment-setup.md +++ b/src/web/docusaurus/docs/getting-started/environment-setup.md @@ -242,6 +242,7 @@ Docker builds Telescope's dependencies at launch and keeps them on disk. In some ### Seeding PostgresSQL +<<<<<<< HEAD <<<<<<< HEAD The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data. @@ -259,11 +260,25 @@ Finally, restart the `parser` container by running `pnpm:services start parser`/ # More information on our database can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). -The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data to make some parts of our application work properly. +# The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data to make some parts of our application work properly. + +The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data. + +> > > > > > > 16986fb4 (Update docs based on feedback) + +To seed the database with initial data use the command `pnpm db:init` which will run `db:migrate` and `db:seed`. + +#### About `db:migrate` -To seed the database with initial data use the command `pnpm seed`. +Running `db:migrate` , will run a migration to apply new changes to the database if any. + +#### About `db:seed` + +Running this command will populate the database with an initial set of data to make some parts of our application work properly. + +Finally, restart the `parser` container by running `pnpm:services start parser`/ -More information can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). +More information on our database can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). > > > > > > > 4debcaf1 (Fixes #3692 by adding database info to file) From 4c9d96ddad67947339fa36714536509e471a27b4 Mon Sep 17 00:00:00 2001 From: Taimoor Dawami Date: Wed, 26 Oct 2022 16:45:28 -0400 Subject: [PATCH 4/4] Update with correct steps to seed DB --- .../docs/getting-started/environment-setup.md | 60 ++++++------------- 1 file changed, 18 insertions(+), 42 deletions(-) diff --git a/src/web/docusaurus/docs/getting-started/environment-setup.md b/src/web/docusaurus/docs/getting-started/environment-setup.md index e0869e16a3..bda4fc49dc 100644 --- a/src/web/docusaurus/docs/getting-started/environment-setup.md +++ b/src/web/docusaurus/docs/getting-started/environment-setup.md @@ -240,48 +240,6 @@ Docker builds Telescope's dependencies at launch and keeps them on disk. In some ::: -### Seeding PostgresSQL - -<<<<<<< HEAD -<<<<<<< HEAD -The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data. - -To seed the database with initial data use the command `pnpm db:init` which will run `db:migrate` and `db:seed`. - -#### About `db:migrate` - -Running `db:migrate` , will run a migration to apply new changes to the database if any. - -#### About `db:seed` - -Running this command will populate the database with an initial set of data to make some parts of our application work properly. - -Finally, restart the `parser` container by running `pnpm:services start parser`/ - -# More information on our database can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). - -# The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data to make some parts of our application work properly. - -The first time you start the database, it doesn't have any data. Therefore, we need database seeding as a way to populate the database with an initial set of data. - -> > > > > > > 16986fb4 (Update docs based on feedback) - -To seed the database with initial data use the command `pnpm db:init` which will run `db:migrate` and `db:seed`. - -#### About `db:migrate` - -Running `db:migrate` , will run a migration to apply new changes to the database if any. - -#### About `db:seed` - -Running this command will populate the database with an initial set of data to make some parts of our application work properly. - -Finally, restart the `parser` container by running `pnpm:services start parser`/ - -More information on our database can be found [here](https://telescope.cdot.systems/docs/tools-and-technologies/prisma/). - -> > > > > > > 4debcaf1 (Fixes #3692 by adding database info to file) - ### Start Telescope There are different ways to run the application. By default, [env.development](https://github.com/Seneca-CDOT/telescope/blob/master/config/env.development) will be used. Please read the use cases below to find out what configuration you need to make for different scenarios. @@ -316,6 +274,24 @@ For more information about the services, please read [Telescope API Services](.. If this doesn't work for you, it is possible that you have an old `.env` file in the root that you copied from `env.example` from telescope 1.0. Please remove it, and try again. +##### Seeding the database + +Run `cp ./src/db/env.example .env` from the `root` directory to copy database url and store it an `.env` file. + +Run the `pnpm db:init` script as it will populate the database with an initial set of data to make some parts of our application work properly. + +:::note +`pnpm db:init` script will run `db:migrate` and `db:seed`. + +`db:migrate` is responsible to run a migration to apply new changes to the database if any. + +`db:seed` is responsible to populate the database with an initial set of data. +::: + +Stop the `parser` service running. If you have Docker app installed locally make sure to stop the `parser` container before continuing to the next step. + +Finally, restart the `parser` container by running `pnpm:services start parser`. + #### Option 2: Run frontend only ```bash