From 2ca2a6d56f17bdce28b1796cdcaa558a7dcfa8e9 Mon Sep 17 00:00:00 2001 From: pasha1coil Date: Tue, 10 Jun 2025 12:38:48 +0300 Subject: [PATCH] update sql schema --- dal/db_query/queries.sql | 3 +++ dal/schema/000024_init.down.sql | 1 + dal/schema/000024_init.up.sql | 1 + model/model.go | 2 ++ sqlc.yaml | 2 ++ 5 files changed, 9 insertions(+) create mode 100644 dal/schema/000024_init.down.sql create mode 100644 dal/schema/000024_init.up.sql diff --git a/dal/db_query/queries.sql b/dal/db_query/queries.sql index b8eda7c..f84d215 100644 --- a/dal/db_query/queries.sql +++ b/dal/db_query/queries.sql @@ -1463,3 +1463,6 @@ INSERT INTO bitrixContact (AccountID, BitrixID, Field) VALUES ($1, $2, $3) RETUR -- name: UpdateBitrixContact :exec UPDATE bitrixContact SET Field = $1,BitrixID=$3 WHERE ID = $2; + +-- name: UpdateGigaChatQuizFlag :exec +UPDATE quiz SET gigachat = true where id = $1 AND accountid = $2 AND deleted = false; \ No newline at end of file diff --git a/dal/schema/000024_init.down.sql b/dal/schema/000024_init.down.sql new file mode 100644 index 0000000..249ee63 --- /dev/null +++ b/dal/schema/000024_init.down.sql @@ -0,0 +1 @@ +ALTER TABLE quiz DROP COLUMN IF EXISTS gigachat; \ No newline at end of file diff --git a/dal/schema/000024_init.up.sql b/dal/schema/000024_init.up.sql new file mode 100644 index 0000000..21deb16 --- /dev/null +++ b/dal/schema/000024_init.up.sql @@ -0,0 +1 @@ +ALTER TABLE quiz ADD COLUMN gigachat boolean NOT NULL DEFAULT false; \ No newline at end of file diff --git a/model/model.go b/model/model.go index db1eb7d..4c12ee3 100644 --- a/model/model.go +++ b/model/model.go @@ -68,6 +68,8 @@ type Quiz struct { Super bool `json:"super"` GroupId uint64 `json:"group_id"` + + GigaChat bool `json:"giga_chat"` } type QuizConfig struct { diff --git a/sqlc.yaml b/sqlc.yaml index d1fa689..1bfd7dd 100644 --- a/sqlc.yaml +++ b/sqlc.yaml @@ -48,6 +48,8 @@ packages: - "./dal/schema/000022_init.down.sql" - "./dal/schema/000023_init.up.sql" - "./dal/schema/000023_init.down.sql" + - "./dal/schema/000024_init.up.sql" + - "./dal/schema/000024_init.down.sql" engine: "postgresql" emit_json_tags: true emit_db_tags: true