From dc8d52a58d801f04a23e3dd3a6aa13e688314b4b Mon Sep 17 00:00:00 2001 From: Andrew J Yao <1547809+yaoandrew@users.noreply.github.com> Date: Mon, 29 Jul 2019 14:49:51 -0700 Subject: [PATCH] Removes _checked from column name query --- libraries/shared/repository/repository.go | 3 ++- libraries/shared/repository/repository_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libraries/shared/repository/repository.go b/libraries/shared/repository/repository.go index d6062898..2b7e2ce1 100644 --- a/libraries/shared/repository/repository.go +++ b/libraries/shared/repository/repository.go @@ -76,7 +76,8 @@ func GetCheckedColumnNames(db *postgres.DB) ([]string, error) { `SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'checked_headers' - AND column_name ~ '_checked';` + AND column_name <> 'id' + AND column_name <> 'header_id';` err := db.Select(&queryResult, columnNamesQuery) if err != nil { diff --git a/libraries/shared/repository/repository_test.go b/libraries/shared/repository/repository_test.go index c5b15b9c..183a940f 100644 --- a/libraries/shared/repository/repository_test.go +++ b/libraries/shared/repository/repository_test.go @@ -295,9 +295,9 @@ var _ = Describe("Repository", func() { func getExpectedColumnNames() []string { return []string{ - "column_1_checked", - "column_2_checked", - "column_3_checked", - "column_4_checked", + "column_1", + "column_2", + "column_3", + "column_4", } }