|
|
@ -140,8 +140,10 @@ init_db(Database) ->
|
|
|
|
{type, text, [not_null]},
|
|
|
|
{type, text, [not_null]},
|
|
|
|
{number, integer, [not_null]},
|
|
|
|
{number, integer, [not_null]},
|
|
|
|
{history, integer, [not_null]},
|
|
|
|
{history, integer, [not_null]},
|
|
|
|
|
|
|
|
{state, text, [not_null]},
|
|
|
|
{uuid, integer, [not_null]}],
|
|
|
|
{uuid, integer, [not_null]}],
|
|
|
|
[{primary_key, [division, type, number, history]},
|
|
|
|
[{primary_key, [division, type, number, history]},
|
|
|
|
|
|
|
|
{check, "state in ('submitted', 'revoked')"},
|
|
|
|
% Restrict scores from being deleted that are referenced
|
|
|
|
% Restrict scores from being deleted that are referenced
|
|
|
|
{foreign_key, {[uuid],
|
|
|
|
{foreign_key, {[uuid],
|
|
|
|
scores,
|
|
|
|
scores,
|
|
|
@ -225,8 +227,10 @@ init_db(Database) ->
|
|
|
|
{number, integer, [not_null]},
|
|
|
|
{number, integer, [not_null]},
|
|
|
|
{instance, integer, [not_null]},
|
|
|
|
{instance, integer, [not_null]},
|
|
|
|
{history, integer, [not_null]},
|
|
|
|
{history, integer, [not_null]},
|
|
|
|
|
|
|
|
{state, text, [not_null]},
|
|
|
|
{uuid, integer, [not_null]}],
|
|
|
|
{uuid, integer, [not_null]}],
|
|
|
|
[{primary_key, [division, number, instance, history]},
|
|
|
|
[{primary_key, [division, number, instance, history]},
|
|
|
|
|
|
|
|
{check, "state in ('submitted', 'revoked')"},
|
|
|
|
% Restrict scores from being deleted that are referenced
|
|
|
|
% Restrict scores from being deleted that are referenced
|
|
|
|
{foreign_key, {[uuid],
|
|
|
|
{foreign_key, {[uuid],
|
|
|
|
scores,
|
|
|
|
scores,
|
|
|
|