@deinossrl/dgp-agent 1.4.56 → 1.4.57

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog - DGP Agent
2
2
 
3
+ ## [1.4.57] - 2026-01-12
4
+
5
+ ### Fixed
6
+ - Agregado `--if-exists` a pg_restore para evitar errores con DROP de objetos inexistentes
7
+ - `--exit-on-error` ahora solo se usa si skip_errors es false
8
+ - Resuelve error "policy does not exist" durante restore
9
+
3
10
  ## [1.4.56] - 2026-01-12
4
11
 
5
12
  ### Fixed
package/index.mjs CHANGED
@@ -1987,6 +1987,7 @@ async function executePgRestore(command) {
1987
1987
  // Opciones de restore
1988
1988
  if (clean_before_restore) {
1989
1989
  pgRestoreArgs.push('--clean');
1990
+ pgRestoreArgs.push('--if-exists'); // Solo borrar si existe (evita errores)
1990
1991
  }
1991
1992
 
1992
1993
  if (restore_type === 'schema_only') {
@@ -1995,8 +1996,16 @@ async function executePgRestore(command) {
1995
1996
  pgRestoreArgs.push('--data-only');
1996
1997
  }
1997
1998
 
1998
- // No detener en errores (útil para restauraciones parciales)
1999
- pgRestoreArgs.push('--exit-on-error');
1999
+ // Siempre agregar --if-exists para evitar errores con DROP
2000
+ if (!clean_before_restore) {
2001
+ pgRestoreArgs.push('--if-exists');
2002
+ }
2003
+
2004
+ // Solo detener en errores si skip_errors es false
2005
+ if (!params.skip_errors) {
2006
+ pgRestoreArgs.push('--exit-on-error');
2007
+ }
2008
+
2000
2009
  pgRestoreArgs.push('--no-owner');
2001
2010
  pgRestoreArgs.push('--no-privileges');
2002
2011
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deinossrl/dgp-agent",
3
- "version": "1.4.56",
3
+ "version": "1.4.57",
4
4
  "description": "Agente local para Despliegue-GPT - Reporta el estado del repositorio Git a la plataforma TenMinute IA",
5
5
  "main": "index.mjs",
6
6
  "bin": {