mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-18 16:02:10 +00:00
fix: Fix custom instance user migration (#7534)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
-- Add down migration script here
|
||||
@@ -0,0 +1,17 @@
|
||||
DO $$
|
||||
DECLARE
|
||||
dbname text := current_database();
|
||||
BEGIN
|
||||
-- Revoke default privileges first
|
||||
ALTER DEFAULT PRIVILEGES IN SCHEMA public
|
||||
REVOKE SELECT, INSERT, UPDATE, DELETE ON TABLES FROM custom_instance_user;
|
||||
REVOKE CREATE ON SCHEMA public FROM custom_instance_user;
|
||||
REVOKE USAGE ON SCHEMA public FROM custom_instance_user;
|
||||
EXECUTE format('REVOKE CREATE ON DATABASE %I FROM custom_instance_user', dbname);
|
||||
EXECUTE format('REVOKE CONNECT ON DATABASE %I FROM custom_instance_user', dbname);
|
||||
EXCEPTION
|
||||
WHEN others THEN
|
||||
RAISE NOTICE 'Error in custom_instance_user migration: %', SQLERRM;
|
||||
-- Continue without failing the migration
|
||||
END
|
||||
$$;
|
||||
@@ -56,6 +56,7 @@ lazy_static::lazy_static! {
|
||||
(20251105100125, include_str!(
|
||||
"../../migrations/20251105100125_legacy_sql_result_flag.up.sql"
|
||||
).replace("✅", "")),
|
||||
(20260107133344, "".to_string()),
|
||||
].into_iter().collect();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user