diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-09-18 08:07:31 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-09-18 08:07:31 -0400 |
commit | 432753bb4de04a66a15027356017fdb1dcc626fa (patch) | |
tree | 57f9a93f90a3cda72ba5389b1d2a0723e40016d5 | |
parent | c717fcb325b46438a438c4d0e0a7864ad742a036 (diff) | |
download | chat-432753bb4de04a66a15027356017fdb1dcc626fa.tar.gz chat-432753bb4de04a66a15027356017fdb1dcc626fa.tar.bz2 chat-432753bb4de04a66a15027356017fdb1dcc626fa.zip |
Return false when checking if column exists, if the table does not exist with postgres.
-rw-r--r-- | store/sql_store.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/store/sql_store.go b/store/sql_store.go index c0b3c2021..cf6fae6d4 100644 --- a/store/sql_store.go +++ b/store/sql_store.go @@ -144,6 +144,10 @@ func (ss SqlStore) DoesColumnExist(tableName string, columnName string) bool { ) if err != nil { + if err.Error() == "pq: relation \""+strings.ToLower(tableName)+"\" does not exist" { + return false + } + l4g.Critical("Failed to check if column exists %v", err) time.Sleep(time.Second) panic("Failed to check if column exists " + err.Error()) |