feat(web): add display number for workflow
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import { db } from "@/db/db";
|
||||
import { deploymentsTable, workflowRunsTable } from "@/db/schema";
|
||||
import { desc, eq } from "drizzle-orm";
|
||||
import { desc, eq, sql } from "drizzle-orm";
|
||||
|
||||
export async function findAllRuns(workflow_id: string) {
|
||||
return await db.query.workflowRunsTable.findMany({
|
||||
where: eq(workflowRunsTable.workflow_id, workflow_id),
|
||||
orderBy: desc(workflowRunsTable.created_at),
|
||||
limit: 10,
|
||||
extras: {
|
||||
"number": sql<number>`row_number() over (order by created_at)`.as("number"),
|
||||
},
|
||||
with: {
|
||||
machine: {
|
||||
columns: {
|
||||
|
||||
Reference in New Issue
Block a user