liquid_feedback_core

changeset 594:a2c156197bc7

Fixed wrong constraint "initiative_ids_not_equal" on "battle" table (due to handling of NULLs in CHECK constraints)
author jbe
date Sat Dec 08 02:05:53 2018 +0100 (22 months ago)
parents e7f772ca0621
children 87914d1b757f
files core.sql
line diff
     1.1 --- a/core.sql	Sat Dec 08 01:37:23 2018 +0100
     1.2 +++ b/core.sql	Sat Dec 08 02:05:53 2018 +0100
     1.3 @@ -1018,9 +1018,8 @@
     1.4          FOREIGN KEY ("issue_id", "losing_initiative_id") REFERENCES "initiative" ("issue_id", "id") ON DELETE CASCADE ON UPDATE CASCADE,
     1.5          "count"                 INT4            NOT NULL,
     1.6          CONSTRAINT "initiative_ids_not_equal" CHECK (
     1.7 -          "winning_initiative_id" != "losing_initiative_id" OR
     1.8 -          ( ("winning_initiative_id" NOTNULL AND "losing_initiative_id" ISNULL) OR
     1.9 -            ("winning_initiative_id" ISNULL AND "losing_initiative_id" NOTNULL) ) ) );
    1.10 +          "winning_initiative_id" != "losing_initiative_id" AND
    1.11 +          ("winning_initiative_id" NOTNULL OR "losing_initiative_id" NOTNULL) ) );
    1.12  CREATE UNIQUE INDEX "battle_winning_losing_idx" ON "battle" ("issue_id", "winning_initiative_id", "losing_initiative_id");
    1.13  CREATE UNIQUE INDEX "battle_winning_null_idx" ON "battle" ("issue_id", "winning_initiative_id") WHERE "losing_initiative_id" ISNULL;
    1.14  CREATE UNIQUE INDEX "battle_null_losing_idx" ON "battle" ("issue_id", "losing_initiative_id") WHERE "winning_initiative_id" ISNULL;

Impressum / About Us