mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-13 00:03:00 +00:00
* refactor: derive the azure trigger address from its principal Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore: update ee-repo-ref to 564ad8932e1488dfc4b2694d9b4e50c580d1b8ed This commit updates the EE repository reference after PR #706 was merged in windmill-ee-private. Previous ee-repo-ref: 74655906a7936c6e9e7c984f6b7af111f121404b New ee-repo-ref: 564ad8932e1488dfc4b2694d9b4e50c580d1b8ed Automated by sync-ee-ref workflow. --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
24 lines
940 B
SQL
24 lines
940 B
SQL
-- Rebuild email from permissioned_as, mirroring
|
|
-- windmill_common::users::get_email_from_permissioned_as.
|
|
|
|
ALTER TABLE azure_trigger ADD COLUMN email VARCHAR(255) NOT NULL DEFAULT '';
|
|
|
|
UPDATE azure_trigger t SET email = CASE
|
|
WHEN t.permissioned_as LIKE 'u/%' THEN COALESCE(
|
|
(SELECT u.email FROM usr u
|
|
WHERE u.workspace_id = t.workspace_id
|
|
AND u.username = SUBSTRING(t.permissioned_as FROM 3)),
|
|
(SELECT p.email FROM password p
|
|
WHERE p.super_admin
|
|
AND (p.username = SUBSTRING(t.permissioned_as FROM 3)
|
|
OR p.email = SUBSTRING(t.permissioned_as FROM 3))
|
|
LIMIT 1),
|
|
SUBSTRING(t.permissioned_as FROM 3) || '@unknown.windmill.dev'
|
|
)
|
|
WHEN t.permissioned_as LIKE 'g/%'
|
|
THEN 'group-' || SUBSTRING(t.permissioned_as FROM 3) || '@windmill.dev'
|
|
ELSE t.permissioned_as
|
|
END;
|
|
|
|
ALTER TABLE azure_trigger ALTER COLUMN email DROP DEFAULT;
|