INSERT INTO `s01_00prodsvcs` (`prodsvc_id`, `product_name_en`, `product_name_si`, `product_name_ta`, `main_prodid`, `is_mainprod`, `have_child`, `created_at`, `created_by`, `updated_at`, `edited_by`) VALUES ('SERV_VET', 'Vet Service', 'පශු වෛද්‍ය සේවාව', 'கால்நடை மருத்துவர் சேவை', 'SERV', '0', '0', NULL, 'Admin', NULL, '');

ALTER TABLE `t05_02aitech_bookings` CHANGE `pd_status` `pd_status` CHAR(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Z' COMMENT 'S - Successful, F - Not successful ,z - Not Applicable X - Not rated: Default Z';

ALTER TABLE `t05_02aitech_bookings` CHANGE `calving_status` `calving_status` VARCHAR(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'Z' COMMENT 'S - Successful, F - Not successful , E - Expired, P - Pending: Z - Not applicable, Default Z\r\n';

INSERT INTO `s00_01settings` (`setid`, `setval_numeric`, `setval_string`, `set_description`, `set_description_si`, `set_description_ta`) VALUES ('PDCRONMZG', '21', 'PD check the cron message after booking dates', '', '', '');

CREATE TABLE `t05_0201pregnancy_cycles` (
  `preg_cycle_id` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `cattle_id` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `preg_cycle` int NOT NULL,
  `is_current_prgncy_cycle` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `prgncy_cycle_start_date` date NOT NULL,
  PRIMARY KEY (`preg_cycle_id`),
  KEY `fk_cattle_id` (`cattle_id`),
  CONSTRAINT `fk_cattle_id` FOREIGN KEY (`cattle_id`) REFERENCES `m01_04user_cattle` (`catle_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci

CREATE TABLE `t05_0202ai_cycles` (
  `ai_cycle_id` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `preg_cycle_id` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL,
  `ai_cycle` int NOT NULL,
  `cycle_start_date` date NOT NULL,
  `is_current_AIcycle` varchar(1) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL COMMENT 'Y/N',
  PRIMARY KEY (`ai_cycle_id`),
  KEY `fk_preg_cycle_id` (`preg_cycle_id`),
  CONSTRAINT `fk_preg_cycle_id` FOREIGN KEY (`preg_cycle_id`) REFERENCES `t05_0201pregnancy_cycles` (`preg_cycle_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci

INSERT INTO `s01_01svcs_engaged` (`type_code`, `engd_svc_en`, `engd_svc_si`, `engd_svc_ta`, `created_at`, `created_by`, `updated_at`, `edited_by`) VALUES ('VET', 'Vet', 'පශු වෛද්‍ය', 'கால்நடை மருத்துவர்', NULL, '', '2020-07-07 09:45:23', '')

CREATE TABLE `mod_newdb`.`t05_03processors` ( `row_num` INT NOT NULL AUTO_INCREMENT , `processor_id` VARCHAR(5) NOT NULL , `processor_name` VARCHAR(50) NOT NULL , PRIMARY KEY (`row_num`)) ENGINE = MyISAM;
-- 20230309 new dB
INSERT INTO `t05_03processors` (`row_num`, `processor_id`, `processor_name`) VALUES 
(NULL, 'PR01', 'Milco (Pvt.) Ltd'), 
(NULL, 'PR02', 'Nestle Lanka (Pvt) Ltd'), 
(NULL, 'PR03', 'RichLIfe'), 
(NULL, 'PR04', 'Pelwatte Dairy Industries Ltd.'), 
(NULL, 'PR05', 'Wonrich'),
(NULL, 'PR06', 'Ruwansiri'),
(NULL, 'PR07', 'CIC'),
(NULL, 'PR08', 'Richi'),
(NULL, 'PR09', 'Commercial Fodder Cultivator Individual'),
(NULL, 'PR10', 'Watawala'),
(NULL, 'PR11', 'Chello'),
(NULL, 'PR12', 'ACTED'),
(NULL, 'PR13', 'Co-operative Polonnaruwa'),
(NULL, 'PR14', 'Fontera'),
(NULL, 'PR15', 'Lanka Dairies (Pvt.) Ltd.'),
(NULL, 'PR16', 'Cargills');

ALTER TABLE `t05_02aitech_bookings` ADD `processor_id` VARCHAR(5) NOT NULL AFTER `age`;

INSERT INTO `s01_fxdval` (`rowno`, `val_id`, `val_des_en`, `val_des_si`, `val_des_ta`, `val_type`, `val_ord`) VALUES (NULL, 'LOCSEM', 'Local Semen', 'දේශීය ශුක්ර තරලය', 'உள்ளூர் விந்து', 'AIDONE', '1'), (NULL, 'IMPSEM', 'Imported Semen', 'ආනයනික ශුක්‍රාණු', 'இறக்குமதி செய்யப்பட்ட விந்து', '', '2'),(NULL, 'SEXSEM', 'Sexed Semen', 'ලිංගික ශුක්ර තරලය', 'பாலின விந்து', 'AIDONE', '3');

ALTER TABLE `t05_02aitech_bookings` ADD `semen_code` VARCHAR(20) NOT NULL AFTER `ait_semenused`, ADD `semen_type` VARCHAR(5) NOT NULL AFTER `semen_code`, ADD `dam_dob` DATE NOT NULL AFTER `semen_type`, ADD `dam_breed` VARCHAR(5) NOT NULL AFTER `dam_dob`, ADD `dam_party` INT NOT NULL AFTER `dam_breed`;

CREATE TABLE `mod`.`t05_0203aitech_calf` (`calf_row` INT NOT NULL AUTO_INCREMENT , `calf_id` VARCHAR(15) NOT NULL , `booking_no` VARCHAR(10) NOT NULL , `sex` VARCHAR(1) NOT NULL , `breed` INT NOT NULL , `dob` DATE NOT NULL , `birth_weight` DECIMAL NOT NULL , `birth_type` VARCHAR(5) NOT NULL , `ai_code` VARCHAR(10) NOT NULL , `created_at` TIMESTAMP NOT NULL, `updated_at` TIMESTAMP NOT NULL ,  PRIMARY KEY (`calf_row`)) ENGINE = MyISAM;

ALTER TABLE `t05_0203aitech_calf` ADD CONSTRAINT `fk_bking_no` FOREIGN KEY (`booking_no`) REFERENCES `t05_02aitech_bookings`(`booking_no`) ON DELETE RESTRICT ON UPDATE RESTRICT;

INSERT INTO `s01_fxdval` (`rowno`, `val_id`, `val_des_en`, `val_des_si`, `val_des_ta`, `val_type`, `val_ord`) VALUES (NULL, 'NATURAL', 'Natural Birth', 'ස්වභාවික උපත', 'இயற்கை பிறப்பு', 'BIRTHTYPE', ''), (NULL, 'SYSTEM', 'System Birth', 'පද්ධතිය මගින් උපත', 'அமைப்பால் பிறந்தவர்', 'BIRTHTYPE', '');

INSERT INTO `s00_01settings` (`setid`, `setval_numeric`, `setval_string`, `set_description`, `set_description_si`, `set_description_ta`) VALUES ('', '', '260', 'Calving Date', '', '');


INSERT INTO `s02_01cattle_breed` (`breed_type`, `breed_name_en`, `breed_name_si`, `breed_name_ta`, `created_at`, `created_by`, `updated_at`, `edited_by`) VALUES ('ImportedBreed', 'Imported Breed', 'ආනයනික ගවයන්', 'ආනයනික ගවයන්', '2020-07-07 09:19:13', '', '2020-07-07 10:05:10', '');