migrations: add package_symbols_package_path_id_module_path_id_section_synopsis_key

A unique constraint is added to
package_symbols(package_path_id, module_path_id, section, synopsis),
since a given combination should never appear more than once.

For golang/go#37102

Change-Id: I1ba751cd014a3e190eeacb3891650d5001793add
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/295269
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
Julie Qiu 2021-02-22 19:13:09 -05:00
Родитель a45850f691
Коммит ad2db3f45c
2 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,9 @@
-- Copyright 2021 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
DROP INDEX package_symbols_package_path_id_module_path_id_section_synopsis_key;
END;

Просмотреть файл

@ -0,0 +1,10 @@
-- Copyright 2021 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
CREATE UNIQUE INDEX package_symbols_package_path_id_module_path_id_section_synopsis_key
ON package_symbols(package_path_id, module_path_id, section, synopsis);
END;