migrations: drop module_version_states.index_timestamp not null

When a module is requested for the first time through frontend fetch,
the index_timestamp should be null, since the module has never appeared
in the index before.

Drop the not null constraint on module_version_states.index_timestamp to
make this possible.

For golang/go#46985

Change-Id: I7f08c35307aec485fb212e490031e809971c9341
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341891
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/000140_drop_module_version_states_index_timestamp_not_null.down.sql b/migrations/000140_drop_module_version_states_index_timestamp_not_null.down.sql
new file mode 100644
index 0000000..20f52c3
--- /dev/null
+++ b/migrations/000140_drop_module_version_states_index_timestamp_not_null.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 module_version_states ALTER COLUMN index_timestamp SET NOT NULL;
+
+END;
diff --git a/migrations/000140_drop_module_version_states_index_timestamp_not_null.up.sql b/migrations/000140_drop_module_version_states_index_timestamp_not_null.up.sql
new file mode 100644
index 0000000..54f33a5
--- /dev/null
+++ b/migrations/000140_drop_module_version_states_index_timestamp_not_null.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 module_version_states ALTER COLUMN index_timestamp DROP NOT NULL;
+
+END;