1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-27 16:34:52 +09:00

DB: If no workflow exists, add a dummy one

This commit is contained in:
fr33domlover 2022-10-16 23:42:41 +00:00
parent e638ff4117
commit 7ddb79d78d
3 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,5 @@
Workflow
ident WflIdent
name Text Maybe
desc Text Maybe
scope WorkflowScope

View file

@ -2798,6 +2798,12 @@ changes hLocal ctx =
, removeField "LocalMessage" "author" , removeField "LocalMessage" "author"
-- 506 -- 506
, renameField "LocalMessage" "authorNew" "author" , renameField "LocalMessage" "authorNew" "author"
-- 507
, unchecked $ lift $ do
mw <- selectFirst ([] :: [Filter Workflow507]) []
when (isNothing mw) $
insert_ $
Workflow507 (text2wfl "dummy507") Nothing Nothing WSPublic
] ]
migrateDB migrateDB

View file

@ -679,3 +679,6 @@ makeEntitiesMigration "498"
makeEntitiesMigration "504" makeEntitiesMigration "504"
$(modelFile "migrations/504_2022-10-16_message_author.model") $(modelFile "migrations/504_2022-10-16_message_author.model")
makeEntitiesMigration "507"
$(modelFile "migrations/507_2022-10-16_workflow.model")