DB: Add TicketProjectLocal table, pointing to Ticket but not in use yet
This commit is contained in:
parent
813869755a
commit
7809512117
5 changed files with 62 additions and 0 deletions
|
@ -367,6 +367,14 @@ LocalTicket
|
|||
UniqueLocalTicketDiscussion discuss
|
||||
UniqueLocalTicketFollowers followers
|
||||
|
||||
TicketProjectLocal
|
||||
ticket TicketId
|
||||
project ProjectId
|
||||
accept OutboxItemId
|
||||
|
||||
UniqueTicketProjectLocal ticket
|
||||
UniqueTicketProjectLocalAccept accept
|
||||
|
||||
TicketAuthorLocal
|
||||
ticket LocalTicketId
|
||||
author PersonId
|
||||
|
|
7
migrations/2020_02_07_tpl.model
Normal file
7
migrations/2020_02_07_tpl.model
Normal file
|
@ -0,0 +1,7 @@
|
|||
TicketProjectLocal
|
||||
ticket TicketId
|
||||
project ProjectId
|
||||
accept OutboxItemId
|
||||
|
||||
UniqueTicketProjectLocal ticket
|
||||
UniqueTicketProjectLocalAccept accept
|
26
migrations/2020_02_07_tpl_mig.model
Normal file
26
migrations/2020_02_07_tpl_mig.model
Normal 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
|
|
@ -1325,6 +1325,17 @@ changes hLocal ctx =
|
|||
"UniqueTicketAuthorLocal"
|
||||
-- 199
|
||||
, 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
|
||||
|
|
|
@ -155,6 +155,10 @@ module Vervis.Migration.Model
|
|||
, TicketAuthorLocal194
|
||||
, TicketAuthorLocal194Generic (..)
|
||||
, Discussion194Generic (..)
|
||||
, model_2020_02_07
|
||||
, Ticket201
|
||||
, Ticket201Generic (..)
|
||||
, TicketProjectLocal201Generic (..)
|
||||
)
|
||||
where
|
||||
|
||||
|
@ -304,3 +308,9 @@ makeEntitiesMigration "189" $(modelFile "migrations/2020_02_05_mig.model")
|
|||
|
||||
makeEntitiesMigration "194"
|
||||
$(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")
|
||||
|
|
Loading…
Reference in a new issue