This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
585 additions
and
53 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
v1.50.21 |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
104 changes: 104 additions & 0 deletions
104
pkg/database/migrations/0092_add_access_owner_to_dataset_view.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,104 @@ | ||
-- +goose Up | ||
DROP VIEW dataset_view; | ||
|
||
CREATE VIEW dataset_view AS( | ||
SELECT | ||
ds.id as ds_id, | ||
ds.name as ds_name, | ||
ds.description as ds_description, | ||
ds.created as ds_created, | ||
ds.last_modified as ds_last_modified, | ||
ds.slug as ds_slug, | ||
ds.pii as pii, | ||
ds.keywords as ds_keywords, | ||
dsrc.id AS bq_id, | ||
dsrc.created as bq_created, | ||
dsrc.last_modified as bq_last_modified, | ||
dsrc.expires as bq_expires, | ||
dsrc.description as bq_description, | ||
dsrc.missing_since as bq_missing_since, | ||
dsrc.pii_tags as pii_tags, | ||
dsrc.project_id as bq_project, | ||
dsrc.dataset as bq_dataset, | ||
dsrc.table_name as bq_table_name, | ||
dsrc.table_type as bq_table_type, | ||
dsrc.pseudo_columns as pseudo_columns, | ||
dsrc.schema as bq_schema, | ||
ds.dataproduct_id as ds_dp_id, | ||
dm.services as mapping_services, | ||
da.id as access_id, | ||
da.subject as access_subject, | ||
da.owner as access_owner, | ||
da.granter as access_granter, | ||
da.expires as access_expires, | ||
da.created as access_created, | ||
da.revoked as access_revoked, | ||
da.access_request_id as access_request_id, | ||
mm.database_id as mb_database_id, | ||
mm.deleted_at as mb_deleted_at | ||
FROM | ||
datasets ds | ||
LEFT JOIN ( | ||
SELECT | ||
* | ||
FROM | ||
datasource_bigquery | ||
WHERE | ||
is_reference = false | ||
) dsrc ON ds.id = dsrc.dataset_id | ||
LEFT JOIN third_party_mappings dm ON ds.id = dm.dataset_id | ||
LEFT JOIN dataset_access da ON ds.id = da.dataset_id | ||
LEFT JOIN metabase_metadata mm ON ds.id = mm.dataset_id | ||
); | ||
|
||
-- +goose Down | ||
DROP VIEW dataset_view; | ||
|
||
CREATE VIEW dataset_view AS( | ||
SELECT | ||
ds.id as ds_id, | ||
ds.name as ds_name, | ||
ds.description as ds_description, | ||
ds.created as ds_created, | ||
ds.last_modified as ds_last_modified, | ||
ds.slug as ds_slug, | ||
ds.pii as pii, | ||
ds.keywords as ds_keywords, | ||
dsrc.id AS bq_id, | ||
dsrc.created as bq_created, | ||
dsrc.last_modified as bq_last_modified, | ||
dsrc.expires as bq_expires, | ||
dsrc.description as bq_description, | ||
dsrc.missing_since as bq_missing_since, | ||
dsrc.pii_tags as pii_tags, | ||
dsrc.project_id as bq_project, | ||
dsrc.dataset as bq_dataset, | ||
dsrc.table_name as bq_table_name, | ||
dsrc.table_type as bq_table_type, | ||
dsrc.pseudo_columns as pseudo_columns, | ||
dsrc.schema as bq_schema, | ||
ds.dataproduct_id as ds_dp_id, | ||
dm.services as mapping_services, | ||
da.id as access_id, | ||
da.subject as access_subject, | ||
da.granter as access_granter, | ||
da.expires as access_expires, | ||
da.created as access_created, | ||
da.revoked as access_revoked, | ||
da.access_request_id as access_request_id, | ||
mm.database_id as mb_database_id, | ||
mm.deleted_at as mb_deleted_at | ||
FROM | ||
datasets ds | ||
LEFT JOIN ( | ||
SELECT | ||
* | ||
FROM | ||
datasource_bigquery | ||
WHERE | ||
is_reference = false | ||
) dsrc ON ds.id = dsrc.dataset_id | ||
LEFT JOIN third_party_mappings dm ON ds.id = dm.dataset_id | ||
LEFT JOIN dataset_access da ON ds.id = da.dataset_id | ||
LEFT JOIN metabase_metadata mm ON ds.id = mm.dataset_id | ||
); |
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
Oops, something went wrong.