wersja 3 db scheme

This commit is contained in:
2026-04-22 21:37:55 +02:00
parent d578340636
commit a6ed643434

View File

@@ -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 {