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>
diff --git a/migrations/000069_add_unique_index_package_symbols.down.sql b/migrations/000069_add_unique_index_package_symbols.down.sql
new file mode 100644
index 0000000..0413289
--- /dev/null
+++ b/migrations/000069_add_unique_index_package_symbols.down.sql
@@ -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;
diff --git a/migrations/000069_add_unique_index_package_symbols.up.sql b/migrations/000069_add_unique_index_package_symbols.up.sql
new file mode 100644
index 0000000..6a06ff8
--- /dev/null
+++ b/migrations/000069_add_unique_index_package_symbols.up.sql
@@ -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;