liquid_feedback_core

changeset 513:bca63fc70e73

Drop and re-create view "expired_session" in update script to v3.2.0 (necessary to alter column type in table "session")
author jbe
date Sat Apr 16 20:00:36 2016 +0200 (2016-04-16)
parents 61fab7216893
children 705097d1b1f3
files update/core-update.v3.1.0-v3.2.0.sql
line diff
     1.1 --- a/update/core-update.v3.1.0-v3.2.0.sql	Sat Apr 16 19:57:53 2016 +0200
     1.2 +++ b/update/core-update.v3.1.0-v3.2.0.sql	Sat Apr 16 20:00:36 2016 +0200
     1.3 @@ -31,8 +31,19 @@
     1.4  COMMENT ON COLUMN "member"."notification_sent"        IS 'Timestamp of last scheduled notification mail that has been sent out';
     1.5  
     1.6  ALTER TABLE "rendered_member_statement" ALTER COLUMN "member_id" SET DATA TYPE INT4;
     1.7 +
     1.8 +DROP VIEW "expired_session";
     1.9 +
    1.10  ALTER TABLE "session" ALTER COLUMN "member_id" SET DATA TYPE INT4;
    1.11  
    1.12 +CREATE VIEW "expired_session" AS
    1.13 +  SELECT * FROM "session" WHERE now() > "expiry";
    1.14 +CREATE RULE "delete" AS ON DELETE TO "expired_session" DO INSTEAD
    1.15 +  DELETE FROM "session" WHERE "ident" = OLD."ident";
    1.16 +
    1.17 +COMMENT ON VIEW "expired_session" IS 'View containing all expired sessions where DELETE is possible';
    1.18 +COMMENT ON RULE "delete" ON "expired_session" IS 'Rule allowing DELETE on rows in "expired_session" view, i.e. DELETE FROM "expired_session"';
    1.19 +
    1.20  CREATE TABLE "subscription" (
    1.21          PRIMARY KEY ("member_id", "unit_id"),
    1.22          "member_id"             INT4            REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE,

Impressum / About Us