commit | ff7588dc0c91d9c7d6c27d22f6d86020137d1035 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Sun Dec 15 08:37:29 2019 -0500 |
committer | Julie Qiu <julie@golang.org> | Fri Mar 27 16:46:49 2020 -0400 |
tree | 1684e3d8300852236bc2a3903f40dbe979fd75c8 | |
parent | 7938acbadb9baeb3b2ad9b4d03e8de087e0d60ec [diff] |
all: use golang.org/x/mod Use the semver and module packages from golang.org/x/mod. Remove them from internal/thirdparty. We also rename Encode{Version,Path} to Escape{Version,Path} because golang.org/x/module does that. Fixes b/133841935. Change-Id: I0e52c6dd7109fbd488a030c750cdc06736356868 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/619244 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.