Skip to content

Commit bda006f

Browse files
committed
migrations: change licenses PK to (module_id, file_path)
The primary key for licenses is changed to (module_id, file_path). The licenses.module_path and licenses.version columns will be dropped in a future CL. For golang/go#39629 Change-Id: I3ae8f7c582013a897152bdf5926f6a9287136c5e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/265019 Trust: Julie Qiu <[email protected]> Run-TryBot: Julie Qiu <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> TryBot-Result: kokoro <[email protected]>
1 parent 807ebae commit bda006f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- Copyright 2020 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 INDEX idx_licenses_module_id ON licenses (module_id);
8+
ALTER TABLE licenses DROP CONSTRAINT licenses_pkey;
9+
ALTER TABLE licenses ADD PRIMARY KEY (module_path, version, file_path);
10+
11+
END;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- Copyright 2020 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+
ALTER TABLE licenses DROP CONSTRAINT licenses_pkey;
8+
ALTER TABLE licenses ADD PRIMARY KEY (module_id, file_path);
9+
DROP INDEX idx_licenses_module_id;
10+
11+
END;

0 commit comments

Comments
 (0)