feat: add MANZANA migration job and update related processing logic

This commit is contained in:
2026-04-08 10:16:27 -05:00
parent 3765e8adb3
commit 75b04d4b2e
5 changed files with 19 additions and 18 deletions

View File

@@ -13,13 +13,18 @@ import (
log "github.com/sirupsen/logrus"
)
var manzanaJob = MigrationJob{
Schema: "Cartografia",
Table: "MANZANA",
}
func getMaxGDBArchiveOid(ctx context.Context, db *sql.DB) (int, error) {
var maxOid sql.NullInt64
query := fmt.Sprintf(`
SELECT ISNULL(MAX(GDB_ARCHIVE_OID), 0)
FROM [%s].[%s]
`, schema, table)
`, manzanaJob.Schema, manzanaJob.Table)
err := db.QueryRowContext(ctx, query).Scan(&maxOid)
if err != nil && err != sql.ErrNoRows {
@@ -211,12 +216,7 @@ func seedManzanas(ctx context.Context, db *sql.DB) error {
"OBJECTID",
}
job := MigrationJob{
Schema: schema,
Table: table,
}
if err := loadRowsMssql(ctx, job, columns, db, rowsChan); err != nil {
if err := loadRowsMssql(ctx, manzanaJob, columns, db, rowsChan); err != nil {
return fmt.Errorf("Error loading rows (MANZANA): %w", err)
}