From b8bb5b03f7f5d04dd2e28a7c3893303a5dcc9536 Mon Sep 17 00:00:00 2001 From: Julie Qiu Date: Wed, 27 Feb 2019 13:36:25 -0500 Subject: [PATCH] migrations: add NOT NULL constraint to versions.commit_time Change-Id: If38eb3cdfebd1ea960280830a64a61fc8db5d6f7 Reviewed-on: https://team-review.git.corp.google.com/c/424249 Reviewed-by: Channing Kimble-Brown --- migrations/000009_versions_commit_time_not_null.down.sql | 5 +++++ migrations/000009_versions_commit_time_not_null.up.sql | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 migrations/000009_versions_commit_time_not_null.down.sql create mode 100644 migrations/000009_versions_commit_time_not_null.up.sql diff --git a/migrations/000009_versions_commit_time_not_null.down.sql b/migrations/000009_versions_commit_time_not_null.down.sql new file mode 100644 index 00000000..d11effc9 --- /dev/null +++ b/migrations/000009_versions_commit_time_not_null.down.sql @@ -0,0 +1,5 @@ +-- Copyright 2009 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. + +ALTER TABLE versions ALTER COLUMN commit_time DROP NOT NULL; diff --git a/migrations/000009_versions_commit_time_not_null.up.sql b/migrations/000009_versions_commit_time_not_null.up.sql new file mode 100644 index 00000000..c9acb5b8 --- /dev/null +++ b/migrations/000009_versions_commit_time_not_null.up.sql @@ -0,0 +1,5 @@ +-- Copyright 2009 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. + +ALTER TABLE versions ALTER COLUMN commit_time SET NOT NULL;