-- WASM plugin runtime hardening

CREATE EXTENSION IF NOT EXISTS pgcrypto;

ALTER TABLE plugins
ADD COLUMN IF NOT EXISTS default_settings JSONB NOT NULL DEFAULT '{}'::jsonb;

ALTER TABLE community_plugin_packages
ADD COLUMN IF NOT EXISTS settings JSONB NOT NULL DEFAULT '{}'::jsonb;

CREATE INDEX IF NOT EXISTS idx_community_plugin_packages_active
ON community_plugin_packages(community_id, is_active);
