Skip to content

Commit

Permalink
Merge pull request golang-migrate#817 from dschaller/patch-1
Browse files Browse the repository at this point in the history
docs: minor updates to getting started docs
  • Loading branch information
dhui authored Oct 19, 2022
2 parents 865751e + d5be909 commit 4ca6c06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting started
Before you start, you should understand the concept of forward/up and reverse/down database migrations.

Configure a database for your application. Make sure that your database driver is supported [here](README.md#databases)
Configure a database for your application. Make sure that your database driver is supported [here](README.md#databases).

## Create migrations
Create some migrations using migrate CLI. Here is an example:
Expand All @@ -10,7 +10,7 @@ migrate create -ext sql -dir db/migrations -seq create_users_table
```
Once you create your files, you should fill them.

**IMPORTANT:** In a project developed by more than one person there is a chance of migrations inconsistency - e.g. two developers can create conflicting migrations, and the developer that created his migration later gets it merged to the repository first.
**IMPORTANT:** In a project developed by more than one person there is a chance of migrations inconsistency - e.g. two developers can create conflicting migrations, and the developer that created their migration later gets it merged to the repository first.
Developers and Teams should keep an eye on such cases (especially during code review).
[Here](https://github.com/golang-migrate/migrate/issues/179#issuecomment-475821264) is the issue summary if you would like to read more.

Expand All @@ -30,7 +30,7 @@ Just add the code to your app and you're ready to go!

Before commiting your migrations you should run your migrations up, down, and then up again to see if migrations are working properly both ways.
(e.g. if you created a table in a migration but reverse migration did not delete it, you will encounter an error when running the forward migration again)
It's also worth checking your migrations in a separate, containerized environment. You can find some tools in the end of this document.
It's also worth checking your migrations in a separate, containerized environment. You can find some tools at the [end of this document](#further-reading).

**IMPORTANT:** If you would like to run multiple instances of your app on different machines be sure to use a database that supports locking when running migrations. Otherwise you may encounter issues.

Expand Down

0 comments on commit 4ca6c06

Please sign in to comment.