-
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
1 parent
0f02764
commit 59ee44d
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
hasura.planx.uk/migrations/1720511391883_run_sql_migration/down.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,28 @@ | ||
-- Previous version of teams_summary view from 1713084872473_create_view_teams_summary/up.sql | ||
|
||
CREATE OR REPLACE VIEW "public"."teams_summary" AS SELECT | ||
t.id, | ||
t.name, | ||
t.slug, | ||
t.reference_code, | ||
t.settings->>'homepage' as homepage, | ||
t.domain as subdomain, | ||
ti.has_planning_data as planning_data_enabled, | ||
'@todo' as article_4s_enabled, | ||
t.notify_personalisation as govnotify_personalisation, | ||
CASE | ||
WHEN coalesce(ti.production_govpay_secret, ti.staging_govpay_secret) is not null | ||
THEN true | ||
ELSE false | ||
END as govpay_enabled, | ||
t.submission_email as send_to_email_address, | ||
coalesce(ti.production_bops_submission_url, ti.staging_bops_submission_url) as bops_submission_url, | ||
tt.logo, | ||
tt.favicon, | ||
tt.primary_colour, | ||
tt.link_colour, | ||
tt.action_colour | ||
FROM teams t | ||
JOIN team_integrations ti on ti.team_id = t.id | ||
JOIN team_themes tt on tt.team_id = t.id | ||
ORDER BY t.name ASC; |
32 changes: 32 additions & 0 deletions
32
hasura.planx.uk/migrations/1720511391883_run_sql_migration/up.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,32 @@ | ||
CREATE OR REPLACE VIEW "public"."teams_summary" AS SELECT | ||
t.id, | ||
t.name, | ||
t.slug, | ||
t.reference_code, | ||
t.settings->>'homepage' as homepage, | ||
t.domain as subdomain, | ||
ti.has_planning_data as planning_data_enabled, | ||
'@todo' as article_4s_enabled, | ||
jsonb_build_object( | ||
'helpEmail', ts.help_email, | ||
'helpPhone', ts.help_phone, | ||
'emailReplyToId', ts.email_reply_to_id, | ||
'helpOpeningHours', ts.help_opening_hours | ||
) as govnotify_personalisation, | ||
CASE | ||
WHEN coalesce(ti.production_govpay_secret, ti.staging_govpay_secret) is not null | ||
THEN true | ||
ELSE false | ||
END as govpay_enabled, | ||
t.submission_email as send_to_email_address, | ||
coalesce(ti.production_bops_submission_url, ti.staging_bops_submission_url) as bops_submission_url, | ||
tt.logo, | ||
tt.favicon, | ||
tt.primary_colour, | ||
tt.link_colour, | ||
tt.action_colour | ||
FROM teams t | ||
JOIN team_integrations ti on ti.team_id = t.id | ||
JOIN team_themes tt on tt.team_id = t.id | ||
JOIN team_settings ts on ts.team_id = t.id | ||
ORDER BY t.name ASC; |