commit | 322d16763ea8858460c2c10eafdbfa8a5454980c | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Thu Dec 19 08:17:14 2019 -0500 |
committer | Julie Qiu <julie@golang.org> | Fri Mar 27 16:46:49 2020 -0400 |
tree | b3fc6ad757acd2abd9f586899daa4ef69a3f68ef | |
parent | 2a55d5a707cf4b54308c71e9b7c0af78a59f3121 [diff] |
all: remove xerrors Now that we are on Go 1.13, we can use the errors package and remove xerrors. Change-Id: I8b30bcea97da25cc92b8e250299a68417a85143d Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/623768 CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com> 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.