b3a76833aa84a341e86d0bacef2ff1f6b9b44851 hiram Thu Apr 23 14:30:24 2026 -0700 rename workflowId column to buildDir and expand its size refs #31811 diff --git src/hg/lib/ottoRequest.c src/hg/lib/ottoRequest.c index e14b310e94f..2347b58c3c9 100644 --- src/hg/lib/ottoRequest.c +++ src/hg/lib/ottoRequest.c @@ -1,43 +1,43 @@ /* ottoRequest.c was originally generated by the autoSql program, which also * generated ottoRequest.h and ottoRequest.sql. This module links the database and * the RAM representation of objects. */ #include "common.h" #include "linefile.h" #include "dystring.h" #include "jksql.h" #include "ottoRequest.h" -char *ottoRequestCommaSepFieldNames = "id,requestType,fromDb,toDb,email,comment,requestTime,doneStatus,workflowId,completeTime"; +char *ottoRequestCommaSepFieldNames = "id,requestType,fromDb,toDb,email,comment,requestTime,doneStatus,buildDir,completeTime"; void ottoRequestStaticLoad(char **row, struct ottoRequest *ret) /* Load a row from ottoRequest table into ret. The contents of ret will * be replaced at the next call to this function. */ { ret->id = sqlUnsigned(row[0]); ret->requestType = row[1]; ret->fromDb = row[2]; ret->toDb = row[3]; ret->email = row[4]; ret->comment = row[5]; ret->requestTime = row[6]; ret->doneStatus = sqlUnsigned(row[7]); -ret->workflowId = row[8]; +ret->buildDir = row[8]; ret->completeTime = row[9]; } struct ottoRequest *ottoRequestLoadByQuery(struct sqlConnection *conn, char *query) /* Load all ottoRequest from table that satisfy the query given. * Where query is of the form 'select * from example where something=something' * or 'select example.* from example, anotherTable where example.something = * anotherTable.something'. * Dispose of this with ottoRequestFreeList(). */ { struct ottoRequest *list = NULL, *el; struct sqlResult *sr; char **row; sr = sqlGetResult(conn, query); @@ -48,51 +48,51 @@ } slReverse(&list); sqlFreeResult(&sr); return list; } void ottoRequestSaveToDb(struct sqlConnection *conn, struct ottoRequest *el, char *tableName, int updateSize) /* Save ottoRequest as a row to the table specified by tableName. * As blob fields may be arbitrary size updateSize specifies the approx size * of a string that would contain the entire query. Arrays of native types are * converted to comma separated strings and loaded as such, User defined types are * inserted as NULL. This function automatically escapes quoted strings for mysql. */ { struct dyString *update = dyStringNew(updateSize); sqlDyStringPrintf(update, "insert into %s values ( %u,'%s','%s','%s','%s','%s','%s',%u,'%s','%s')", - tableName, el->id, el->requestType, el->fromDb, el->toDb, el->email, el->comment, el->requestTime, el->doneStatus, el->workflowId, el->completeTime); + tableName, el->id, el->requestType, el->fromDb, el->toDb, el->email, el->comment, el->requestTime, el->doneStatus, el->buildDir, el->completeTime); sqlUpdate(conn, update->string); dyStringFree(&update); } struct ottoRequest *ottoRequestLoad(char **row) /* Load a ottoRequest from row fetched with select * from ottoRequest * from database. Dispose of this with ottoRequestFree(). */ { struct ottoRequest *ret; AllocVar(ret); ret->id = sqlUnsigned(row[0]); ret->requestType = cloneString(row[1]); ret->fromDb = cloneString(row[2]); ret->toDb = cloneString(row[3]); ret->email = cloneString(row[4]); ret->comment = cloneString(row[5]); ret->requestTime = cloneString(row[6]); ret->doneStatus = sqlUnsigned(row[7]); -ret->workflowId = cloneString(row[8]); +ret->buildDir = cloneString(row[8]); ret->completeTime = cloneString(row[9]); return ret; } struct ottoRequest *ottoRequestLoadAll(char *fileName) /* Load all ottoRequest from a whitespace-separated file. * Dispose of this with ottoRequestFreeList(). */ { struct ottoRequest *list = NULL, *el; struct lineFile *lf = lineFileOpen(fileName, TRUE); char *row[10]; while (lineFileRow(lf, row)) { el = ottoRequestLoad(row); @@ -126,50 +126,50 @@ * This will fill in ret if non-null, otherwise will * return a new ottoRequest */ { char *s = *pS; if (ret == NULL) AllocVar(ret); ret->id = sqlUnsignedComma(&s); ret->requestType = sqlStringComma(&s); ret->fromDb = sqlStringComma(&s); ret->toDb = sqlStringComma(&s); ret->email = sqlStringComma(&s); ret->comment = sqlStringComma(&s); ret->requestTime = sqlStringComma(&s); ret->doneStatus = sqlUnsignedComma(&s); -ret->workflowId = sqlStringComma(&s); +ret->buildDir = sqlStringComma(&s); ret->completeTime = sqlStringComma(&s); *pS = s; return ret; } void ottoRequestFree(struct ottoRequest **pEl) /* Free a single dynamically allocated ottoRequest such as created * with ottoRequestLoad(). */ { struct ottoRequest *el; if ((el = *pEl) == NULL) return; freeMem(el->requestType); freeMem(el->fromDb); freeMem(el->toDb); freeMem(el->email); freeMem(el->comment); freeMem(el->requestTime); -freeMem(el->workflowId); +freeMem(el->buildDir); freeMem(el->completeTime); freez(pEl); } void ottoRequestFreeList(struct ottoRequest **pList) /* Free a list of dynamically allocated ottoRequest's */ { struct ottoRequest *el, *next; for (el = *pList; el != NULL; el = next) { next = el->next; ottoRequestFree(&el); } *pList = NULL; @@ -195,31 +195,31 @@ if (sep == ',') fputc('"',f); fprintf(f, "%s", el->email); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->comment); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->requestTime); if (sep == ',') fputc('"',f); fputc(sep,f); fprintf(f, "%u", el->doneStatus); fputc(sep,f); if (sep == ',') fputc('"',f); -fprintf(f, "%s", el->workflowId); +fprintf(f, "%s", el->buildDir); if (sep == ',') fputc('"',f); fputc(sep,f); if (sep == ',') fputc('"',f); fprintf(f, "%s", el->completeTime); if (sep == ',') fputc('"',f); fputc(lastSep,f); } void ottoRequestJsonOutput(struct ottoRequest *el, FILE *f) /* Print out ottoRequest in JSON format. */ { fputc('{',f); fputc('"',f); fprintf(f,"id"); fputc('"',f); @@ -269,34 +269,34 @@ fputc('"',f); fprintf(f,"requestTime"); fputc('"',f); fputc(':',f); fputc('"',f); fprintf(f, "%s", el->requestTime); fputc('"',f); fputc(',',f); fputc('"',f); fprintf(f,"doneStatus"); fputc('"',f); fputc(':',f); fprintf(f, "%u", el->doneStatus); fputc(',',f); fputc('"',f); -fprintf(f,"workflowId"); +fprintf(f,"buildDir"); fputc('"',f); fputc(':',f); fputc('"',f); -fprintf(f, "%s", el->workflowId); +fprintf(f, "%s", el->buildDir); fputc('"',f); fputc(',',f); fputc('"',f); fprintf(f,"completeTime"); fputc('"',f); fputc(':',f); fputc('"',f); fprintf(f, "%s", el->completeTime); fputc('"',f); fputc('}',f); } /* -------------------------------- End autoSql Generated Code -------------------------------- */