Skip to content

Commit

Permalink
Merge pull request #56 from WomenPlusPlus/database-clean-up-3
Browse files Browse the repository at this point in the history
try again
  • Loading branch information
caracfinlay authored Oct 28, 2023
2 parents 611cb65 + 0456235 commit 6261fa3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions migrations/V36__add_user_to_kpi_definition.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
ALTER TABLE public.kpi_definition
ALTER COLUMN created_by SET DEFAULT auth.uid ();

CREATE OR REPLACE VIEW
DROP VIEW if exists public.kpi_definition_with_latest_values
CREATE VIEW
public.kpi_definition_with_latest_values as
select
ckd.circle_kpidef_id,
Expand Down Expand Up @@ -69,7 +70,8 @@ order by
kpi_id,
ckd.circle_kpidef_id;

CREATE or REPLACE VIEW
DROP VIEW if exists public.kpi_values_period_standardized
CREATE VIEW
public.kpi_values_period_standardized as
select *,
Case when target_value > 0 then ROUND(cumulative_value/target_value*100, 0) else null end as target_fulfilled
Expand Down

0 comments on commit 6261fa3

Please sign in to comment.