wersja 3 db scheme
This commit is contained in:
@@ -30,7 +30,7 @@ Enum part_type {
|
|||||||
Table parts {
|
Table parts {
|
||||||
id int [pk]
|
id int [pk]
|
||||||
product_id int [ref: > products.id, not null]
|
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_top int [ref: > colors.id, not null]
|
||||||
color_back int [ref: > colors.id, not null]
|
color_back int [ref: > colors.id, not null]
|
||||||
finish_top finish_type [not null]
|
finish_top finish_type [not null]
|
||||||
@@ -112,6 +112,11 @@ Table events {
|
|||||||
indexes {
|
indexes {
|
||||||
(part_id, ordinal) [unique]
|
(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 {
|
Table production_lists {
|
||||||
|
|||||||
Reference in New Issue
Block a user