diff --git a/init.sql b/init.sql index 539fc15..cc91d7f 100644 --- a/init.sql +++ b/init.sql @@ -2,7 +2,7 @@ BEGIN; CREATE TYPE master_spec AS ENUM ('работа1', 'работа2', 'и тд'); -CREATE TABLE "user" ( +CREATE TABLE client ( id UUID PRIMARY KEY, surname TEXT NOT NULL, Name TEXT NOT NULL, @@ -45,7 +45,7 @@ CREATE TABLE part ( CREATE TABLE vehicle ( id UUID PRIMARY KEY, - owner_id UUID NOT NULL REFERENCES "user" (id) ON DELETE CASCADE, + owner_id UUID NOT NULL REFERENCES client (id) ON DELETE CASCADE, gos_num TEXT NOT NULL, mark TEXT, model TEXT, @@ -79,13 +79,13 @@ CREATE TABLE receipt ( CREATE TABLE service_cart ( id UUID PRIMARY KEY, - user_id UUID NOT NULL REFERENCES "user" (id) ON DELETE CASCADE, + user_id UUID NOT NULL REFERENCES client (id) ON DELETE CASCADE, service_id UUID NOT NULL REFERENCES service (id) ON DELETE CASCADE ); CREATE TABLE part_cart ( id UUID PRIMARY KEY, - user_id UUID NOT NULL REFERENCES "user" (id) ON DELETE CASCADE, + user_id UUID NOT NULL REFERENCES client (id) ON DELETE CASCADE, part_id UUID NOT NULL REFERENCES part (id) ON DELETE CASCADE ); diff --git a/servicesDB.drawio b/servicesDB.drawio index c26c208..67db2f5 100644 --- a/servicesDB.drawio +++ b/servicesDB.drawio @@ -1,214 +1,214 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/servicesDB.drawio.png b/servicesDB.drawio.png index e0a19ba..ebb00d2 100644 Binary files a/servicesDB.drawio.png and b/servicesDB.drawio.png differ