-- -------------------------------------------------------------
-- TablePlus 6.7.0(634)
--
-- https://tableplus.com/
--
-- Database: sx_db_1751480457
-- Generation Time: 2025-09-12 12:26:48.5890
-- -------------------------------------------------------------


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


CREATE TABLE `projecttasks` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `refid` bigint(20) unsigned DEFAULT NULL,
  `synced` tinyint(1) NOT NULL DEFAULT 0,
  `external_id` varchar(255) DEFAULT NULL,
  `formid` bigint(20) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `eventid` int(11) DEFAULT NULL,
  `fields` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`fields`)),
  `tag` varchar(255) DEFAULT NULL,
  `subtasks` tinyint(1) NOT NULL DEFAULT 0,
  `isparent` tinyint(1) NOT NULL DEFAULT 0,
  `project` bigint(20) unsigned DEFAULT NULL,
  `parent` bigint(20) unsigned DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `priority` varchar(255) DEFAULT NULL,
  `constrainttype` varchar(255) DEFAULT NULL,
  `actualwork` decimal(8,2) DEFAULT NULL,
  `allocatedwork` decimal(8,2) DEFAULT NULL,
  `calculatedwork` decimal(8,2) DEFAULT NULL,
  `remainingwork` decimal(8,2) DEFAULT NULL,
  `percenttimecomplete` decimal(6,2) DEFAULT NULL,
  `startdate` varchar(50) DEFAULT NULL,
  `enddate` varchar(50) DEFAULT NULL,
  `ganttenddate` varchar(50) DEFAULT NULL,
  `finishbydate` varchar(50) DEFAULT NULL,
  `nonbillabletask` tinyint(1) NOT NULL DEFAULT 0,
  `message` text DEFAULT NULL,
  `created_by` bigint(20) DEFAULT -1,
  `owner` bigint(20) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `plannedwork` decimal(8,2) DEFAULT NULL,
  `custfield1` varchar(255) DEFAULT '',
  `custfield2` varchar(255) NOT NULL DEFAULT '0.0',
  `custfield3` varchar(255) DEFAULT '',
  `custfield_project_lead` varchar(255) DEFAULT '',
  `custfield4` varchar(255) DEFAULT '',
  `custfield5` varchar(255) DEFAULT '',
  `custfield7` varchar(255) DEFAULT '',
  `custfield12` varchar(255) DEFAULT '',
  `custfield13` varchar(255) DEFAULT '',
  `custfield14` varchar(255) DEFAULT '',
  `custfield15` varchar(255) DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `projecttasks_refid_synced_unique` (`refid`,`synced`),
  KEY `projecttasks_created_by_foreign` (`created_by`),
  KEY `projecttasks_refid_index` (`refid`),
  KEY `projecttasks_formid_foreign` (`formid`),
  KEY `projecttasks_external_id_index` (`external_id`),
  CONSTRAINT `projecttasks_created_by_foreign` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL,
  CONSTRAINT `projecttasks_formid_foreign` FOREIGN KEY (`formid`) REFERENCES `entry_forms` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=14855 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;