commit | 0159400f6a7066c4b488cb6edb77cc967da0b417 | [log] [tgz] |
---|---|---|
author | Rob Findley <rfindley@google.com> | Tue Aug 06 14:38:30 2019 -0400 |
committer | Julie Qiu <julie@golang.org> | Fri Mar 27 16:46:41 2020 -0400 |
tree | 7ced14b7a4e5853fe0d315b9c770886a33deb6d6 | |
parent | c1de446b43fdfdc0676266cb55f942bd6dd17af2 [diff] |
internal/derrors: switch to using xerrors The derrors package is reduced to a set of error values and the helper method FromHTTPStatus, by using the xerrors package. Change-Id: Ifdcec6abe7e14f127c20afa1f7e9ab1521272806 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/521329 Reviewed-by: Jonathan Amsterdam <jba@google.com>
Migrations are managed with the golang-migrate/migrate CLI tool.
To run all the migrations:
migrate -source file:migrations -database "postgres://localhost:5432/discovery-database?sslmode=disable" up
To create a new migration:
migrate create -ext sql -dir migrations -seq <title>
This creates two empty files in /migrations
:
{version}_{title}.up.sql {version}_{title}.down.sql
The two migration files are used to migrate “up” to the specified version from the previous version, and to migrate “down” to the previous version. See golang-migrate/migrate/MIGRATIONS.md for details.