diff --git a/api/sql/dump.sql b/api/sql/dump.sql index 9dcdf1f..3469156 100644 --- a/api/sql/dump.sql +++ b/api/sql/dump.sql @@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS pipelines ( params JSONB NOT NULL, user_id INTEGER NOT NULL, enabled BOOLEAN NOT NULL, - error TEXT NOT NULL, + error TEXT, trigger_count INTEGER NOT NULL, last_trigger TIMESTAMP, CONSTRAINT fk_user diff --git a/api/src/Db/Pipeline.hs b/api/src/Db/Pipeline.hs index 44129e6..cac8dcd 100644 --- a/api/src/Db/Pipeline.hs +++ b/api/src/Db/Pipeline.hs @@ -39,7 +39,7 @@ data Pipeline f = Pipeline , pipelineParams :: Column f PipelineParams , pipelineUserId :: Column f UserId , pipelineEnabled :: Column f Bool - , pipelineError :: Column f Text + , pipelineError :: Column f (Maybe Text) , pipelineTriggerCount :: Column f Int64 , pipelineLastTrigger :: Column f (Maybe UTCTime) } @@ -98,7 +98,7 @@ insertPipeline (Pipeline _ name type' params uid _ _ _ _) = , pipelineParams = lit params , pipelineUserId = lit uid , pipelineEnabled = lit True - , pipelineError = lit "" + , pipelineError = lit Nothing , pipelineTriggerCount = lit 0 , pipelineLastTrigger = lit Nothing } diff --git a/api/src/Utils.hs b/api/src/Utils.hs index 4d13e34..872e018 100644 --- a/api/src/Utils.hs +++ b/api/src/Utils.hs @@ -37,7 +37,7 @@ instance Default (Pipeline Identity) where , pipelineParams = defaultPipelineParams , pipelineUserId = UserId 1 , pipelineEnabled = True - , pipelineError = "" + , pipelineError = Nothing , pipelineTriggerCount = 0 , pipelineLastTrigger = Nothing }