Skip to content

Commit df7caae

Browse files
committed
update docs on separate setup script
1 parent 3c435bc commit df7caae

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ You need to have [Git](https://git-scm.com/), [NodeJS](https://nodejs.org/) and
4848
3. Change into the directory with `cd CatDat`.
4949
4. Install dependencies with `pnpm install`.
5050
5. Create a local `.env` file from `.env.example`.
51-
6. Create the local database with `pnpm db:update`.
52-
7. Start the local development server with `pnpm dev`.
51+
6. Create the local database with `pnpm db:setup`.
52+
7. Update the local database with `pnpm db:update`.
53+
8. Start the local development server with `pnpm dev`.
5354

5455
**For Maintainers:** Redis is required for admin features and submissions. Start a local instance on port 6379 via `redis-server --port 6379`.
5556

@@ -73,7 +74,7 @@ to continuously run this update when a file in the subfolder [/databases/catdat/
7374

7475
### Troubleshooting
7576

76-
- If the local database is corrupted, recreate it using `pnpm db:update`.
77+
- If the local database is corrupted, or its schema has changed, recreate it using `pnpm db:setup`.
7778
- If the `pnpm db:update` command fails, examine the error message to determine the cause. It could be due to malformed SQL, a contradictory property, or a failing test in the `pnpm db:test` script (which also runs as part of the update command), as explained below.
7879

7980
### Tests for Data Quality

DATABASE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ For functors there are similar tables, such as:
4444

4545
## Schema vs. Data
4646

47-
The schema defines the structure of the database: tables, views, indexes, and triggers. It is specified in several SQL files located in the subfolder [/databases/catdat/schema](/databases/catdat/schema/). The command `pnpm db:setup` deletes the old database file (if it exists) and creates a new one using this schema.
47+
The schema defines the structure of the database: tables, views, indexes, and triggers. It is specified in several SQL files located in the subfolder [/databases/catdat/schema](/databases/catdat/schema/). The command `pnpm db:setup` deletes the old database file (if it exists) and creates a new one using this schema. This is required when the schema changes, so it is recommended to run it periodically.
4848

4949
Database entries (categories, properties, implications, etc.) are defined in SQL files located in the subfolder [/databases/catdat/data](/databases/catdat/data/). The command `pnpm db:seed` replaces the current contents of the database by clearing all existing data and inserting the entries defined in these SQL files.
5050

@@ -60,7 +60,7 @@ The command `pnpm db:test` executes some tests and verifies that the data behave
6060

6161
## One command for everything
6262

63-
Use `pnpm db:update` to run all the commands in sequence: `pnpm db:setup`, `pnpm db:seed`,`pnpm db:deduce`, and `pnpm db:test`.
63+
Use `pnpm db:update` to run all the commands in sequence: `pnpm db:seed`,`pnpm db:deduce`, and `pnpm db:test`.
6464

6565
Use `pnpm db:watch` to run this command automatically every time a file in the subfolder [/databases/catdat/data](/databases/catdat/data) changes. This is useful in particular during development.
6666

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ You need to have [Git](https://git-scm.com/), [NodeJS](https://nodejs.org/) and
4444
3. Change into the directory with `cd CatDat`.
4545
4. Install dependencies with `pnpm install`.
4646
5. Create a local `.env` file from `.env.example`.
47-
6. Create the local database with `pnpm db:update`.
48-
7. Start the local development server with `pnpm dev`.
47+
6. Create the local database with `pnpm db:setup`.
48+
7. Update the local database with `pnpm db:update`.
49+
8. Start the local development server with `pnpm dev`.
4950

5051
**For Maintainers:** Redis is required for admin features and submissions. Start a local instance on port 6379 via `redis-server --port 6379`.
5152

0 commit comments

Comments
 (0)