Files
windmill/backend/migrations/20250205131513_http_static_websites.up.sql
HugoCasa 48e4ae6561 feat: serve static websites (#5218)
* feat: serve static websites

* nit

* sqlx

* nit

* nits

* nits

* nits

* nits
2025-02-06 17:38:12 +01:00

12 lines
384 B
PL/PgSQL

ALTER TABLE http_trigger ADD COLUMN is_static_website BOOLEAN NOT NULL DEFAULT FALSE;
CREATE OR REPLACE FUNCTION prevent_route_path_change()
RETURNS TRIGGER AS $$
BEGIN
IF CURRENT_USER = 'windmill_user' AND NEW.route_path <> OLD.route_path THEN
RAISE EXCEPTION 'Modification of route_path is only allowed by admins';
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;