From 9cb90c58c0111d8838e660d9e5ccc259d8933de6 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Thu, 22 Sep 2022 17:23:33 +0000 Subject: [PATCH] DB: Remember whether a Bundle came from person input or auto-generated --- src/Vervis/API.hs | 4 ++-- src/Vervis/Migration.hs | 2 ++ th/models | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Vervis/API.hs b/src/Vervis/API.hs index f1882d6..eedcb26 100644 --- a/src/Vervis/API.hs +++ b/src/Vervis/API.hs @@ -2900,7 +2900,7 @@ offerTicketC (Entity senderPersonID senderPerson) senderActor summary audience t for_ maybeOriginBranch $ \ (mlu, b) -> insert_ $ MergeOriginRemoteBranch originID mlu b for_ (justThere originOrBundle) $ \ (Material typ diffs) -> do - bundleID <- insert $ Bundle clothID + bundleID <- insert $ Bundle clothID False insertMany_ $ NE.toList $ NE.reverse $ NE.map (Patch bundleID now typ) diffs route <- ClothR <$> encodeKeyHashid loomID <*> encodeKeyHashid clothID @@ -3013,7 +3013,7 @@ offerTicketC (Entity senderPersonID senderPerson) senderActor summary audience t generateGitPatches targetPath (T.unpack targetBranch) originURI (T.unpack originBranch) now <- liftIO getCurrentTime lift $ runDB $ do - bundleID <- insert $ Bundle clothID + bundleID <- insert $ Bundle clothID True insertMany_ $ NE.toList $ NE.map (Patch bundleID now PatchMediaTypeGit) $ NE.reverse patches {- diff --git a/src/Vervis/Migration.hs b/src/Vervis/Migration.hs index 719e8b2..6abf05e 100644 --- a/src/Vervis/Migration.hs +++ b/src/Vervis/Migration.hs @@ -2700,6 +2700,8 @@ changes hLocal ctx = TL.toStrict . TLB.toLazyText . HED.htmlEncodedText $ ticket495Title ticket update ticketID [Ticket495Title =. plain] + -- 496 + , addFieldPrimRequired "Bundle" False "auto" ] migrateDB diff --git a/th/models b/th/models index 7bca97f..8bd7646 100644 --- a/th/models +++ b/th/models @@ -485,6 +485,7 @@ TicketAuthorRemote Bundle ticket TicketLoomId + auto Bool Patch bundle BundleId