diff --git a/build/schema/initdb.sql b/build/schema/initdb.sql index 7b83fb0e..bc4db231 100644 --- a/build/schema/initdb.sql +++ b/build/schema/initdb.sql @@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS category ( user_id UUID REFERENCES Users(id) CONSTRAINT fk_user_category NOT NULL, parent_tag UUID REFERENCES category(id), "name" VARCHAR(30) NOT NULL, - image_id INT DEFAULT 0 NOT NULL, + --image_id INT DEFAULT 0 NOT NULL, show_income BOOLEAN, show_outcome BOOLEAN, regular BOOLEAN NOT NULL diff --git a/internal/microservices/category/repository/postgres/postgres.go b/internal/microservices/category/repository/postgres/postgres.go index 8cc018f7..946ebdbf 100644 --- a/internal/microservices/category/repository/postgres/postgres.go +++ b/internal/microservices/category/repository/postgres/postgres.go @@ -18,7 +18,7 @@ const ( CategoryGet = `SELECT user_id, parent_tag, "name", show_income, show_outcome, regular FROM category WHERE id=$1;` CategoryCreate = `INSERT INTO category (user_id, parent_tag, "name", show_income, show_outcome, regular) - VALUES ($1, $2, $3, $4, $5, $6, $7) + VALUES ($1, $2, $3, $4, $5, $6) RETURNING id;` CategoryUpdate = `UPDATE category SET parent_tag=CAST($1 AS UUID), "name"=$2, show_income=$3, show_outcome=$4, regular=$5 WHERE id=CAST($6 AS UUID);`