# -*- coding: utf-8 -*-
# Copyright (c) 2020, JINGROW
# For license information, please see license.txt

import jingrow
from jingrow.model.page import Page


class AgentJobStep(Page):
	# begin: auto-generated types
	# This code is auto-generated. Do not modify anything in this block.

	from typing import TYPE_CHECKING

	if TYPE_CHECKING:
		from jingrow.types import DF

		agent_job: DF.Link
		data: DF.Code | None
		duration: DF.Time | None
		end: DF.Datetime | None
		output: DF.Code | None
		start: DF.Datetime | None
		status: DF.Literal[
			"Pending", "Running", "Success", "Failure", "Skipped", "Delivery Failure"
		]
		step_name: DF.Data
		traceback: DF.Code | None
	# end: auto-generated types


def on_pagetype_update():
	# We don't need modified index, it's harmful on constantly updating tables
	jingrow.db.sql_ddl("drop index if exists modified on `tabAgent Job Step`")
	jingrow.db.add_index("Agent Job Step", ["creation"])
