
CREATE TABLE `pi_temp_file_upload` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`empcode` INT(11) NOT NULL DEFAULT '0',
	`empid` INT(11) NULL DEFAULT NULL,
	`name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`designation` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`department` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`picture` TEXT NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`module` INT(11) NOT NULL DEFAULT '0',
	`payload` LONGTEXT NOT NULL COLLATE 'utf8mb4_bin',
	`uploaded_by` INT(11) NOT NULL DEFAULT '0',
	`file_name` TINYTEXT NOT NULL COLLATE 'latin1_swedish_ci',
	`created_at` DATETIME NOT NULL,
	`updated_at` DATETIME NOT NULL,
	`deleted_at` DATETIME NOT NULL,
	PRIMARY KEY (`id`) USING BTREE,
	CONSTRAINT `payload` CHECK (json_valid(`payload`))
);

 
 
CREATE TABLE `pi_temp_file_upload_error` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`empcode` INT(11) NOT NULL DEFAULT '0',
	`empid` INT(11) NULL DEFAULT NULL,
	`name` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`designation` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`department` VARCHAR(50) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`picture` TEXT NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
	`module` INT(11) NOT NULL DEFAULT '0',
	`error_text` VARCHAR(50) NOT NULL DEFAULT '0' COLLATE 'latin1_swedish_ci',
	`payload` LONGTEXT NOT NULL COLLATE 'utf8mb4_bin',
	`uploaded_by` INT(11) NOT NULL DEFAULT '0',
	`file_name` TINYTEXT NOT NULL COLLATE 'latin1_swedish_ci',
	`created_at` DATETIME NOT NULL,
	`updated_at` DATETIME NOT NULL,
	`deleted_at` DATETIME NOT NULL,
	PRIMARY KEY (`id`) USING BTREE,
	CONSTRAINT `payload1` CHECK (json_valid(`payload`))
);
 
 
CREATE TABLE `jobs` (
	`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
	`queue` VARCHAR(255) NOT NULL COLLATE 'latin1_swedish_ci',
	`payload` LONGTEXT NOT NULL COLLATE 'latin1_swedish_ci',
	`attempts` TINYINT(3) UNSIGNED NOT NULL,
	`reserved_at` INT(10) UNSIGNED NULL DEFAULT NULL,
	`available_at` INT(10) UNSIGNED NOT NULL,
	`created_at` INT(10) UNSIGNED NOT NULL,
	PRIMARY KEY (`id`) USING BTREE,
	INDEX `jobs_queue_reserved_at_index` (`queue`, `reserved_at`) USING BTREE
);

INSERT INTO `module_level_policy` (`module_id`, `name`, `description`, `status`, `created_at`, `updated_at`, `value`) VALUES (16, 'sendApprovalQueue', 'sendApprovalQueue', 1, NULL, NULL, '0');
INSERT INTO `module_level_policy` (`module_id`, `name`, `description`, `status`, `created_at`, `updated_at`, `value`) VALUES (16, 'fileUploadByQueue', 'fileUploadByQueue', 1, NULL, NULL, '0');