Skip to content

Commit

Permalink
chore(backend): standardise migration file names
Browse files Browse the repository at this point in the history
closes #921
  • Loading branch information
anupcowkur committed Jul 17, 2024
1 parent 449ee38 commit c085224
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions self-host/postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ Schema migrations for postgres instances are managed using [dbmate](https://gith
- Migrations **MUST** contain both `up` & `down` migrations
- **NEVER** edit the generated `schema.sql` file manually
- Follow this naming convention for naming migration files
- Syntax: `<sql-command>-<entity-name>-<entity-type>`
- Syntax: `<sql-command>_<entity-name>_<entity-type>`
- `<sql-command>` should be `create` or `alter` etc sql commands
- `<entity-name>` should be name of the relation or role or function or trigger etc
- `<entity-type>` should be name of the sql entity type, like `relation`(or `table`), `function`, `role`, `index`, `trigger`
- `<entity-type>` should be name of the sql entity type, like `table`, `function`, `role`, `index`, `trigger`
- Examples:
- `dbmate new create-sessions-relation`
- `dbmate new create-sessions_attachments-relation`
- `dbmate new create-create_team-function`
- `dbmate new create-create_team_for_user-trigger`
- `dbmate new alter-teams-relation` - add a new column
- `dbmate new create_sessions_table`
- `dbmate new create_sessions_attachments_table`
- `dbmate new create_create_team_function`
- `dbmate new create_create_team_for_user_trigger`
- `dbmate new alter_teams_relation` - add a new column
- When authoring migrations, always prefix the schema name in your objects

## Deleting old migrations
Expand Down

0 comments on commit c085224

Please sign in to comment.