DB: Add TicketProjectLocal table, pointing to Ticket but not in use yet

This commit is contained in:
fr33domlover 2020-02-06 04:18:19 +00:00
parent 813869755a
commit 7809512117
5 changed files with 62 additions and 0 deletions

View file

@ -367,6 +367,14 @@ LocalTicket
UniqueLocalTicketDiscussion discuss UniqueLocalTicketDiscussion discuss
UniqueLocalTicketFollowers followers UniqueLocalTicketFollowers followers
TicketProjectLocal
ticket TicketId
project ProjectId
accept OutboxItemId
UniqueTicketProjectLocal ticket
UniqueTicketProjectLocalAccept accept
TicketAuthorLocal TicketAuthorLocal
ticket LocalTicketId ticket LocalTicketId
author PersonId author PersonId

View file

@ -0,0 +1,7 @@
TicketProjectLocal
ticket TicketId
project ProjectId
accept OutboxItemId
UniqueTicketProjectLocal ticket
UniqueTicketProjectLocalAccept accept

View file

@ -0,0 +1,26 @@
OutboxItem
Project
Ticket
project ProjectId
number Int Maybe
created UTCTime
title Text -- HTML
source Text -- Pandoc Markdown
description Text -- HTML
assignee Int64 Maybe
status Text
closed UTCTime
closer Int64 Maybe
accept OutboxItemId
UniqueTicketAccept accept
TicketProjectLocal
ticket TicketId
project ProjectId
accept OutboxItemId
UniqueTicketProjectLocal ticket
UniqueTicketProjectLocalAccept accept

View file

@ -1325,6 +1325,17 @@ changes hLocal ctx =
"UniqueTicketAuthorLocal" "UniqueTicketAuthorLocal"
-- 199 -- 199
, renameField "TicketAuthorLocal" "ticketNew" "ticket" , renameField "TicketAuthorLocal" "ticketNew" "ticket"
-- 200
, addEntities model_2020_02_07
-- 201
, unchecked $ lift $ do
ts <- selectList ([] :: [Filter Ticket201]) []
let makeTPL (Entity tid t) = TicketProjectLocal201
{ ticketProjectLocal201Ticket = tid
, ticketProjectLocal201Project = ticket201Project t
, ticketProjectLocal201Accept = ticket201Accept t
}
insertMany_ $ map makeTPL ts
] ]
migrateDB migrateDB

View file

@ -155,6 +155,10 @@ module Vervis.Migration.Model
, TicketAuthorLocal194 , TicketAuthorLocal194
, TicketAuthorLocal194Generic (..) , TicketAuthorLocal194Generic (..)
, Discussion194Generic (..) , Discussion194Generic (..)
, model_2020_02_07
, Ticket201
, Ticket201Generic (..)
, TicketProjectLocal201Generic (..)
) )
where where
@ -304,3 +308,9 @@ makeEntitiesMigration "189" $(modelFile "migrations/2020_02_05_mig.model")
makeEntitiesMigration "194" makeEntitiesMigration "194"
$(modelFile "migrations/2020_02_06_tal_point_to_lt.model") $(modelFile "migrations/2020_02_06_tal_point_to_lt.model")
model_2020_02_07 :: [Entity SqlBackend]
model_2020_02_07 = $(schema "2020_02_07_tpl")
makeEntitiesMigration "201"
$(modelFile "migrations/2020_02_07_tpl_mig.model")