liquid_feedback_core

changeset 515:ab05fb3bf974 v3.2.0

Set column "notification_hour" of "member" table by default to random number
author jbe
date Sun Apr 17 17:36:41 2016 +0200 (2016-04-17)
parents 705097d1b1f3
children ba7d5c7ede4f
files core.sql update/core-update.v3.1.0-v3.2.0.sql
line diff
     1.1 --- a/core.sql	Sun Apr 17 15:14:14 2016 +0200
     1.2 +++ b/core.sql	Sun Apr 17 17:36:41 2016 +0200
     1.3 @@ -117,7 +117,7 @@
     1.4          "notification_counter"     INT4         NOT NULL DEFAULT 1,
     1.5          "notification_sample_size" INT4         NOT NULL DEFAULT 3,
     1.6          "notification_dow"         INT4         CHECK ("notification_dow" BETWEEN 0 AND 6),
     1.7 -        "notification_hour"        INT4         CHECK ("notification_hour" BETWEEN 0 AND 23),
     1.8 +        "notification_hour"        INT4         DEFAULT floor(random() * 24) CHECK ("notification_hour" BETWEEN 0 AND 23),
     1.9          "notification_sent"        TIMESTAMP,
    1.10          "login_recovery_expiry"        TIMESTAMPTZ,
    1.11          "password_reset_secret"        TEXT     UNIQUE,
     2.1 --- a/update/core-update.v3.1.0-v3.2.0.sql	Sun Apr 17 15:14:14 2016 +0200
     2.2 +++ b/update/core-update.v3.1.0-v3.2.0.sql	Sun Apr 17 17:36:41 2016 +0200
     2.3 @@ -8,7 +8,7 @@
     2.4  ALTER TABLE "member" ADD COLUMN "notification_counter"     INT4    NOT NULL DEFAULT 1;
     2.5  ALTER TABLE "member" ADD COLUMN "notification_sample_size" INT4    NOT NULL DEFAULT 3;
     2.6  ALTER TABLE "member" ADD COLUMN "notification_dow"         INT4    CHECK ("notification_dow" BETWEEN 0 AND 6);
     2.7 -ALTER TABLE "member" ADD COLUMN "notification_hour"        INT4    CHECK ("notification_hour" BETWEEN 0 AND 23);
     2.8 +ALTER TABLE "member" ADD COLUMN "notification_hour"        INT4    DEFAULT floor(random() * 24) CHECK ("notification_hour" BETWEEN 0 AND 23);
     2.9  ALTER TABLE "member" ADD COLUMN "notification_sent"        TIMESTAMP;
    2.10  ALTER TABLE "member" ADD
    2.11    CONSTRAINT "notification_dow_requires_notification_hour"

Impressum / About Us