From c005af4b60b6398fd5553f944409321cce1ec496 Mon Sep 17 00:00:00 2001 From: Pavel Date: Fri, 17 May 2024 20:19:56 +0300 Subject: [PATCH] add utm in answer struct and init new mig files for add column utm to db --- dal/schema/000011_init.down.sql | 2 ++ dal/schema/000011_init.up.sql | 2 ++ model/model.go | 1 + sqlc.yaml | 2 ++ 4 files changed, 7 insertions(+) create mode 100644 dal/schema/000011_init.down.sql create mode 100644 dal/schema/000011_init.up.sql diff --git a/dal/schema/000011_init.down.sql b/dal/schema/000011_init.down.sql new file mode 100644 index 0000000..c70ca6c --- /dev/null +++ b/dal/schema/000011_init.down.sql @@ -0,0 +1,2 @@ +ALTER TABLE answer +DROP COLUMN utm; \ No newline at end of file diff --git a/dal/schema/000011_init.up.sql b/dal/schema/000011_init.up.sql new file mode 100644 index 0000000..03da6ff --- /dev/null +++ b/dal/schema/000011_init.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE answer +ADD COLUMN utm text NOT NULL DEFAULT ''; \ No newline at end of file diff --git a/model/model.go b/model/model.go index e5fcaea..82fc385 100644 --- a/model/model.go +++ b/model/model.go @@ -130,6 +130,7 @@ type Answer struct { IP string OS string Start bool + Utm string // строка с utm метками amocrm } type ResultContent struct { diff --git a/sqlc.yaml b/sqlc.yaml index f25b4b1..a2ed050 100644 --- a/sqlc.yaml +++ b/sqlc.yaml @@ -24,6 +24,8 @@ packages: - "./dal/schema/000009_init.down.sql" - "./dal/schema/000010_init.up.sql" - "./dal/schema/000010_init.down.sql" + - "./dal/schema/000011_init.up.sql" + - "./dal/schema/000011_init.down.sql" engine: "postgresql" emit_json_tags: true emit_db_tags: true