Learned has uuids
This commit is contained in:
parent
9faecccf2a
commit
4eddd7d1df
5 changed files with 14 additions and 14 deletions
|
@ -98,12 +98,12 @@ type Talkgroup struct {
|
|||
}
|
||||
|
||||
type TalkgroupsLearned struct {
|
||||
ID int32 `json:"id"`
|
||||
SystemID int `json:"system_id"`
|
||||
TGID int `json:"tgid"`
|
||||
Name string `json:"name"`
|
||||
AlphaTag *string `json:"alpha_tag"`
|
||||
Ignored *bool `json:"ignored"`
|
||||
ID uuid.UUID `json:"id"`
|
||||
SystemID int `json:"system_id"`
|
||||
TGID int `json:"tgid"`
|
||||
Name string `json:"name"`
|
||||
AlphaTag *string `json:"alpha_tag"`
|
||||
Ignored *bool `json:"ignored"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
|
|
|
@ -34,7 +34,7 @@ JOIN systems sys ON tg.system_id = sys.id
|
|||
JOIN UNNEST($1::INT4[], $2::INT4[]) AS tgt(sys, tg) ON (tg.system_id = tgt.sys AND tg.tgid = tgt.tg)
|
||||
UNION
|
||||
SELECT
|
||||
NULL::UUID, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
tgl.id, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
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,
|
||||
TRUE, NULL::JSONB, 1.0, sys.id, sys.name,
|
||||
|
|
|
@ -106,7 +106,7 @@ JOIN systems sys ON tg.system_id = sys.id
|
|||
WHERE (tg.system_id, tg.tgid) = ($1, $2)
|
||||
UNION
|
||||
SELECT
|
||||
NULL::UUID, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
tgl.id, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
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,
|
||||
TRUE, NULL::JSONB, 1.0, sys.id, sys.name,
|
||||
|
@ -237,7 +237,7 @@ FROM talkgroups tg
|
|||
JOIN systems sys ON tg.system_id = sys.id
|
||||
UNION
|
||||
SELECT
|
||||
NULL::UUID, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
tgl.id, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
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,
|
||||
TRUE, NULL::JSONB, 1.0, sys.id, sys.name,
|
||||
|
@ -298,7 +298,7 @@ JOIN systems sys ON tg.system_id = sys.id
|
|||
WHERE tg.system_id = $1
|
||||
UNION
|
||||
SELECT
|
||||
NULL::UUID, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
tgl.id, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
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,
|
||||
TRUE, NULL::JSONB, 1.0, sys.id, sys.name,
|
||||
|
|
|
@ -44,7 +44,7 @@ CREATE INDEX talkgroups_system_tgid_idx ON talkgroups (system_id, tgid);
|
|||
CREATE INDEX IF NOT EXISTS talkgroup_id_tags ON talkgroups USING GIN (tags);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS talkgroups_learned(
|
||||
id SERIAL PRIMARY KEY,
|
||||
id UUID PRIMARY KEY,
|
||||
system_id INTEGER REFERENCES systems(id) NOT NULL,
|
||||
tgid INTEGER NOT NULL,
|
||||
name TEXT NOT NULL,
|
||||
|
|
|
@ -33,7 +33,7 @@ JOIN systems sys ON tg.system_id = sys.id
|
|||
WHERE (tg.system_id, tg.tgid) = (@system_id, @tgid)
|
||||
UNION
|
||||
SELECT
|
||||
NULL::UUID, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
tgl.id, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
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,
|
||||
TRUE, NULL::JSONB, 1.0, sys.id, sys.name,
|
||||
|
@ -51,7 +51,7 @@ JOIN systems sys ON tg.system_id = sys.id
|
|||
WHERE tg.system_id = @system
|
||||
UNION
|
||||
SELECT
|
||||
NULL::UUID, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
tgl.id, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
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,
|
||||
TRUE, NULL::JSONB, 1.0, sys.id, sys.name,
|
||||
|
@ -68,7 +68,7 @@ FROM talkgroups tg
|
|||
JOIN systems sys ON tg.system_id = sys.id
|
||||
UNION
|
||||
SELECT
|
||||
NULL::UUID, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
tgl.id, tgl.system_id::INT4, tgl.tgid::INT4, tgl.name,
|
||||
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,
|
||||
TRUE, NULL::JSONB, 1.0, sys.id, sys.name,
|
||||
|
|
Loading…
Reference in a new issue