Buenas!Estamos actualizando Diaguita desde 4.1.0 a 4.2.0.al momento de actualizar, nos da el siguiente error:
PHP Fatal error: Uncaught Exception: Error realizando la migración. No se pudo realizar la conversión de la base de datos para la versión 4.2.0, ejecutando el archivo de conversión /srv/SIU-Diaguita-4.2.0.1_testing/sql/repositorio_conversion/4.2.0.sql SQL ERROR: SQLSTATE[55000]: Object not in prerequisite state: 7 ERROR: sequence must have same owner as table it is linked to SET CONSTRAINTS ALL IMMEDIATE; SET search_path = diaguita; SET client_encoding = ‘LATIN1’; INSERT INTO par_version (descripcion, fecha) VALUES (‘4.2.0’,now()); /* #50603 / INSERT INTO diaguita.anx_codigos_postales VALUES (‘1914’, 50410) ON CONFLICT (codigo_postal,localidad) DO NOTHING; / #50525 */ SET search_path=ofertas; – SEQUENCE: ofertas.adjuntos_oferta_id_adjunto_oferta_seq – DROP SEQUENCE IF EXISTS ofertas.adjuntos_oferta_id_adjunto_oferta_seq; CREATE SEQUENCE IF NOT EXISTS ofertas.adjuntos_oferta_id_adjunto_oferta_seq INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1; ALTER SEQUENCE ofertas.adjuntos_oferta_id_adjunto_oferta_seq OWNED BY ofertas.renglones_ofertas.id_renglon_oferta; – Table: ofertas.adjuntos_oferta – DROP TABLE IF EXISTS ofertas.adjuntos_oferta; CREATE TABLE IF NOT EXISTS ofertas.adjuntos_… in /srv/SIU-Diaguita-4.2.0.1_testing/php/extension_toba/diaguita_modelo.php:344 Stack trace: #0 /srv/SIU-Diaguita-4.2.0.1_testing/php/extension_toba/diaguita_comando.php(1537): diaguita_modelo->migrar() #1 /srv/SIU-Diaguita-4.2.0.1_testing/vendor/siu-toba/framework/php/consola/comandos/comando_proyecto.php(87): diaguita_comando->opcion__migrar() #2 /srv/SIU-Diaguita-4.2.0.1_testing/vendor/siu-toba/framework/php/consola/comando.php(90): comando_proyecto->ejecutar_opcion() #3 /srv/SIU-Diaguita-4.2.0.1_testing/vendor/siu-toba/framework/php/consola/consola.php(78): comando->procesar() #4 /srv/SIU-Diaguita-4.2.0.1_testing/vendor/siu-toba/framework/php/consola/consola.php(55): consola->invocar_comando() #5 /srv/SIU-Diaguita-4.2.0.1_testing/vendor/siu-toba/framework/php/consola/run.php(32): consola->run() #6 /srv/SIU-Diaguita-4.2.0.1_testing/vendor/siu-toba/framework/bin/launcher.php(31): require_once(‘…’) #7 /srv/SIU-Diaguita-4.2.0.1_testing/vendor/siu-toba/framework/bin/toba(2): require_once(‘…’) #8 {main} thrown in /srv/SIU-Diaguita-4.2.0.1_testing/php/extension_toba/diaguita_modelo.php on line 344
En la base, la consulta que lo genera es la siguiente:
2026-01-29 09:12:52.034 -03 [401425] us_diaguita@diaguita_testing ERROR: sequence must have same owner as table it is linked to
2026-01-29 09:12:52.034 -03 [401425] us_diaguita@diaguita_testing STATEMENT:
SET CONSTRAINTS ALL IMMEDIATE;
SET search_path = diaguita;
SET client_encoding = ‘LATIN1’;
INSERT INTO par_version (descripcion, fecha) VALUES (‘4.2.0’,now());
/*
#50603
*/
INSERT INTO diaguita.anx_codigos_postales VALUES (‘1914’, 50410) ON CONFLICT (codigo_postal,localidad) DO NOTHING;
/*
#50525
*/
SET search_path=ofertas;
-- SEQUENCE: ofertas.adjuntos_oferta_id_adjunto_oferta_seq
-- DROP SEQUENCE IF EXISTS ofertas.adjuntos_oferta_id_adjunto_oferta_seq;
CREATE SEQUENCE IF NOT EXISTS ofertas.adjuntos_oferta_id_adjunto_oferta_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 2147483647
CACHE 1;
ALTER SEQUENCE ofertas.adjuntos_oferta_id_adjunto_oferta_seq
OWNED BY ofertas.renglones_ofertas.id_renglon_oferta;
-- Table: ofertas.adjuntos_oferta
-- DROP TABLE IF EXISTS ofertas.adjuntos_oferta;
CREATE TABLE IF NOT EXISTS ofertas.adjuntos_oferta
(
id_adjunto_oferta integer NOT NULL DEFAULT nextval('ofertas.adjuntos_oferta_id_adjunto_oferta_seq'::regclass),
id_oferta integer, uid uuid NOT NULL,
uid_arai_documentos uuid,
fecha_creacion date NOT NULL,
tipo_documento character varying(50) COLLATE pg_catalog."default",
nombre character varying(255) COLLATE pg_catalog."default",
estado character varying(2) COLLATE pg_catalog."default" NOT NULL,
binario bytea,
observaciones character varying(255) COLLATE pg_catalog."default",
CONSTRAINT adjuntos_oferta_pkey PRIMARY KEY (id_adjunto_oferta),
CONSTRAINT oe_oferta_fk FOREIGN KEY (id_oferta) REFERENCES ofertas.ofertas(id_oferta)
);
SET search_path = diaguita;
/*
#50853
*/
SET search_path=ofertas;
ALTER TABLE IF EXISTS ofertas.adjuntos_oferta
ADD COLUMN numero integer DEFAULT null;
ALTER TABLE IF EXISTS ofertas.adjuntos_oferta
ADD COLUMN ejercicio integer DEFAULT null;
ALTER TABLE IF EXISTS ofertas.adjuntos_oferta
ADD COLUMN id_documento_exportacion integer DEFAULT null;
SET search_path=diaguita;
INSERT INTO scp_tipos_documentos_tipo_firma(tipo_documento, tipo_documento_descripcion, tipo_firma, id_tabla) VALUES ('AOE', 'Anexo Oferta Electrónica', 'firma', 2);
--Numerador para adjuntos
INSERT INTO scp_numeradores VALUES ('ADJUNTO_OE ', 'Adjunto oferta electrónica', 's', 'AOE');
2026-01-29 09:12:52.047 -03 [401425] us_diaguita@diaguita_testing LOG: statement: ROLLBACK WORK
En concreto:
`ALTER SEQUENCE ofertas.adjuntos_oferta_id_adjunto_oferta_seq
OWNED BY ofertas.renglones_ofertas.id_renglon_oferta;`
Alguna idea de porque pasa eso?