Skip to content

Commit

Permalink
Merge pull request #164 from Plant-for-the-Planet-org/feature/create-…
Browse files Browse the repository at this point in the history
…database-view

Add view_site and view_siteAlert Views for Filtered Data Access
  • Loading branch information
sagararyal authored Apr 4, 2024
2 parents 453316c + e2f1a5c commit b40d9a2
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
-- Site View
CREATE OR REPLACE VIEW view_site AS
SELECT
"id",
"name",
"type",
"radius",
"isMonitored",
"userId",
"slices"
FROM
"Site"
WHERE
"deletedAt" IS NULL;

-- SiteAlert View
CREATE OR REPLACE VIEW view_siteAlert AS
SELECT
"id",
"siteId",
"type",
"latitude",
"longitude",
"eventDate",
"detectedBy",
"confidence"
FROM
"SiteAlert"
WHERE
"deletedAt" IS NULL;

0 comments on commit b40d9a2

Please sign in to comment.