Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation process #265

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename modified to modification
  • Loading branch information
3nids committed Nov 21, 2024
commit fec69f8638760ebf244328a78410ed087f416c3b
16 changes: 8 additions & 8 deletions datamodel/app/vw_azimut_edit.sql
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@ CREATE OR REPLACE VIEW signalo_app.vw_azimut_edit
AS
SELECT
az.id,
az._last_modified_date,
az._last_modified_user,
az._last_modification_date,
az._last_modification_user,
ST_MakeLine(su.geometry, ST_SetSRID(St_MakePoint(ST_X(su.geometry) + 10 * sin(radians(az.azimut)), ST_Y(su.geometry) + 10 *cos(radians(az.azimut))), 2056))::geometry(LineString, 2056) as geometry
FROM signalo_db.azimut az
INNER JOIN signalo_db.support su ON az.fk_support = su.id;
@@ -29,13 +29,13 @@ CREATE FUNCTION signalo_app.ft_azimut_insert() RETURNS trigger
END IF;
INSERT INTO signalo_db.azimut (
fk_support,
_last_modified_date,
_last_modified_user,
_last_modification_date,
_last_modification_user,
azimut
) VALUES (
support_id,
NEW._last_modified_date,
NEW._last_modified_user,
NEW._last_modification_date,
NEW._last_modification_user,
degrees(ST_Azimuth(ST_StartPoint(NEW.geometry), ST_EndPoint(NEW.geometry)))
);
RETURN NEW;
@@ -62,8 +62,8 @@ CREATE FUNCTION signalo_app.ft_azimut_update() RETURNS trigger
END IF;
UPDATE signalo_db.azimut SET
azimut = degrees(ST_Azimuth(ST_StartPoint(NEW.geometry), ST_EndPoint(NEW.geometry))),
_last_modified_date = NEW._last_modified_date,
_last_modified_user = NEW._last_modified_user
_last_modification_date = NEW._last_modification_date,
_last_modification_user = NEW._last_modification_user
WHERE id = NEW.id;
RETURN NEW;
END;
8 changes: 4 additions & 4 deletions datamodel/app/vw_edited_support.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE OR REPLACE VIEW signalo_app.vw_edited_support AS
SELECT su.id, su.geometry,
greatest(su._last_modified_date, a._last_modified_date, f._last_modified_date, si._last_modified_date) AS _last_modified_date
greatest(su._last_modification_date, a._last_modification_date, f._last_modification_date, si._last_modification_date) AS _last_modification_date
FROM signalo_db.support su
LEFT JOIN LATERAL (SELECT id, fk_support, MAX(_last_modified_date) OVER (PARTITION BY fk_support) AS _last_modified_date FROM signalo_db.azimut ) a ON a.fk_support = su.id
LEFT JOIN LATERAL (SELECT id, fk_azimut, MAX(_last_modified_date) OVER (PARTITION BY fk_azimut) AS _last_modified_date FROM signalo_db.frame) f ON f.fk_azimut = a.id
LEFT JOIN LATERAL (SELECT id, fk_frame, MAX(_last_modified_date) OVER (PARTITION BY fk_frame) AS _last_modified_date FROM signalo_db.sign) si ON si.fk_frame = f.id;
LEFT JOIN LATERAL (SELECT id, fk_support, MAX(_last_modification_date) OVER (PARTITION BY fk_support) AS _last_modification_date FROM signalo_db.azimut ) a ON a.fk_support = su.id
LEFT JOIN LATERAL (SELECT id, fk_azimut, MAX(_last_modification_date) OVER (PARTITION BY fk_azimut) AS _last_modification_date FROM signalo_db.frame) f ON f.fk_azimut = a.id
LEFT JOIN LATERAL (SELECT id, fk_frame, MAX(_last_modification_date) OVER (PARTITION BY fk_frame) AS _last_modification_date FROM signalo_db.sign) si ON si.fk_frame = f.id;
38 changes: 19 additions & 19 deletions datamodel/demo_data/azimut_content.sql

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions datamodel/demo_data/frame_content.sql

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions datamodel/demo_data/sign_content.sql

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions datamodel/demo_data/support_content.sql

Large diffs are not rendered by default.

396 changes: 198 additions & 198 deletions project/signalo.qgs

Large diffs are not rendered by default.