mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
68daed8501
Attach custom-instance datatables in the DuckDB executor through a DuckDB secret instead of an inline connection string, and route postgres triggers on custom-instance datatables through a dedicated custom_instance_replication_user role (with its own auto-generated password in global_settings). Normalize custom_instance_user attributes on server boot. Claude-Session: https://claude.ai/code/session_01Tp6NNNinCB8dwWqGaFXDRF Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
15 lines
439 B
SQL
15 lines
439 B
SQL
DO $$
|
|
BEGIN
|
|
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'custom_instance_user') THEN
|
|
ALTER ROLE custom_instance_user REPLICATION;
|
|
END IF;
|
|
|
|
DROP ROLE IF EXISTS custom_instance_replication_user;
|
|
|
|
DELETE FROM global_settings WHERE name = 'custom_instance_replication_pwd';
|
|
EXCEPTION
|
|
WHEN others THEN
|
|
RAISE NOTICE 'custom_instance_replication_user down-migration error, skipping: %', SQLERRM;
|
|
END
|
|
$$;
|