liquid_feedback_core
changeset 496:044af1eec28b
New table "newsletter"
author | jbe |
---|---|
date | Sun Apr 03 20:46:10 2016 +0200 (2016-04-03) |
parents | bb420abbc2fa |
children | 91e3d31c1de2 |
files | core.sql update/core-update.v3.1.0-v3.2.0.sql |
line diff
1.1 --- a/core.sql Sun Apr 03 20:04:31 2016 +0200 1.2 +++ b/core.sql Sun Apr 03 20:46:10 2016 +0200 1.3 @@ -1279,6 +1279,19 @@ 1.4 CREATE INDEX "initiative_notification_sent_initiative_idx" ON "initiative_notification_sent" ("initiative_id"); 1.5 1.6 1.7 +CREATE TABLE "newsletter" ( 1.8 + "id" SERIAL4 PRIMARY KEY, 1.9 + "published" TIMESTAMPTZ NOT NULL, 1.10 + "unit_id" INT4 REFERENCES "unit" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 1.11 + "include_all_members" BOOLEAN NOT NULL, 1.12 + "sent" TIMESTAMPTZ, 1.13 + "subject" TEXT NOT NULL, 1.14 + "content" TEXT NOT NULL ); 1.15 +CREATE INDEX "newsletter_unit_id_idx" ON "newsletter" ("unit_id", "published"); 1.16 +CREATE INDEX "newsletter_all_units_published_idx" ON "newsletter" ("published") WHERE "unit_id" ISNULL; 1.17 +CREATE INDEX "newsletter_published_idx" ON "newsletter" ("published"); 1.18 + 1.19 + 1.20 1.21 ---------------------------------------------- 1.22 -- Writing of history entries and event log --
2.1 --- a/update/core-update.v3.1.0-v3.2.0.sql Sun Apr 03 20:04:31 2016 +0200 2.2 +++ b/update/core-update.v3.1.0-v3.2.0.sql Sun Apr 03 20:46:10 2016 +0200 2.3 @@ -36,6 +36,18 @@ 2.4 "last_suggestion_id" INT8 ); 2.5 CREATE INDEX "initiative_notification_sent_initiative_idx" ON "initiative_notification_sent" ("initiative_id"); 2.6 2.7 +CREATE TABLE "newsletter" ( 2.8 + "id" SERIAL4 PRIMARY KEY, 2.9 + "published" TIMESTAMPTZ NOT NULL, 2.10 + "unit_id" INT4 REFERENCES "unit" ("id") ON DELETE CASCADE ON UPDATE CASCADE, 2.11 + "include_all_members" BOOLEAN NOT NULL, 2.12 + "sent" TIMESTAMPTZ, 2.13 + "subject" TEXT NOT NULL, 2.14 + "content" TEXT NOT NULL ); 2.15 +CREATE INDEX "newsletter_unit_id_idx" ON "newsletter" ("unit_id", "published"); 2.16 +CREATE INDEX "newsletter_all_units_published_idx" ON "newsletter" ("published") WHERE "unit_id" ISNULL; 2.17 +CREATE INDEX "newsletter_published_idx" ON "newsletter" ("published"); 2.18 + 2.19 CREATE VIEW "updated_initiative" AS 2.20 SELECT 2.21 "supporter"."member_id" AS "seen_by_member_id",