Skip to content

Commit 928b2f6

Browse files
committed
docs: update workflow documentation for psql and and docker compose commands
1 parent c34402a commit 928b2f6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

project/docs/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ The database migrations are managed using [aerich](https://github.com/tortoise/a
109109
To set up the initial config file and generate the root migrate location:
110110

111111
```bash
112-
$ docker exec <service-name> aerich init -t app.db.TORTOISE_ORM
112+
$ docker compose exec <service-name> aerich init -t app.db.TORTOISE_ORM
113113
```
114114

115115
The `-t` flag specifies the module path to the Tortoise-ORM settings inside the `app.db` module. This will add a `tool.aerich` section to the `pyproject.toml` file.
@@ -119,7 +119,7 @@ The `-t` flag specifies the module path to the Tortoise-ORM settings inside the
119119
To initialize the database:
120120

121121
```bash
122-
$ docker exec <service-name> aerich init-db
122+
$ docker compose exec <service-name> aerich init-db
123123
```
124124

125125
This will create the tables in the database based on the models defined in `app/models/` along with the first migration file in the `migrations/` directory.
@@ -131,13 +131,13 @@ From this point on, since the local `migrations/` directory is synced with the `
131131
1. In development mode, update the model in `app/models/` and run the following command to generate a new migration:
132132

133133
```bash
134-
$ docker exec <service-name> aerich migrate --name <migration-name>
134+
$ docker compose exec <service-name> aerich migrate --name <migration-name>
135135
```
136136

137137
2. Apply the migration in development mode:
138138

139139
```bash
140-
$ docker exec <service-name> aerich upgrade
140+
$ docker compose exec <service-name> aerich upgrade
141141
```
142142

143143
3. Run tests and any other necessary checks.
@@ -156,10 +156,10 @@ See the aerich's [usage](https://github.com/tortoise/aerich?tab=readme-ov-file#u
156156

157157
## PSQL
158158

159-
The PostgreSQL database can be accessed using [psql](https://www.postgresql.org/docs/current/app-psql.html), a terminal-based front-end to PostgreSQL.
159+
The PostgreSQL database within the docker container can be accessed using [psql](https://www.postgresql.org/docs/current/app-psql.html), a terminal-based front-end to PostgreSQL.
160160

161161
```bash
162-
$ docker exec -it <service-name> psql -U postgres
162+
$ docker compose exec -it <service-name> psql -U <username>
163163
```
164164

165165
### Connect

0 commit comments

Comments
 (0)