From a6ed6434340578e81d46383300a5fcc5a4142e42 Mon Sep 17 00:00:00 2001 From: bartool Date: Wed, 22 Apr 2026 21:37:55 +0200 Subject: [PATCH] wersja 3 db scheme --- db_schema | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db_schema b/db_schema index 9e6ca04..3134bcf 100644 --- a/db_schema +++ b/db_schema @@ -30,7 +30,7 @@ Enum part_type { Table parts { id int [pk] product_id int [ref: > products.id, not null] - type part_type_type [not null] + type part_type [not null] color_top int [ref: > colors.id, not null] color_back int [ref: > colors.id, not null] finish_top finish_type [not null] @@ -112,6 +112,11 @@ Table events { indexes { (part_id, ordinal) [unique] } + + checks { + `type != 'OPERATION' OR operation_id IS NOT NULL` [name: 'chk_event_operation_required'] + `type = 'OPERATION' OR operation_id IS NULL` [name: 'chk_event_operation_forbidden'] + } } Table production_lists {