Skip to content

Commit 5987088

Browse files
committed
oppdater bigquery views
1 parent 32f9121 commit 5987088

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

iac/bigquery-terraform/dev/datastreams.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module "mr_api_datastream" {
1111
source = "git::https://github.com/navikt/terraform-google-bigquery-datastream.git?ref=v1.0.1"
1212
gcp_project = var.gcp_project
1313
application_name = "mulighetsrommet-api"
14-
cloud_sql_instance_name = "mulighetsrommet-api"
14+
cloud_sql_instance_name = "mulighetsrommet-api-v1"
1515
cloud_sql_instance_db_name = "mulighetsrommet-api-db"
1616
cloud_sql_instance_db_credentials = jsondecode(
1717
data.google_secret_manager_secret_version.mr_api_datastream_secret.secret_data

iac/bigquery-terraform/dev/views-mr-api.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ WHERE tiltakskode IS NOT NULL
4242
EOF
4343
}
4444

45-
module "mr_api_tiltaksgjennomforing_view" {
45+
module "mr_api_gjennomforing_view" {
4646
source = "../modules/google-bigquery-view"
4747
deletion_protection = false
4848
dataset_id = module.mr_api_datastream.dataset_id
49-
view_id = "tiltaksgjennomforing_view"
49+
view_id = "gjennomforing_view"
5050
view_schema = jsonencode(
5151
[
5252
{
@@ -95,7 +95,7 @@ SELECT
9595
avsluttet_tidspunkt,
9696
start_dato,
9797
slutt_dato
98-
FROM `${var.gcp_project["project"]}.${module.mr_api_datastream.dataset_id}.public_tiltaksgjennomforing`
98+
FROM `${var.gcp_project["project"]}.${module.mr_api_datastream.dataset_id}.public_gjennomforing`
9999
WHERE slutt_dato is null or slutt_dato >= DATE '2018-01-01'
100100
EOF
101101
}

iac/bigquery-terraform/prod/datastreams.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module "mr_api_datastream" {
1111
source = "git::https://github.com/navikt/terraform-google-bigquery-datastream.git?ref=v1.0.1"
1212
gcp_project = var.gcp_project
1313
application_name = "mulighetsrommet-api"
14-
cloud_sql_instance_name = "mulighetsrommet-api"
14+
cloud_sql_instance_name = "mulighetsrommet-api-v1"
1515
cloud_sql_instance_db_name = "mulighetsrommet-api-db"
1616
cloud_sql_instance_db_credentials = jsondecode(
1717
data.google_secret_manager_secret_version.mr_api_datastream_secret.secret_data

iac/bigquery-terraform/prod/views-mr-api.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ WHERE tiltakskode IS NOT NULL
4242
EOF
4343
}
4444

45-
module "mr_api_tiltaksgjennomforing_view" {
45+
module "mr_api_gjennomforing_view" {
4646
source = "../modules/google-bigquery-view"
4747
deletion_protection = false
4848
dataset_id = module.mr_api_datastream.dataset_id
49-
view_id = "tiltaksgjennomforing_view"
49+
view_id = "gjennomforing_view"
5050
view_schema = jsonencode(
5151
[
5252
{
@@ -95,16 +95,16 @@ SELECT
9595
avsluttet_tidspunkt,
9696
start_dato,
9797
slutt_dato
98-
FROM `${var.gcp_project["project"]}.${module.mr_api_datastream.dataset_id}.public_tiltaksgjennomforing`
98+
FROM `${var.gcp_project["project"]}.${module.mr_api_datastream.dataset_id}.public_gjennomforing`
9999
WHERE slutt_dato is null or slutt_dato >= DATE '2018-01-01'
100100
EOF
101101
}
102102

103-
module "mr_api_tiltaksgjennomforing_opphav_antall_opprettet_view" {
103+
module "mr_api_gjennomforing_opphav_antall_opprettet_view" {
104104
source = "../modules/google-bigquery-view"
105105
deletion_protection = false
106106
dataset_id = module.mr_api_datastream.dataset_id
107-
view_id = "tiltaksgjennomforing_opphav_antall_opprettet_view"
107+
view_id = "gjennomforing_opphav_antall_opprettet_view"
108108
view_schema = jsonencode(
109109
[
110110
{
@@ -132,7 +132,7 @@ select
132132
tiltakstype.navn,
133133
gjennomforing.opphav,
134134
count(*) as antall_opprettet
135-
from `${var.gcp_project["project"]}.${module.mr_api_datastream.dataset_id}.public_tiltaksgjennomforing` gjennomforing
135+
from `${var.gcp_project["project"]}.${module.mr_api_datastream.dataset_id}.public_gjennomforing` gjennomforing
136136
join `${var.gcp_project["project"]}.${module.mr_api_datastream.dataset_id}.public_tiltakstype` tiltakstype on gjennomforing.tiltakstype_id = tiltakstype.id
137137
group by tiltakstype.navn, gjennomforing.opphav
138138
order by tiltakstype.navn

0 commit comments

Comments
 (0)