CREATE TABLE `ur_ingest_session_plm_acct_project_issue` (
`ur_ingest_session_plm_acct_project_issue_id` text PRIMARY KEY NOT NULL,
`ingest_session_id` text NOT NULL,
`ur_ingest_session_plm_acct_project_id` text NOT NULL,
`uniform_resource_id` text,
`issue_id` text NOT NULL,
`issue_number` integer,
`parent_issue_id` text,
`title` text NOT NULL,
`body` text,
`body_text` text,
`body_html` text,
`state` text NOT NULL,
`assigned_to` text,
`user` text NOT NULL,
`url` text NOT NULL,
`closed_at` text,
`issue_type_id` text,
`time_estimate` integer,
`aggregate_time_estimate` integer,
`time_original_estimate` integer,
`time_spent` integer,
`aggregate_time_spent` integer,
`aggregate_time_original_estimate` integer,
`workratio` integer,
`current_progress` integer,
`total_progress` integer,
`resolution_name` text,
`resolution_date` 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 (`ur_ingest_session_plm_acct_project_id`) REFERENCES `ur_ingest_session_plm_acct_project`(`ur_ingest_session_plm_acct_project_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,
FOREIGN KEY (`user`) REFERENCES `ur_ingest_session_plm_user`(`ur_ingest_session_plm_user_id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`issue_type_id`) REFERENCES `ur_ingest_session_plm_issue_type`(`ur_ingest_session_plm_issue_type_id`) ON UPDATE no action ON DELETE no action
)