From f6456e1b8de7383cef5eb5bb53a9cb0b87230eec Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Thu, 1 Feb 2024 14:54:41 -0700 Subject: [PATCH] Added 'state' to match/elim scores so they can be revoked --- src/database.erl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/database.erl b/src/database.erl index a82bd27..3b86fcf 100644 --- a/src/database.erl +++ b/src/database.erl @@ -140,8 +140,10 @@ init_db(Database) -> {type, text, [not_null]}, {number, integer, [not_null]}, {history, integer, [not_null]}, + {state, text, [not_null]}, {uuid, integer, [not_null]}], [{primary_key, [division, type, number, history]}, + {check, "state in ('submitted', 'revoked')"}, % Restrict scores from being deleted that are referenced {foreign_key, {[uuid], scores, @@ -225,8 +227,10 @@ init_db(Database) -> {number, integer, [not_null]}, {instance, integer, [not_null]}, {history, integer, [not_null]}, + {state, text, [not_null]}, {uuid, integer, [not_null]}], [{primary_key, [division, number, instance, history]}, + {check, "state in ('submitted', 'revoked')"}, % Restrict scores from being deleted that are referenced {foreign_key, {[uuid], scores,