-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from OpenSourcePolitics/add_initiatives_to_all…
…_projects feat(initiatives): add initiatives in demo
- Loading branch information
Showing
18 changed files
with
127 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
packages: | ||
- local: ../demo | ||
- local: ../packages/initiatives | ||
- package: dbt-labs/dbt_utils | ||
version: 1.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
packages: | ||
- local: ../demo | ||
- local: ../packages/initiatives | ||
- package: dbt-labs/dbt_utils | ||
version: 1.2.0 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
67 changes: 67 additions & 0 deletions
67
projects/demo/models/staging/decidim/initiatives/stg_decidim_initiatives.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{% set relation = adapter.get_relation( | ||
database=target.database, | ||
schema='public', | ||
identifier='decidim_initiatives' | ||
) %} | ||
|
||
{% if relation is not none %} | ||
SELECT | ||
id, | ||
title, | ||
description, | ||
decidim_organization_id, | ||
decidim_author_id, | ||
published_at, | ||
state, | ||
signature_type, | ||
signature_start_date, | ||
signature_end_date, | ||
answer, | ||
answered_at, | ||
answer_url, | ||
created_at, | ||
updated_at, | ||
decidim_user_group_id, | ||
hashtag, | ||
scoped_type_id, | ||
first_progress_notification_at, | ||
second_progress_notification_at, | ||
decidim_author_type, | ||
reference, | ||
online_votes, | ||
offline_votes, | ||
decidim_area_id, | ||
comments_count, | ||
follows_count | ||
FROM {{ source('decidim', 'decidim_initiatives') }} | ||
{% else %} | ||
SELECT | ||
CAST(NULL AS INTEGER) AS id, | ||
CAST(NULL AS TEXT) AS title, | ||
CAST(NULL AS TEXT) AS description, | ||
CAST(NULL AS INTEGER) AS decidim_organization_id, | ||
CAST(NULL AS INTEGER) AS decidim_author_id, | ||
CAST(NULL AS TIMESTAMP) AS published_at, | ||
CAST(NULL AS INTEGER) AS state, | ||
CAST(NULL AS TEXT) AS signature_type, | ||
CAST(NULL AS TIMESTAMP) AS signature_start_date, | ||
CAST(NULL AS TIMESTAMP) AS signature_end_date, | ||
CAST(NULL AS TEXT) AS answer, | ||
CAST(NULL AS TIMESTAMP) AS answered_at, | ||
CAST(NULL AS TEXT) AS answer_url, | ||
CAST(NULL AS TIMESTAMP) AS created_at, | ||
CAST(NULL AS TIMESTAMP) AS updated_at, | ||
CAST(NULL AS INTEGER) AS decidim_user_group_id, | ||
CAST(NULL AS TEXT) AS hashtag, | ||
CAST(NULL AS INTEGER) AS scoped_type_id, | ||
CAST(NULL AS TIMESTAMP) AS first_progress_notification_at, | ||
CAST(NULL AS TIMESTAMP) AS second_progress_notification_at, | ||
CAST(NULL AS TEXT) AS decidim_author_type, | ||
CAST(NULL AS TEXT) AS reference, | ||
CAST(NULL AS TEXT) AS online_votes, | ||
CAST(NULL AS TEXT) AS offline_votes, | ||
CAST(NULL AS INTEGER) AS decidim_area_id, | ||
CAST(NULL AS INTEGER) AS comments_count, | ||
CAST(NULL AS INTEGER) AS follows_count | ||
LIMIT 0 | ||
{% endif %} |
26 changes: 26 additions & 0 deletions
26
projects/demo/models/staging/decidim/initiatives/stg_decidim_initiatives_type_scopes.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% set relation = adapter.get_relation( | ||
database=target.database, | ||
schema='public', | ||
identifier='decidim_initiatives_type_scopes' | ||
) %} | ||
|
||
{% if relation is not none %} | ||
SELECT | ||
id, | ||
decidim_initiatives_types_id, | ||
decidim_scopes_id, | ||
supports_required, | ||
created_at, | ||
updated_at | ||
FROM {{ source('decidim', 'decidim_initiatives_type_scopes') }} | ||
{% else %} | ||
SELECT | ||
CAST(NULL AS INTEGER) AS id, | ||
CAST(NULL AS INTEGER) AS decidim_initiatives_types_id, | ||
CAST(NULL AS INTEGER) AS decidim_scopes_id, | ||
CAST(NULL AS BOOLEAN) AS supports_required, | ||
CAST(NULL AS TIMESTAMP) AS created_at, | ||
CAST(NULL AS TIMESTAMP) AS updated_at | ||
LIMIT 0 | ||
{% endif %} | ||
|
31 changes: 31 additions & 0 deletions
31
projects/demo/models/staging/decidim/initiatives/stg_decidim_initiatives_votes.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% set relation = adapter.get_relation( | ||
database=target.database, | ||
schema='public', | ||
identifier='decidim_initiatives_votes' | ||
) %} | ||
|
||
{% if relation is not none %} | ||
SELECT | ||
id, | ||
decidim_initiative_id, | ||
decidim_author_id, | ||
created_at, | ||
updated_at, | ||
encrypted_metadata, | ||
timestamp, | ||
hash_id, | ||
decidim_scope_id | ||
FROM {{ source('decidim', 'decidim_initiatives_votes') }} | ||
{% else %} | ||
SELECT | ||
CAST(NULL AS INTEGER) AS id, | ||
CAST(NULL AS INTEGER) AS decidim_initiative_id, | ||
CAST(NULL AS INTEGER) AS decidim_author_id, | ||
CAST(NULL AS TIMESTAMP) AS created_at, | ||
CAST(NULL AS TIMESTAMP) AS updated_at, | ||
CAST(NULL AS TEXT) AS encrypted_metadata, | ||
CAST(NULL AS TIMESTAMP) AS timestamp, | ||
CAST(NULL AS TEXT) AS hash_id, | ||
CAST(NULL AS INTEGER) AS decidim_scope_id | ||
LIMIT 0 | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
packages: | ||
- local: ../demo | ||
- local: ../packages/initiatives | ||
- package: dbt-labs/dbt_utils | ||
version: 1.2.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
projects/packages/initiatives/models/staging/stg_decidim_initiatives.sql
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
projects/packages/initiatives/models/staging/stg_decidim_initiatives_type_scopes.sql
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
projects/packages/initiatives/models/staging/stg_decidim_initiatives_votes.sql
This file was deleted.
Oops, something went wrong.