SET lock_timeout = '10s';
SET statement_timeout = '120000';

ALTER TABLE platform.notas_internas
    DROP CONSTRAINT IF EXISTS notas_internas_pkey;

ALTER TABLE platform.notas_internas
    ADD CONSTRAINT IF NOT EXISTS notas_cliente_pkey
    PRIMARY KEY (id_nota);

ALTER TABLE commerce.planes_pago
    DROP CONSTRAINT IF EXISTS planes_pago_pkey;

ALTER TABLE commerce.planes_pago
    ADD CONSTRAINT IF NOT EXISTS pk_planes_pago
    PRIMARY KEY (id_plan);

ALTER TABLE commerce.pagos_planes
    DROP CONSTRAINT IF EXISTS pagos_planes_pkey;

ALTER TABLE commerce.pagos_planes
    ADD CONSTRAINT IF NOT EXISTS pk_pagos_planes
    PRIMARY KEY (id_pago);

ANALYZE platform.notas_internas;
ANALYZE commerce.planes_pago;
ANALYZE commerce.pagos_planes;
