From 2b4d1e548861ce1d037a544a0a27167bebc35837 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Mon, 2 Sep 2024 19:15:58 -0400 Subject: [PATCH] fix tgs --- pkg/gordio/database/talkgroups.sql.go | 4 ++-- pkg/pb/stillbox.pb.go | 2 +- sql/postgres/migrations/001_initial.up.sql | 2 +- sql/postgres/queries/talkgroups.sql | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/gordio/database/talkgroups.sql.go b/pkg/gordio/database/talkgroups.sql.go index 0a1ef97..98d7788 100644 --- a/pkg/gordio/database/talkgroups.sql.go +++ b/pkg/gordio/database/talkgroups.sql.go @@ -96,8 +96,8 @@ WHERE tg.id = systg2id($1, $2) UNION SELECT tgl.id::INT8, tgl.system_id::INT4, sys.name system_name, tgl.tgid::INT4, tgl.name, -tgl.group_tag, NULL::INTEGER, NULL::JSONB, -CASE WHEN tgl.group_tag IS NULL THEN NULL ELSE ARRAY[tgl.group_tag] END, tgl.alpha_tag, +tgl.alpha_tag, NULL::INTEGER, NULL::JSONB, +CASE WHEN tgl.alpha_tag IS NULL THEN NULL ELSE ARRAY[tgl.alpha_tag] END, tgl.alpha_tag, TRUE learned FROM talkgroups_learned tgl JOIN systems sys ON tgl.system_id = sys.id diff --git a/pkg/pb/stillbox.pb.go b/pkg/pb/stillbox.pb.go index 2dcb7db..aea9fa1 100644 --- a/pkg/pb/stillbox.pb.go +++ b/pkg/pb/stillbox.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.33.0 -// protoc v4.24.4 +// protoc v5.27.3 // source: stillbox.proto package pb diff --git a/sql/postgres/migrations/001_initial.up.sql b/sql/postgres/migrations/001_initial.up.sql index d898e97..4224da9 100644 --- a/sql/postgres/migrations/001_initial.up.sql +++ b/sql/postgres/migrations/001_initial.up.sql @@ -78,7 +78,7 @@ BEGIN UNION SELECT tgl.system_id, tgl.tgid, tgl.name, tg.alpha_tag FROM talkgroups_learned tgl WHERE tgl.system_id = NEW.system AND tgl.tgid = NEW.talkgroup ) THEN - INSERT INTO talkgroups_learned(system_id, tgid, name, group_tag) VALUES( + INSERT INTO talkgroups_learned(system_id, tgid, name, alpha_tag) VALUES( NEW.system, NEW.talkgroup, NEW.tg_label, NEW.alpha_tag ) ON CONFLICT DO NOTHING; END IF; diff --git a/sql/postgres/queries/talkgroups.sql b/sql/postgres/queries/talkgroups.sql index 95412b5..e316dae 100644 --- a/sql/postgres/queries/talkgroups.sql +++ b/sql/postgres/queries/talkgroups.sql @@ -39,8 +39,8 @@ WHERE tg.id = systg2id(sqlc.arg(system_id), sqlc.arg(tgid)) UNION SELECT tgl.id::INT8, tgl.system_id::INT4, sys.name system_name, tgl.tgid::INT4, tgl.name, -tgl.group_tag, NULL::INTEGER, NULL::JSONB, -CASE WHEN tgl.group_tag IS NULL THEN NULL ELSE ARRAY[tgl.group_tag] END, tgl.alpha_tag, +tgl.alpha_tag, NULL::INTEGER, NULL::JSONB, +CASE WHEN tgl.alpha_tag IS NULL THEN NULL ELSE ARRAY[tgl.alpha_tag] END, tgl.alpha_tag, TRUE learned FROM talkgroups_learned tgl JOIN systems sys ON tgl.system_id = sys.id