- Add /api/portal/team.cfm for employee listing - Add chat endpoints (getMessages, sendMessage, markRead, getActiveChat) - Add OTP authentication endpoints - Add address management endpoints (delete, setDefault, states) - Add task completion and chat task endpoints - Update Application.cfm allowlist Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
66 lines
2.1 KiB
Text
66 lines
2.1 KiB
Text
<cfsetting showdebugoutput="false">
|
|
<cfsetting enablecfoutputonly="true">
|
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
|
|
|
<cfscript>
|
|
// Add TaskSourceType and TaskSourceID columns to Tasks table
|
|
// These are needed for chat persistence feature
|
|
|
|
result = { "OK": true, "STEPS": [] };
|
|
|
|
try {
|
|
// Check if columns already exist
|
|
cols = queryExecute("
|
|
SELECT COLUMN_NAME
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
WHERE TABLE_SCHEMA = 'payfrit'
|
|
AND TABLE_NAME = 'Tasks'
|
|
AND COLUMN_NAME IN ('TaskSourceType', 'TaskSourceID')
|
|
", [], { datasource: "payfrit" });
|
|
|
|
existingCols = valueList(cols.COLUMN_NAME);
|
|
arrayAppend(result.STEPS, "Existing columns: #existingCols#");
|
|
|
|
// Add TaskSourceType if missing
|
|
if (!listFindNoCase(existingCols, "TaskSourceType")) {
|
|
queryExecute("
|
|
ALTER TABLE Tasks ADD COLUMN TaskSourceType VARCHAR(50) NULL
|
|
", [], { datasource: "payfrit" });
|
|
arrayAppend(result.STEPS, "Added TaskSourceType column");
|
|
} else {
|
|
arrayAppend(result.STEPS, "TaskSourceType already exists");
|
|
}
|
|
|
|
// Add TaskSourceID if missing
|
|
if (!listFindNoCase(existingCols, "TaskSourceID")) {
|
|
queryExecute("
|
|
ALTER TABLE Tasks ADD COLUMN TaskSourceID INT NULL
|
|
", [], { datasource: "payfrit" });
|
|
arrayAppend(result.STEPS, "Added TaskSourceID column");
|
|
} else {
|
|
arrayAppend(result.STEPS, "TaskSourceID already exists");
|
|
}
|
|
|
|
// Verify columns now exist
|
|
verifyQuery = queryExecute("
|
|
SELECT COLUMN_NAME, DATA_TYPE
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
WHERE TABLE_SCHEMA = 'payfrit'
|
|
AND TABLE_NAME = 'Tasks'
|
|
AND COLUMN_NAME IN ('TaskSourceType', 'TaskSourceID')
|
|
", [], { datasource: "payfrit" });
|
|
|
|
result.COLUMNS = [];
|
|
for (row in verifyQuery) {
|
|
arrayAppend(result.COLUMNS, { "name": row.COLUMN_NAME, "type": row.DATA_TYPE });
|
|
}
|
|
|
|
arrayAppend(result.STEPS, "Migration complete");
|
|
|
|
} catch (any e) {
|
|
result.OK = false;
|
|
result.ERROR = e.message;
|
|
}
|
|
|
|
writeOutput(serializeJSON(result));
|
|
</cfscript>
|