no more debu legacy

This commit is contained in:
Lucas Tettamanti
2026-01-06 23:42:12 -03:00
parent 8bb21b4edb
commit ce96df9e30
8 changed files with 214 additions and 25 deletions

81
querys.md Normal file
View File

@@ -0,0 +1,81 @@
-- INSERT INTO tenants (key, name)
-- VALUES ('piaf', 'Piaf')
-- RETURNING id;
-- select * from tenants;
-- truncate table tenants cascade;
-- eb71b9a7-9ccf-430e-9b25-951a0c589c0f
-- select * from tenant_ecommerce_config;
-- -- truncate table tenant_ecommerce_config cascade;
-- SELECT set_config('app.encryption_key', 'p1ficolosal3443aAaA', false);
-- INSERT INTO tenant_ecommerce_config (
-- tenant_id,
-- provider,
-- base_url,
-- credential_ref,
-- api_version,
-- timeout_ms,
-- enabled,
-- enc_consumer_key,
-- enc_consumer_secret
-- ) VALUES (
-- 'eb71b9a7-9ccf-430e-9b25-951a0c589c0f'::uuid,
-- 'woo',
-- '<https://piaf.floda.dev/wp-json/wc/v3>',
-- 'secret://woo/piaf',
-- 'wc/v3',
-- 8000,
-- true,
-- pgp_sym_encrypt('ck_241b030c4addffcd5051dd048dccbd00601915e5', current_setting('app.encryption_key')),
-- pgp_sym_encrypt('cs_2fcae6ecc526b1f38f686a19132efa5ac83cb036', current_setting('app.encryption_key'))
-- );
-- -- Mover config al tenant correcto
-- UPDATE tenant_ecommerce_config
-- SET tenant_id = 'af906a3a-bd47-4202-8f68-6dac48d33570'
-- WHERE tenant_id = 'eb71b9a7-9ccf-430e-9b25-951a0c589c0f';
-- (Opcional) borrar el tenant duplicado en minúsculas si ya no lo usas
-- DELETE FROM tenants WHERE id = 'c32c7b51-ea17-470c-8cab-040e75bdca88';
-- INSERT INTO wa_identity_map (
-- tenant_id,
-- wa_chat_id,
-- provider,
-- external_customer_id,
-- created_at,
-- updated_at
-- ) VALUES (
-- 'eb71b9a7-9ccf-430e-9b25-951a0c589c0f', -- tu tenant_id
-- '<5491133230322@s.whatsapp.net>',
-- 'woo',
-- 28506,
-- now(),
-- now()
-- )
-- ON CONFLICT (tenant_id, wa_chat_id)
-- DO UPDATE SET
-- provider = EXCLUDED.provider,
-- external_customer_id = EXCLUDED.external_customer_id,
-- updated_at = now();
-- select * from wa_identity_map;
-- select * from woo_products_cache;
-- BEGIN;
-- TRUNCATE TABLE
-- wa_messages,
-- conversation_runs,
-- wa_conversation_state,
-- wa_identity_map
-- RESTART IDENTITY
-- CASCADE;
-- COMMIT;
-- select * from wa_identity_map;