Skip to content

Commit c59598d

Browse files
committed
migrations: add latest_module_versions table
For golang/go#44710 Change-Id: Ifc590cdb4abd68a3d0210c8d5f9248154fbfd19a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297689 Trust: Jonathan Amsterdam <[email protected]> Run-TryBot: Jonathan Amsterdam <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]>
1 parent 5c56ea4 commit c59598d

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- Copyright 2021 The Go Authors. All rights reserved.
2+
-- Use of this source code is governed by a BSD-style
3+
-- license that can be found in the LICENSE file.
4+
5+
BEGIN;
6+
7+
DROP TABLE latest_module_versions;
8+
9+
END;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
-- Copyright 2021 The Go Authors. All rights reserved.
2+
-- Use of this source code is governed by a BSD-style
3+
-- license that can be found in the LICENSE file.
4+
5+
BEGIN;
6+
7+
CREATE TABLE latest_module_versions (
8+
module_path_id INTEGER NOT NULL PRIMARY KEY,
9+
raw_version TEXT NOT NULL,
10+
cooked_version TEXT NOT NULL,
11+
good_version TEXT NOT NULL,
12+
raw_go_mod_bytes BYTEA NOT NULL,
13+
14+
FOREIGN KEY (module_path_id) REFERENCES paths(id) ON DELETE CASCADE
15+
);
16+
17+
COMMENT ON TABLE latest_module_versions IS
18+
'TABLE latest_module_versions holds the latest versions of a module.';
19+
20+
COMMENT ON COLUMN latest_module_versions.raw_version IS
21+
'COLUMN raw_version is the latest version of the module, ignoring retractions.';
22+
23+
COMMENT ON COLUMN latest_module_versions.cooked_version IS
24+
'COLUMN cooked_version is the latest unretracted version of the module.';
25+
26+
COMMENT ON COLUMN latest_module_versions.good_version IS
27+
'COLUMN good_version is the latest version of the module with a 2xx status.';
28+
29+
COMMENT ON COLUMN latest_module_versions.raw_go_mod_bytes IS
30+
'COLUMN raw_go_mod_bytes is the contents of the go.mod file for the given module and raw version.';
31+
32+
END;

0 commit comments

Comments
 (0)