commit | 86b786dc79ef59bd1f95c0e456d040eee5e713d1 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Tue Feb 18 13:30:53 2020 -0500 |
committer | Julie Qiu <julie@golang.org> | Mon Apr 06 15:50:51 2020 -0400 |
tree | e12afde2c7cb1b5239738e782e6f4934de9373ee | |
parent | 147b8891c6ae64f83314ee35fd9672dd349b84d3 [diff] |
internal/fetch: better handling of malformed zips A zip may not come from "go mod download", and so it can be malformed in various ways. These are not our fault, so we shouldn't 500 on them. - Has a directory entry: harmless, so we ignore it. - Files outside of module@version directory: maybe harmless, but definitely wrong; give it the BadModule code. Fixes b/149737359. Change-Id: I54c5d3a7e3c3fb45c4a68917bf0c75984e6e0357 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/669531 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.