RESOLVES FRMW-2832 RESOLVES FRMW-2833 **What** Migrate workflow engines to DML. Alos includes and update to the linkable generation which now takes into account id and primary keys to generate the linkable instead of only primary keys
31 lines
755 B
TypeScript
31 lines
755 B
TypeScript
import { TransactionState } from "@medusajs/framework/orchestration"
|
|
import { model } from "@medusajs/framework/utils"
|
|
|
|
export const WorkflowExecution = model
|
|
.define("workflow_execution", {
|
|
id: model.id({ prefix: "wf_exec" }),
|
|
workflow_id: model.text().primaryKey(),
|
|
transaction_id: model.text().primaryKey(),
|
|
execution: model.json().nullable(),
|
|
context: model.json().nullable(),
|
|
state: model.enum(TransactionState),
|
|
})
|
|
.indexes([
|
|
{
|
|
on: ["id"],
|
|
where: "deleted_at IS NULL",
|
|
},
|
|
{
|
|
on: ["workflow_id"],
|
|
where: "deleted_at IS NULL",
|
|
},
|
|
{
|
|
on: ["transaction_id"],
|
|
where: "deleted_at IS NULL",
|
|
},
|
|
{
|
|
on: ["state"],
|
|
where: "deleted_at IS NULL",
|
|
},
|
|
])
|