CREATE TABLE `ur_ingest_session_task` (
`ur_ingest_session_task_id` text PRIMARY KEY NOT NULL,
`ingest_session_id` text NOT NULL,
`uniform_resource_id` text,
`captured_executable` text NOT NULL,
`ur_status` text,
`ur_diagnostics` text,
`ur_transformations` text,
`elaboration` text,
`created_at` TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
`created_by` text DEFAULT 'UNKNOWN',
`updated_at` TIMESTAMPTZ,
`updated_by` text,
`deleted_at` TIMESTAMPTZ,
`deleted_by` text,
`activity_log` text,
FOREIGN KEY (`ingest_session_id`) REFERENCES `ur_ingest_session`(`ur_ingest_session_id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`uniform_resource_id`) REFERENCES `uniform_resource`(`uniform_resource_id`) ON UPDATE no action ON DELETE no action,
CONSTRAINT "captured_executable_check_valid_json" CHECK(json_valid("ur_ingest_session_task"."captured_executable") OR "ur_ingest_session_task"."captured_executable" IS NULL),
CONSTRAINT "ur_diagnostics_check_valid_json" CHECK(json_valid("ur_ingest_session_task"."ur_diagnostics") OR "ur_ingest_session_task"."ur_diagnostics" IS NULL),
CONSTRAINT "ur_transformations_check_valid_json" CHECK(json_valid("ur_ingest_session_task"."ur_transformations") OR "ur_ingest_session_task"."ur_transformations" IS NULL),
CONSTRAINT "elaboration_check_valid_json" CHECK(json_valid("ur_ingest_session_task"."elaboration") OR "ur_ingest_session_task"."elaboration" IS NULL)
)