fix: turn log type from text to jsonb
This commit is contained in:
		
							parent
							
								
									4b37de9ec5
								
							
						
					
					
						commit
						7ae25aa162
					
				
							
								
								
									
										2
									
								
								web/drizzle/0049_sweet_hex.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								web/drizzle/0049_sweet_hex.sql
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,2 @@
 | 
			
		||||
ALTER TABLE "comfyui_deploy"."workflow_runs" DROP COLUMN "run_log";
 | 
			
		||||
ALTER TABLE "comfyui_deploy"."workflow_runs" ADD COLUMN "run_log" jsonb;
 | 
			
		||||
							
								
								
									
										1305
									
								
								web/drizzle/meta/0049_snapshot.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1305
									
								
								web/drizzle/meta/0049_snapshot.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -344,6 +344,13 @@
 | 
			
		||||
      "when": 1706600255919,
 | 
			
		||||
      "tag": "0048_dear_korath",
 | 
			
		||||
      "breakpoints": true
 | 
			
		||||
    },
 | 
			
		||||
    {
 | 
			
		||||
      "idx": 49,
 | 
			
		||||
      "version": "5",
 | 
			
		||||
      "when": 1706631744127,
 | 
			
		||||
      "tag": "0049_sweet_hex",
 | 
			
		||||
      "breakpoints": true
 | 
			
		||||
    }
 | 
			
		||||
  ]
 | 
			
		||||
}
 | 
			
		||||
@ -35,6 +35,15 @@ export async function POST(request: Request) {
 | 
			
		||||
          run_log: log_data,
 | 
			
		||||
        })
 | 
			
		||||
        .where(eq(workflowRunsTable.id, run_id));
 | 
			
		||||
 | 
			
		||||
      return NextResponse.json(
 | 
			
		||||
        {
 | 
			
		||||
          message: "success",
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          status: 200,
 | 
			
		||||
        },
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (status == "started" && time != undefined) {
 | 
			
		||||
 | 
			
		||||
@ -76,9 +76,7 @@ export async function RunDisplay({
 | 
			
		||||
          <RunInputs run={run} />
 | 
			
		||||
          <Suspense>
 | 
			
		||||
            <RunOutputs run_id={run.id} />
 | 
			
		||||
            {run.run_log && (
 | 
			
		||||
              <LogsViewer logs={JSON.parse(run.run_log) as LogsType} />
 | 
			
		||||
            )}
 | 
			
		||||
            {run.run_log && <LogsViewer logs={run.run_log} />}
 | 
			
		||||
          </Suspense>
 | 
			
		||||
        </div>
 | 
			
		||||
        {/* <div className="max-h-96 overflow-y-scroll">{view}</div> */}
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
import { LogsType } from "@/components/LogsViewer";
 | 
			
		||||
import { CivitaiModelResponse } from "@/types/civitai";
 | 
			
		||||
import { type InferSelectModel, relations } from "drizzle-orm";
 | 
			
		||||
import {
 | 
			
		||||
@ -173,7 +174,7 @@ export const workflowRunsTable = dbSchema.table("workflow_runs", {
 | 
			
		||||
  machine_type: machinesType("machine_type"),
 | 
			
		||||
  user_id: text("user_id"),
 | 
			
		||||
  org_id: text("org_id"),
 | 
			
		||||
  run_log: text("run_log"),
 | 
			
		||||
  run_log: jsonb("run_log").$type<LogsType>(),
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
export const workflowRunRelations = relations(
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user