migrations: split 000144 into multiple migrations

Migration 000144 ran on exp/dev/staging, but caused issues on prod. This
migration is split into multiple migrations so that it can be run in
pieces.

For golang/go#44142

Change-Id: I153b84d0b5f36b24ad4013f9c6f5f69bbc4f8ea6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345449
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/migrations/000144_add_not_null_constraints.down.sql b/migrations/000144_add_not_null_constraints.down.sql
index 23a6fe5..9185c7e 100644
--- a/migrations/000144_add_not_null_constraints.down.sql
+++ b/migrations/000144_add_not_null_constraints.down.sql
@@ -4,16 +4,6 @@
 
 BEGIN;
 
-ALTER TABLE search_documents ALTER COLUMN tsv_path_tokens DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN created_at DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN updated_at DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN updated_at DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN goos DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN goarch DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN goarch DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN package_name DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN package_path DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_name DROP NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_path DROP NOT NULL;
+-- DO NOTHING: this migration is split into 000145-000150.
 
 END;
diff --git a/migrations/000144_add_not_null_constraints.up.sql b/migrations/000144_add_not_null_constraints.up.sql
index f812a4e..9185c7e 100644
--- a/migrations/000144_add_not_null_constraints.up.sql
+++ b/migrations/000144_add_not_null_constraints.up.sql
@@ -4,16 +4,6 @@
 
 BEGIN;
 
-ALTER TABLE search_documents ALTER COLUMN tsv_path_tokens SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN created_at SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN updated_at SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN updated_at SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN goos SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN goarch SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN goarch SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN package_name SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN package_path SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_name SET NOT NULL;
-ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_path SET NOT NULL;
+-- DO NOTHING: this migration is split into 000145-000150.
 
 END;
diff --git a/migrations/000145_not_null_search_documents.down.sql b/migrations/000145_not_null_search_documents.down.sql
new file mode 100644
index 0000000..06d5148
--- /dev/null
+++ b/migrations/000145_not_null_search_documents.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;
+
+ALTER TABLE search_documents ALTER COLUMN tsv_path_tokens DROP NOT NULL;
+
+END;
diff --git a/migrations/000145_not_null_search_documents.up.sql b/migrations/000145_not_null_search_documents.up.sql
new file mode 100644
index 0000000..e3efcf9
--- /dev/null
+++ b/migrations/000145_not_null_search_documents.up.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;
+
+ALTER TABLE search_documents ALTER COLUMN tsv_path_tokens SET NOT NULL;
+
+END;
diff --git a/migrations/000146_not_null_symbol_search_document_goos_goarch.down.sql b/migrations/000146_not_null_symbol_search_document_goos_goarch.down.sql
new file mode 100644
index 0000000..2f7f102
--- /dev/null
+++ b/migrations/000146_not_null_symbol_search_document_goos_goarch.down.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN goos DROP NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN goarch DROP NOT NULL;
+
+END;
diff --git a/migrations/000146_not_null_symbol_search_document_goos_goarch.up.sql b/migrations/000146_not_null_symbol_search_document_goos_goarch.up.sql
new file mode 100644
index 0000000..4d254ef
--- /dev/null
+++ b/migrations/000146_not_null_symbol_search_document_goos_goarch.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN goos SET NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN goarch SET NOT NULL;
+
+END;
diff --git a/migrations/000147_not_null_symbol_search_document_updated_at_created_at.down.sql b/migrations/000147_not_null_symbol_search_document_updated_at_created_at.down.sql
new file mode 100644
index 0000000..7a00616
--- /dev/null
+++ b/migrations/000147_not_null_symbol_search_document_updated_at_created_at.down.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN created_at DROP NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN updated_at DROP NOT NULL;
+
+END;
diff --git a/migrations/000147_not_null_symbol_search_document_updated_at_created_at.up.sql b/migrations/000147_not_null_symbol_search_document_updated_at_created_at.up.sql
new file mode 100644
index 0000000..bd84b1e
--- /dev/null
+++ b/migrations/000147_not_null_symbol_search_document_updated_at_created_at.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN created_at SET NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN updated_at SET NOT NULL;
+
+END;
diff --git a/migrations/000148_not_null_symbol_search_document_package_path.down.sql b/migrations/000148_not_null_symbol_search_document_package_path.down.sql
new file mode 100644
index 0000000..7fc9104
--- /dev/null
+++ b/migrations/000148_not_null_symbol_search_document_package_path.down.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN package_path DROP NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_path DROP NOT NULL;
+
+END;
diff --git a/migrations/000148_not_null_symbol_search_document_package_path.up.sql b/migrations/000148_not_null_symbol_search_document_package_path.up.sql
new file mode 100644
index 0000000..e600bda
--- /dev/null
+++ b/migrations/000148_not_null_symbol_search_document_package_path.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN package_path SET NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_path SET NOT NULL;
+
+END;
diff --git a/migrations/000149_not_null_symbol_search_document_package_name.down.sql b/migrations/000149_not_null_symbol_search_document_package_name.down.sql
new file mode 100644
index 0000000..21795c4
--- /dev/null
+++ b/migrations/000149_not_null_symbol_search_document_package_name.down.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN package_name DROP NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_name DROP NOT NULL;
+
+END;
diff --git a/migrations/000149_not_null_symbol_search_document_package_name.up.sql b/migrations/000149_not_null_symbol_search_document_package_name.up.sql
new file mode 100644
index 0000000..474212f
--- /dev/null
+++ b/migrations/000149_not_null_symbol_search_document_package_name.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;
+
+ALTER TABLE symbol_search_documents ALTER COLUMN package_name SET NOT NULL;
+ALTER TABLE symbol_search_documents ALTER COLUMN uuid_package_name SET NOT NULL;
+
+END;