Added data label for backend.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
-- Add migration script here
|
||||
|
||||
-- Create Label
|
||||
CREATE TABLE label
|
||||
(
|
||||
id bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 ),
|
||||
name text NOT NULL
|
||||
);
|
||||
|
||||
-- Alter variant table
|
||||
ALTER TABLE public.variant
|
||||
ADD label_id bigint,
|
||||
ADD variant_description text,
|
||||
ADD CONSTRAINT variant_label_id_fkey
|
||||
foreign key (label_id)
|
||||
references unit(id)
|
||||
ON DELETE NO ACTION;
|
||||
@@ -211,6 +211,8 @@ async fn add_variant(
|
||||
description: None,
|
||||
ingredients: None,
|
||||
unit: Unit::G,
|
||||
label: None,
|
||||
variant_description: None,
|
||||
};
|
||||
|
||||
(StatusCode::INTERNAL_SERVER_ERROR, Json(variant))
|
||||
@@ -240,6 +242,8 @@ async fn update_variant_route(
|
||||
description: None,
|
||||
ingredients: None,
|
||||
unit: Unit::G,
|
||||
label: None,
|
||||
variant_description: None,
|
||||
};
|
||||
|
||||
(StatusCode::INTERNAL_SERVER_ERROR, Json(variant))
|
||||
|
||||
Reference in New Issue
Block a user