Skip to content

Commit 90c10aa

Browse files
committed
Update database scripts in package.json and enhance README instructions
- Replaced the existing database script with Docker Compose commands for better management. - Added new scripts for starting, stopping, restarting, and removing the database service. - Updated README.md to reflect changes in database service commands and added instructions for starting the database studio.
1 parent 14c7299 commit 90c10aa

File tree

3 files changed

+16
-28
lines changed

3 files changed

+16
-28
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232

3333
Use the provided example values or replace them with your own.
3434

35-
3. **Ensure Docker daemon is running and spin up the Postgres container**
35+
3. **Ensure Docker daemon is running and start the database service**
3636

3737
```sh
38-
bun db
38+
bun db:start
3939
```
4040

4141
4. **Migrate the schema to the database**
@@ -56,6 +56,12 @@
5656
bun run test # not `bun test`!
5757
```
5858

59+
7. **(Optional) Start the [database studio](https://orm.drizzle.team/drizzle-studio/overview)**
60+
```bash
61+
bun db:studio
62+
```
63+
64+
5965
## Building for production
6066

6167
> [!TIP]

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@
2020
"docs": "vitepress dev docs",
2121
"docs:build": "vitepress build docs",
2222
"docs:preview": "vitepress preview docs",
23-
"db": "./scripts/create-start-container-with-env.sh",
23+
"db": "docker compose up",
24+
"db:start": "docker compose up -d",
25+
"db:stop": "docker compose stop",
26+
"db:restart": "docker compose restart",
27+
"db:down": "docker compose down",
28+
"db:remove": "docker compose down -v",
2429
"db:generate": "drizzle-kit generate",
2530
"db:migrate": "drizzle-kit migrate",
2631
"db:push": "drizzle-kit push",
2732
"db:seed": "bun drizzle/seed.ts",
2833
"db:studio": "drizzle-kit studio",
29-
"db:reset": "bun drizzle/reset.ts"
34+
"db:reset": "bun drizzle/reset.ts",
35+
"db:config": "docker compose config"
3036
},
3137
"dependencies": {
3238
"@elysiajs/bearer": "^1.3.0",

scripts/create-start-container-with-env.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)