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

feature(chore):985 Added notification contracts. #1109

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
create or replace view contract_agreement_view as
-- Explicitly define column names for the view
CREATE OR REPLACE VIEW contract_agreement_view (id, contract_agreement_id, type, created) AS
SELECT *
FROM ((SELECT assets_as_built.id, contract_agreement_id, 'ASSET_AS_BUILT' as type, created
FROM assets_as_built
where contract_agreement_id is not null)
UNION ALL
(SELECT assets_as_planned.id, contract_agreement_id, 'ASSET_AS_PLANNED' as type, created
FROM assets_as_planned
where contract_agreement_id is not null)) results
FROM (
(SELECT assets_as_built.id,
contract_agreement_id,
'ASSET_AS_BUILT' AS type,
created
FROM assets_as_built
WHERE contract_agreement_id IS NOT NULL)
UNION ALL
(SELECT assets_as_planned.id,
contract_agreement_id,
'ASSET_AS_PLANNED' AS type,
created
FROM assets_as_planned
WHERE contract_agreement_id IS NOT NULL)
) results
ORDER BY created DESC;

Loading