@oktis-works/database 0.4.20 → 0.4.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema/schema.sql +8 -0
- package/package.json +1 -1
package/dist/schema/schema.sql
CHANGED
|
@@ -495,6 +495,14 @@ CREATE TABLE IF NOT EXISTS webhooks (
|
|
|
495
495
|
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
|
|
496
496
|
);
|
|
497
497
|
|
|
498
|
+
-- Autenticação configurável para webhooks. Os campos antigos continuam sendo
|
|
499
|
+
-- mantidos para que instalações existentes migrem sem perder seus segredos.
|
|
500
|
+
ALTER TABLE webhooks ADD COLUMN IF NOT EXISTS auth_type VARCHAR(30) NOT NULL DEFAULT 'hmac_sha256';
|
|
501
|
+
ALTER TABLE webhooks ADD COLUMN IF NOT EXISTS auth_config JSONB NOT NULL DEFAULT '{}'::jsonb;
|
|
502
|
+
UPDATE webhooks
|
|
503
|
+
SET auth_config = jsonb_build_object('secret', secret)
|
|
504
|
+
WHERE auth_type = 'hmac_sha256' AND auth_config = '{}'::jsonb AND secret <> '';
|
|
505
|
+
|
|
498
506
|
CREATE INDEX IF NOT EXISTS idx_webhooks_tenant ON webhooks(tenant_id);
|
|
499
507
|
|
|
500
508
|
-- ============================================================
|