commit | 265c3eed2c8f150049c7bd40e30329f772f07de4 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Thu Aug 29 09:56:51 2019 -0400 |
committer | Julie Qiu <julie@golang.org> | Fri Mar 27 16:46:42 2020 -0400 |
tree | 67ae019a1583c22b1d9f661cf374caf759171a9f | |
parent | f1ecc2e9156c48b0696bbd8c22bbb5e5a6e2403f [diff] |
internal/derrors: add ToHTTPStatus Add a function that converts an error to an HTTP status code. Fixes b/140228112. Change-Id: Ib2986496ca10b2b6c1b4f32130daf81a9cbfeb89 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/537583 Reviewed-by: Julie Qiu <julieqiu@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.