Skip to content

Commit 399f00b

Browse files
committed
get all tenants: include location, block , partion intsead of house_id
1 parent 9d1f0b8 commit 399f00b

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

db/queries/tenants.sql

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,20 @@ JOIN house h ON t.house_id = h.id
1515
WHERE t.id = $1;
1616

1717
-- name: GetTenants :many
18-
SELECT id, name, house_id,
19-
phone, personal_id_type,personal_id, active, sos, eos
20-
FROM tenant;
18+
SELECT
19+
t.id,
20+
t.name,
21+
h.location AS house_location,
22+
h.block AS house_block,
23+
h.partition AS house_partition,
24+
t.phone,
25+
t.personal_id_type,
26+
t.personal_id,
27+
t.active,
28+
t.sos,
29+
t.eos
30+
FROM tenant t
31+
JOIN house h ON t.house_id = h.id;
2132

2233
-- name: UpdateTenant :exec
2334
UPDATE tenant

db/sqlc/tenants.sql.go

Lines changed: 20 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)