From d49bb5060795fb3127323cb64dd635c7c75d581b Mon Sep 17 00:00:00 2001 From: Pavel Stratil Date: Sun, 19 May 2024 19:13:24 +0200 Subject: [PATCH] rework actions table --- glued/Config/Pgsql/20240331205651_actions.sql | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/glued/Config/Pgsql/20240331205651_actions.sql b/glued/Config/Pgsql/20240331205651_actions.sql index 70d1af2..f76c962 100644 --- a/glued/Config/Pgsql/20240331205651_actions.sql +++ b/glued/Config/Pgsql/20240331205651_actions.sql @@ -8,23 +8,18 @@ CREATE TABLE glued.if__actions ( updated_at timestamp with time zone default CURRENT_TIMESTAMP, svc_name text generated always as (doc->>'service.name') stored, svc_version text generated always as (doc->>'service.version') stored, - svc_version text generated always as (doc->>'service.version') stored, - - us_version varchar(255), - us_method varchar(255), - deployment_uuid uuid NOT NULL, - props jsonb NULL, - nonce bytea GENERATED ALWAYS AS ( decode( md5( (deployment_uuid || us_version || us_method || props )::text ), 'hex')) STORED, + svc_method text generated always as (doc->>'service.method') stored, + svc_deployment uuid generated always as (((doc ->> 'service.deployment'::text))::uuid) stored not null, PRIMARY KEY (uuid), UNIQUE (nonce), - FOREIGN KEY (deployment_uuid) REFERENCES glued.if__deployments(uuid) + FOREIGN KEY (svc_deployment) REFERENCES glued.if__deployments(uuid) ); COMMENT ON TABLE glued.if__actions IS 'IF service actions are service methods available in an deployment configuration/authorization context.'; -COMMENT ON COLUMN glued.if__actions.us_name IS 'IF microservice name (i.e. gov_ares_cz)'; -COMMENT ON COLUMN glued.if__actions.us_version IS 'IF microservice version (i.e. v1)'; -COMMENT ON COLUMN glued.if__actions.us_method IS 'IF microservice method (i.e. search)'; -COMMENT ON COLUMN glued.if__actions.deployment_uuid IS 'IF Deployment reference, a.k.a. the configuration/authorization context to a microservice'; +COMMENT ON COLUMN glued.if__actions.svc_name IS 'IF microservice name (i.e. gov_ares_cz)'; +COMMENT ON COLUMN glued.if__actions.svc_version IS 'IF microservice version (i.e. v1)'; +COMMENT ON COLUMN glued.if__actions.svc_method IS 'IF microservice method (i.e. search)'; +COMMENT ON COLUMN glued.if__actions.svc_deployment IS 'IF Deployment reference, a.k.a. the configuration/authorization context to a microservice'; -- migrate:down