Skip to content

Commit

Permalink
chore: update DB migrations documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
flea89 authored Feb 25, 2022
1 parent 060b0a5 commit 57df784
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ If you'd like to also clear the database and all docker artifacts you can run
npm run stop:clean
```

### 4. Alter DB schema
### 4. Alter DB schema and migrations

1. Add the schema changes to `db/postgres` sql files as needed.

Expand All @@ -87,6 +87,13 @@ npm run stop:clean

5. If the schema changes include creating a new table, type or view update `reset.sql` as well.

6. Add the required migration script(s) to [postgres/migrations](./postgres/migrations/) folder. Please follow the naming convention and add an incremental number prefix to the name of the migration file.

7. Once the PR is merged to main please add a comment to the [release-please](https://github.com/googleapis/release-please) PR pointing to the migrations script.
ie
> Required migration [000-fix-peer_location.peer_id.sql](./postgres/migrations/000-fix-peer_location.peer_id.sql)


## DB package CLI
The `scripts/cli.js` to run some common operations on the database.

Expand Down

0 comments on commit 57df784

Please sign in to comment.