wersja 2 db scheme
This commit is contained in:
55
db_schema
55
db_schema
@@ -22,25 +22,35 @@ Enum finish_type {
|
||||
NITRO
|
||||
}
|
||||
|
||||
Enum part_type {
|
||||
BODY
|
||||
NECK
|
||||
}
|
||||
|
||||
Table parts {
|
||||
id int [pk]
|
||||
product_id int [ref: > products.id, not null]
|
||||
type part_type_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]
|
||||
finish_back finish_type [not null]
|
||||
|
||||
indexes {
|
||||
(product_id, type) [unique]
|
||||
}
|
||||
}
|
||||
|
||||
Table products {
|
||||
id int [pk]
|
||||
order_code varchar [not null, unique, note: "pelny nr zamowinia w formie tekstowej XXXX/YYYY/ZZ"]
|
||||
model int [ref: > models.id, not null]
|
||||
color_body_top int [ref: > colors.id, not null]
|
||||
color_body_back int [ref: > colors.id, not null]
|
||||
color_neck_top int [ref: > colors.id, null, default: null]
|
||||
color_neck_back int [ref: > colors.id, null, default: null]
|
||||
finish_body_top finish_type [not null]
|
||||
finish_body_back finish_type [not null]
|
||||
finish_neck_top finish_type [null, default: null]
|
||||
finish_neck_back finish_type [null, default: null]
|
||||
note text
|
||||
}
|
||||
|
||||
Table detail_products {
|
||||
id int [pk]
|
||||
product_id int [ref: - products.id, not null]
|
||||
spec text [note: "specyfikacja pobrana ze starego systemu w formie json"]
|
||||
spec jsonb [note: "specyfikacja pobrana ze starego systemu w formie json"]
|
||||
url varchar [note: "adres url strony ze specyfikacja ze starego systemu" ]
|
||||
|
||||
}
|
||||
@@ -63,7 +73,7 @@ Table orders {
|
||||
|
||||
Table order_products {
|
||||
id int [pk]
|
||||
product_id int [ref: > products.id, not null]
|
||||
product_id int [ref: > products.id, not null, unique]
|
||||
order_id int [ref: > orders.id, not null]
|
||||
product_order_idx int [not null]
|
||||
|
||||
@@ -74,7 +84,7 @@ Table order_products {
|
||||
|
||||
Table operations {
|
||||
id int [pk]
|
||||
operation varchar [not null]
|
||||
operation varchar [not null, unique]
|
||||
description text
|
||||
}
|
||||
|
||||
@@ -84,21 +94,24 @@ Enum event_type {
|
||||
ERROR
|
||||
}
|
||||
|
||||
Enum target_type {
|
||||
BODY
|
||||
NECK
|
||||
}
|
||||
Table event_info {
|
||||
id int [pk]
|
||||
event_id int [ref: > events.id, not null]
|
||||
comment text [default: null]
|
||||
photo_url varchar [default: null]
|
||||
|
||||
}
|
||||
Table events {
|
||||
id int [pk]
|
||||
product_id int [ref: > products.id, not null]
|
||||
part_id int [ref: > parts.id, not null]
|
||||
operation_id int [ref: > operations.id]
|
||||
ordinal int [not null, note: "liczba porzadkowa, wielokrotnosc 32, zeby mozna bylo dodac pomiedzy"]
|
||||
type event_type [not null, default: "OPERATION"]
|
||||
target target_type [not null, default: "BODY"]
|
||||
date date [not null]
|
||||
description text
|
||||
photo image
|
||||
date date [not null, note: "data jest ustawiana po wykonaniu operacji, niekonicznie w ten sam dzien. mozna edytowac"]
|
||||
|
||||
indexes {
|
||||
(part_id, ordinal) [unique]
|
||||
}
|
||||
}
|
||||
|
||||
Table production_lists {
|
||||
|
||||
Reference in New Issue
Block a user