Added recurrence SQL; updated API
API should support recurrence (#16); also updated for new F# match! statement
This commit is contained in:
31
src/sql/16-recurrence.sql
Normal file
31
src/sql/16-recurrence.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
ALTER TABLE mpj.request
|
||||
ADD COLUMN "showAfter" BIGINT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE mpj.request
|
||||
ADD COLUMN "recurType" VARCHAR(10) NOT NULL DEFAULT 'immediate';
|
||||
ALTER TABLE mpj.request
|
||||
ADD COLUMN "recurCount" SMALLINT NOT NULL DEFAULT 0;
|
||||
CREATE OR REPLACE VIEW mpj.journal AS
|
||||
SELECT
|
||||
request."requestId",
|
||||
request."userId",
|
||||
(SELECT "text"
|
||||
FROM mpj.history
|
||||
WHERE history."requestId" = request."requestId"
|
||||
AND "text" IS NOT NULL
|
||||
ORDER BY "asOf" DESC
|
||||
LIMIT 1) AS "text",
|
||||
(SELECT "asOf"
|
||||
FROM mpj.history
|
||||
WHERE history."requestId" = request."requestId"
|
||||
ORDER BY "asOf" DESC
|
||||
LIMIT 1) AS "asOf",
|
||||
(SELECT "status"
|
||||
FROM mpj.history
|
||||
WHERE history."requestId" = request."requestId"
|
||||
ORDER BY "asOf" DESC
|
||||
LIMIT 1) AS "lastStatus",
|
||||
request."snoozedUntil",
|
||||
request."showAfter",
|
||||
request."recurType",
|
||||
request."recurCount"
|
||||
FROM mpj.request;
|
||||
Reference in New Issue
Block a user