-- Smart School DB
-- Version 7.2.0
-- https://smart-school.in
-- https://qdocs.net
-- New tables added: 4


CREATE TABLE `google_drive_setting` (
  `id` int NOT NULL,
  `client_id` text NOT NULL,
  `api_key` text NOT NULL,
  `project_number` varchar(255) NOT NULL,
  `is_enable` varchar(255) NOT NULL,
  `is_student` varchar(255) NOT NULL,
  `is_parent` varchar(255) NOT NULL,
  `is_staff` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

ALTER TABLE sch_settings
ADD COLUMN student_delete_chat INT NOT NULL AFTER saas_key,
ADD COLUMN guardian_delete_chat INT NOT NULL AFTER student_delete_chat,
ADD COLUMN staff_delete_chat INT NOT NULL AFTER guardian_delete_chat;

ALTER TABLE `sch_settings` 
  ADD `display_previous_fees` INT NOT NULL DEFAULT 0 AFTER `scan_code_type`,
  ADD `theme_color` VARCHAR(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL DEFAULT '#7367f0' AFTER `staff_delete_chat`,
  ADD `theme_shadow` VARCHAR(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL DEFAULT 'shadow-applied' AFTER `theme_color`,
  ADD `theme_background` VARCHAR(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL DEFAULT 'light-mode' AFTER `theme_shadow`,
  ADD `theme_content` VARCHAR(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL DEFAULT 'container-fluid' AFTER `theme_background`,
  ADD `theme_type` VARCHAR(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT 'default' AFTER `theme_content`,
  ADD `theme_navigation` VARCHAR(50) CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL DEFAULT 'expanded' AFTER `theme_type`;

ALTER TABLE `staff_leave_details` 
  ADD `session_id` INT DEFAULT NULL AFTER `alloted_leave`;

ALTER TABLE `staff_leave_request`
ADD COLUMN `session_id` INT(11) DEFAULT NULL AFTER `document_file`,
ADD COLUMN `half_day_leave` VARCHAR(50) DEFAULT NULL AFTER `date`;

CREATE TABLE `transfer_certificate_fields` (
  `id` int NOT NULL,
  `name` text CHARACTER SET utf8mb3 COLLATE utf8_general_ci COMMENT 'sch_settings columns',
  `lang_key` text CHARACTER SET utf8mb3 COLLATE utf8_general_ci,
  `status` int DEFAULT NULL,
  `position` int NOT NULL,
  `is_default` int NOT NULL DEFAULT '0',
  `is_active` int NOT NULL DEFAULT '1',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

INSERT INTO `transfer_certificate_fields` (`id`, `name`, `lang_key`, `status`, `position`, `is_default`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'firstname', 'first_name', 0, 3, 1, 0, '2025-07-07 01:31:21', '2025-07-07 01:31:21'),
(2, 'admission_no', 'admission_no', 1, 2, 1, 1, '2025-07-07 01:31:22', '2025-07-07 01:31:22'),
(3, 'middlename', 'middle_name', 0, 2, 1, 1, '2025-07-07 01:31:23', '2025-07-07 01:31:23'),
(4, 'lastname', 'last_name', 1, 3, 1, 1, '2025-07-07 01:31:23', '2025-07-07 01:31:23'),
(5, 'admission_date', 'admission_date', 1, 4, 1, 1, '2025-07-07 01:31:24', '2025-07-07 01:31:24'),
(6, 'student_photo', 'student_photo', 1, 6, 1, 0, '2025-07-07 01:31:24', '2025-07-07 01:31:24'),
(7, 'student_email', 'email', 1, 6, 1, 1, '2025-07-07 01:31:25', '2025-07-07 01:31:25'),
(8, 'religion', 'religion', 1, 9, 1, 1, '2025-07-07 01:31:25', '2025-07-07 01:31:25'),
(9, 'cast', 'caste', 1, 10, 1, 1, '2025-07-07 01:31:26', '2025-07-07 01:31:26'),
(10, 'dob', 'date_of_birth', 1, 5, 1, 1, '2025-07-07 01:31:26', '2025-07-07 01:31:26'),
(11, 'is_blood_group', 'blood_group', 1, 11, 1, 0, '2025-07-07 01:31:30', '2025-07-07 01:31:30'),
(12, 'if_guardian_is', 'if_guardian_is', 1, 12, 1, 0, '2025-07-07 01:31:30', '2025-07-07 01:31:30'),
(13, 'gender', 'gender', 1, 7, 1, 1, '2025-07-07 01:31:31', '2025-07-07 01:31:31'),
(14, 'current_address', 'current_address', 1, 20, 1, 1, '2025-07-07 01:31:32', '2025-07-07 01:31:32'),
(15, 'permanent_address', 'permanent_address', 1, 21, 1, 1, '2025-07-07 01:31:32', '2025-07-07 01:31:32'),
(16, 'category', 'category', 1, 8, 1, 1, '2025-07-07 01:31:33', '2025-07-07 01:31:33'),
(17, 'bank_account_no', 'bank_account_number', 1, 15, 1, 0, '2025-07-07 01:31:37', '2025-07-07 01:31:37'),
(18, 'bank_name', 'bank_name', 1, 16, 1, 0, '2025-07-07 01:31:38', '2025-07-07 01:31:38'),
(19, 'ifsc_code', 'ifsc_code', 1, 14, 1, 0, '2025-07-07 01:31:38', '2025-07-07 01:31:38'),
(20, 'father_name', 'father_name', 1, 14, 1, 1, '2025-07-07 01:31:39', '2025-07-07 01:31:39'),
(21, 'father_phone', 'father_phone', 1, 16, 1, 1, '2025-07-07 01:31:42', '2025-07-07 01:31:42'),
(22, 'father_occupation', 'father_occupation', 1, 15, 1, 1, '2025-07-07 01:31:42', '2025-07-07 01:31:42'),
(23, 'mother_name', 'mother_name', 1, 17, 1, 1, '2025-07-07 01:31:43', '2025-07-07 01:31:43'),
(24, 'mother_phone', 'mother_phone', 1, 19, 1, 1, '2025-07-07 01:31:44', '2025-07-07 01:31:44'),
(25, 'mother_occupation', 'mother_occupation', 1, 18, 1, 1, '2025-07-07 01:31:44', '2025-07-07 01:31:44'),
(26, 'is_student_house', 'house', 1, 11, 1, 1, '2025-07-07 01:31:45', '2025-07-07 01:31:45'),
(27, 'guardian_name', 'guardian_name', 1, 27, 1, 0, '2025-07-07 01:31:46', '2025-07-07 01:31:46'),
(28, 'guardian_relation', 'guardian_relation', 1, 28, 1, 0, '2025-07-07 01:31:47', '2025-07-07 01:31:47'),
(29, 'guardian_phone', 'guardian_phone', 1, 29, 1, 0, '2025-07-07 01:31:47', '2025-07-07 01:31:47'),
(30, 'guardian_occupation', 'guardian_occupation', 1, 30, 1, 0, '2025-07-07 01:31:48', '2025-07-07 01:31:48'),
(31, 'guardian_address', 'guardian_address', 1, 31, 1, 0, '2025-07-07 01:31:51', '2025-07-07 01:31:51'),
(32, 'guardian_email', 'guardian_email', 1, 32, 1, 0, '2025-07-07 01:31:51', '2025-07-07 01:31:51'),
(33, 'national_identification_no', 'national_identification_number', 1, 22, 1, 1, '2025-07-07 01:31:52', '2025-07-07 01:31:52'),
(34, 'local_identification_no', 'local_identification_number', 1, 23, 1, 1, '2025-07-07 01:31:52', '2025-07-07 01:31:52'),
(35, 'father_pic', 'father_photo', 1, 35, 1, 0, '2025-07-07 01:31:53', '2025-07-07 01:31:53'),
(36, 'mother_pic', 'mother_photo', 1, 36, 1, 0, '2025-07-07 01:31:53', '2025-07-07 01:31:53'),
(37, 'guardian_pic', 'guardian_photo', 1, 37, 1, 0, '2025-07-07 01:31:54', '2025-07-07 01:31:54'),
(38, 'student_height', 'height', 1, 12, 1, 1, '2025-07-07 01:31:55', '2025-07-07 01:31:55'),
(39, 'student_weight', 'weight', 1, 13, 1, 1, '2025-07-07 01:31:56', '2025-07-07 01:31:56'),
(40, 'rte', 'rte', 1, 24, 1, 1, '2025-07-10 21:56:51', '2025-07-10 21:56:51'),
(41, 'tc_no', 'tc_no', 1, 1, 1, 1, '2025-07-12 00:03:32', '2025-07-12 00:03:32');

CREATE TABLE `transfer_certificate_no` (
  `id` int NOT NULL,
  `student_session_id` int NOT NULL,
  `tc_no` int NOT NULL,
  `is_regenerte` int NOT NULL,
  `create_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

CREATE TABLE `transfer_certificate_settings` (
  `id` int NOT NULL,
  `tc_no_start` int NOT NULL,
  `header_image` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `footer_content` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `class_teacher_signature` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `checked_by` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `signature_of_principle` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci,
  `create_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

INSERT INTO `transfer_certificate_settings` (`id`, `tc_no_start`, `header_image`, `footer_content`, `class_teacher_signature`, `checked_by`, `signature_of_principle`, `create_at`) VALUES
(1, 1, 'header_image.jpg', '<p><b>(Transfer Certificate should be issued under the signature of the Regular Principal/ Incharge Principal / District / State / National/ International level)</b></p>', 'class_teacher_signature.jpg', 'checked_by.jpg', 'signature_of_principle.jpg', '2025-08-14 11:40:32');

ALTER TABLE `google_drive_setting`
  ADD PRIMARY KEY (`id`);
  
ALTER TABLE `transfer_certificate_fields`
  ADD PRIMARY KEY (`id`);
  
ALTER TABLE `transfer_certificate_no`
  ADD PRIMARY KEY (`id`);
  
ALTER TABLE `transfer_certificate_settings`
  ADD PRIMARY KEY (`id`);
  
ALTER TABLE `google_drive_setting`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;
  
ALTER TABLE `transfer_certificate_fields`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=42;
  
ALTER TABLE `transfer_certificate_no`
  MODIFY `id` int NOT NULL AUTO_INCREMENT;  
 
  
ALTER TABLE `transfer_certificate_settings`
  MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

ALTER TABLE `students` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `students` CHANGE `father_pic` `father_pic` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `mother_pic` `mother_pic` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `guardian_pic` `guardian_pic` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `alumni_students` CHANGE `photo` `photo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `certificates` CHANGE `background_image` `background_image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `complaint` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `alumni_events` CHANGE `photo` `photo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `daily_assignment` CHANGE `attachment` `attachment` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `dispatch_receive` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `email_attachments` CHANGE `directory` `directory` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `attachment` `attachment` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `email_template_attachment` CHANGE `attachment` `attachment` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `expenses` CHANGE `documents` `documents` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `front_cms_media_gallery` CHANGE `thumb_path` `thumb_path` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `dir_path` `dir_path` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `img_name` `img_name` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `thumb_name` `thumb_name` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `file_type` `file_type` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `front_cms_media_gallery` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `vid_title` `vid_title` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `front_cms_pages` CHANGE `feature_image` `feature_image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `front_cms_settings` CHANGE `logo` `logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `homework` CHANGE `document` `document` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `id_card` CHANGE `background` `background` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `logo` `logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `sign_image` `sign_image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `income` CHANGE `documents` `documents` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `item_stock` CHANGE `attachment` `attachment` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `onlineexam_student_results` CHANGE `attachment_upload_name` `attachment_upload_name` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `online_admissions` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `online_admissions` CHANGE `father_pic` `father_pic` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `mother_pic` `mother_pic` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `guardian_pic` `guardian_pic` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `print_headerfooter` CHANGE `header_image` `header_image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `sch_settings` CHANGE `admin_logo` `admin_logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `admin_small_logo` `admin_small_logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `app_logo` `app_logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `sch_settings` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `staff` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `resume` `resume` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `joining_letter` `joining_letter` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `resignation_letter` `resignation_letter` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `other_document_file` `other_document_file` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `staff_id_card` CHANGE `background` `background` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `logo` `logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `sign_image` `sign_image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `staff_leave_request` CHANGE `document_file` `document_file` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `staff_timeline` CHANGE `document` `document` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `student_applyleave` CHANGE `docs` `docs` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `student_doc` CHANGE `doc` `doc` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `student_timeline` CHANGE `document` `document` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `subject_syllabus` CHANGE `lacture_video` `lacture_video` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `submit_assignment` CHANGE `docs` `docs` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;

ALTER TABLE `template_admitcards` CHANGE `left_logo` `left_logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `right_logo` `right_logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `sign` `sign` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `background_img` `background_img` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `template_marksheets` CHANGE `header_image` `header_image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `left_logo` `left_logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `right_logo` `right_logo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `left_sign` `left_sign` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `middle_sign` `middle_sign` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `right_sign` `right_sign` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `background_img` `background_img` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `upload_contents` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `thumb_path` `thumb_path` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `dir_path` `dir_path` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `img_name` `img_name` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL, CHANGE `thumb_name` `thumb_name` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `vehicles` CHANGE `vehicle_photo` `vehicle_photo` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;
ALTER TABLE `video_tutorial` CHANGE `img_name` `img_name` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL, CHANGE `thumb_name` `thumb_name` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NOT NULL;
ALTER TABLE `visitors_book` CHANGE `image` `image` TEXT CHARACTER SET utf8mb3 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `notification_setting` ADD `is_whatsapp` INT NULL DEFAULT '0' AFTER `is_mail`;

ALTER TABLE `notification_setting` ADD `display_whatsapp` INT NOT NULL DEFAULT '1' AFTER `display_sms`;

ALTER TABLE `notification_setting` ADD `whatsapp_template_id` VARCHAR(255)  NOT NULL AFTER `template_id`;

ALTER TABLE `sch_settings` ADD `student_partial_payment` INT NOT NULL DEFAULT '1' AFTER `guardian_delete_chat`;

ALTER TABLE `sch_settings` ADD `theme_font_color` VARCHAR(50)  NOT NULL AFTER `theme_navigation`;

ALTER TABLE `sch_settings` ADD `student_form_multi_class` VARCHAR(50)  NOT NULL AFTER `theme_font_color`;

ALTER TABLE `users` ADD `login_token` VARCHAR(255)  NOT NULL AFTER `verification_code`;

ALTER TABLE `addons` CHANGE `price` `price` DECIMAL(10,2) NOT NULL DEFAULT '0.00';

ALTER TABLE `books` CHANGE `perunitcost` `perunitcost` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `cumulative_fine` CHANGE `fine_amount` `fine_amount` DECIMAL(10,2) NOT NULL;

ALTER TABLE `exam_group_class_batch_exams` CHANGE `passing_percentage` `passing_percentage` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `exam_group_class_batch_exam_subjects` CHANGE `max_marks` `max_marks` DECIMAL(10,2) NULL DEFAULT NULL, CHANGE `min_marks` `min_marks` DECIMAL(10,2) NULL DEFAULT NULL, CHANGE `credit_hours` `credit_hours` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `exam_group_exam_connections` CHANGE `exam_weightage` `exam_weightage` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `expenses` CHANGE `amount` `amount` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `feemasters` CHANGE `amount` `amount` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `fees_discounts` CHANGE `percentage` `percentage` DECIMAL(10,2) NULL DEFAULT NULL, CHANGE `amount` `amount` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `fee_groups_feetype` CHANGE `fine_percentage` `fine_percentage` DECIMAL(10,2) NOT NULL DEFAULT '0.00', CHANGE `fine_amount` `fine_amount` DECIMAL(10,2) NOT NULL DEFAULT '0.00';

ALTER TABLE `grades` CHANGE `mark_from` `mark_from` DECIMAL(10,2) NULL DEFAULT NULL, CHANGE `mark_upto` `mark_upto` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `homework` CHANGE `marks` `marks` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `homework_evaluation` CHANGE `marks` `marks` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `hostel_rooms` CHANGE `cost_per_bed` `cost_per_bed` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `income` CHANGE `amount` `amount` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `item_stock` CHANGE `purchase_price` `purchase_price` DECIMAL(10,2) NOT NULL;

ALTER TABLE `mark_divisions` CHANGE `percentage_from` `percentage_from` DECIMAL(10,2) NULL DEFAULT NULL, CHANGE `percentage_to` `percentage_to` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `offline_fees_payments` CHANGE `amount` `amount` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `onlineexam_questions` CHANGE `marks` `marks` DECIMAL(10,2) NOT NULL DEFAULT '0.00', CHANGE `neg_marks` `neg_marks` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `onlineexam_student_results` CHANGE `marks` `marks` DECIMAL(10,2) NOT NULL DEFAULT '0.00';

ALTER TABLE `online_admission_payment` CHANGE `paid_amount` `paid_amount` DECIMAL(10,2) NOT NULL, CHANGE `processing_charge_value` `processing_charge_value` DECIMAL(10,2) NULL DEFAULT NULL;

ALTER TABLE `route_pickup_point` CHANGE `fees` `fees` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `sch_settings` CHANGE `low_attendance_limit` `low_attendance_limit` DECIMAL(10,2) NOT NULL;

ALTER TABLE `staff_payslip` CHANGE `basic` `basic` DECIMAL(10,2) NOT NULL, CHANGE `total_allowance` `total_allowance` DECIMAL(10,2) NOT NULL, CHANGE `total_deduction` `total_deduction` DECIMAL(10,2) NOT NULL, CHANGE `net_salary` `net_salary` DECIMAL(10,2) NOT NULL;

ALTER TABLE `student_fees` CHANGE `amount` `amount` DECIMAL(10,2) NULL DEFAULT NULL, CHANGE `amount_discount` `amount_discount` DECIMAL(10,2) NOT NULL, CHANGE `amount_fine` `amount_fine` DECIMAL(10,2) NOT NULL DEFAULT '0.00';

ALTER TABLE `student_fees_master` CHANGE `amount` `amount` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `student_session` CHANGE `transport_fees` `transport_fees` DECIMAL(10,2) NOT NULL DEFAULT '0.00', CHANGE `fees_discount` `fees_discount` DECIMAL(10,2) NOT NULL DEFAULT '0.00';

ALTER TABLE `transport_feemaster` CHANGE `fine_amount` `fine_amount` DECIMAL(10,2) NULL DEFAULT '0.00', CHANGE `fine_percentage` `fine_percentage` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `exam_group_exam_results` CHANGE `get_marks` `get_marks` DECIMAL(10,2) NULL DEFAULT '0.00';

ALTER TABLE `staff_leave_details` CHANGE `alloted_leave` `alloted_leave` DECIMAL(10,2) NOT NULL;

ALTER TABLE `staff_leave_request` CHANGE `leave_days` `leave_days` DECIMAL(10,2) NOT NULL;

INSERT INTO `google_drive_setting` (`id`, `client_id`, `api_key`, `project_number`, `is_enable`, `is_student`, `is_parent`, `is_staff`) VALUES
(1, "", "", "", 'disabled', 'disabled', 'disabled', 'disabled');

INSERT INTO `permission_category` (`id`, `perm_group_id`, `name`, `short_code`, `enable_view`, `enable_add`, `enable_edit`, `enable_delete`, `created_at`, `updated_at`) VALUES

(283, 14, 'Income Expense Balance Report', 'income_expense_balance_report', 1, 0, 0, 0, '2019-10-24 23:55:52', '2025-10-03 11:54:07'),
(284, 14, 'Due Fees Report', 'due_fees_report', 1, 0, 0, 0, '2019-10-24 23:55:52', '2025-10-03 11:54:07'),
(285, 14, 'Homework Marks Report', 'homework_marks_report', 1, 0, 0, 0, '2019-11-24 00:04:24', '2025-10-03 11:54:07'),
(286, 14, 'Online Admission Fees Collection Report', 'online_admission_fees_collection_report', 1, 0, 0, 0, '2019-10-24 23:55:52', '2025-10-03 11:54:07'),
(288, 14, 'Class Section Report', 'class_section_report', 1, 0, 0, 0, '2019-10-24 23:27:00', '2025-10-03 11:54:07'),
(289, 20, 'Download Transfer Certificate', 'download_tc', 1, 0, 0, 0, '2024-12-10 10:06:30', '2025-10-03 11:54:07'),
(290, 20, 'Build Transfer Certificate', 'prepare_tc', 1, 0, 0, 0, '2024-12-10 10:06:30', '2025-10-03 11:54:07'),
(291, 20, 'Transfer Certificate Settings', 'tc_settings', 1, 0, 0, 0, '2024-12-10 10:06:30', '2025-10-03 11:54:07'),
(292, 20, 'Verify Transfer Certificate', 'verify_tc', 1, 0, 0, 0, '2024-12-10 10:06:30', '2025-10-03 11:54:07'),
(293, 14, 'Leave Request Report', 'staff_leave_request_report', 1, 0, 0, 0, '2019-10-24 23:39:07', '2025-10-03 11:54:07');

UPDATE `permission_category` SET `enable_view` = '1' WHERE `permission_category`.`id` = 53;

UPDATE `permission_category` SET `enable_add` = '0' WHERE `permission_category`.`id` = 61;

UPDATE `permission_category` SET `enable_delete` = '0' WHERE `permission_category`.`id` = 61;

UPDATE `permission_category` SET `enable_add` = '1' WHERE `permission_category`.`id` = 108;

UPDATE `permission_category` SET `enable_delete` = '1' WHERE `permission_category`.`id` = 252;

DELETE FROM `permission_category`
WHERE `id` = 198;

UPDATE `permission_category`
SET `short_code` = 'subject_lesson_plan_report',
    `name` = 'Subject Lesson Plan Report'
WHERE `id` = 241;

DELETE FROM `resume_settings_fields`
WHERE `id` IN (17, 21, 22, 26, 30, 31);

UPDATE `sidebar_menus` SET `access_permissions` = '(\'exam_group\', \'can_view\') || (\'exam_result\', \'can_view\') || (\'design_admit_card\', \'can_view\') || (\'print_admit_card\', \'can_view\') || (\'design_marksheet\', \'can_view\') || (\'print_marksheet\', \'can_view\') || (\'marks_grade\', \'can_view\') || (\'exam_schedule\', \'can_view\') || (\'generate_rank\', \'can_view\')' WHERE `sidebar_menus`.`id` = 11;

UPDATE `sidebar_menus` SET `access_permissions` = '(\'student_certificate\', \'can_view\') || (\'generate_certificate\', \'can_view\') || (\'student_id_card\', \'can_view\') || (\'generate_id_card\', \'can_view\') || (\'staff_id_card\', \'can_view\') || (\'generate_staff_id_card\', \'can_view\') || (\'download_tc\', \'can_view\') || (\'prepare_tc\', \'can_view\') || (\'tc_settings\', \'can_view\') || (\'verify_tc\', \'can_view\')' WHERE `sidebar_menus`.`id` = 23;

UPDATE `sidebar_menus` SET `access_permissions` = '(\'student_report\', \'can_view\') || (\'guardian_report\', \'can_view\') || (\'student_history\', \'can_view\') || (\'student_login_credential_report\', \'can_view\') || (\'class_subject_report\', \'can_view\') || (\'admission_report\', \'can_view\') || (\'sibling_report\', \'can_view\') || (\'evaluation_report\', \'can_view\') || (\'student_profile\', \'can_view\') || (\'fees_statement\', \'can_view\') || (\'balance_fees_report\', \'can_view\') || (\'fees_collection_report\', \'can_view\') || (\'online_fees_collection_report\', \'can_view\') || (\'income_report\', \'can_view\') || (\'expense_report\', \'can_view\') || (\'payroll_report\', \'can_view\') || (\'income_group_report\', \'can_view\') || (\'expense_group_report\', \'can_view\') || (\'attendance_report\', \'can_view\') || (\'staff_attendance_report\', \'can_view\') || (\'exam_marks_report\', \'can_view\') ||        (\'online_exam_wise_report\', \'can_view\') || (\'online_exams_report\', \'can_view\') || (\'online_exams_attempt_report\', \'can_view\') || (\'online_exams_rank_report\', \'can_view\') || (\'payroll_report\', \'can_view\') || (\'transport_report\', \'can_view\') || (\'hostel_report\', \'can_view\') || (\'audit_trail_report\', \'can_view\') || (\'user_log\', \'can_view\') || (\'book_issue_report\', \'can_view\') || (\'book_due_report\', \'can_view\') || (\'book_inventory_report\', \'can_view\') || (\'stock_report\', \'can_view\') ||      (\'add_item_report\', \'can_view\') || (\'issue_inventory_report\', \'can_view\') || (\'syllabus_status_report\', \'can_view\') ||    (\'subject_lesson_plan_report\', \'can_view\') || (\'daily_collection_report\', \'can_view\') || (\'balance_fees_statement\', \'can_view\') || (\'balance_fees_report_with_remark\', \'can_view\')' WHERE `sidebar_menus`.`id` = 26;

UPDATE `sidebar_sub_menus` SET `access_permissions` = '(\'exam_schedule\', \'can_view\')' WHERE `sidebar_sub_menus`.`id` = 37;

UPDATE `sidebar_sub_menus` SET `activate_methods` = 'attendance,classattendencereport,attendancereport,daily_attendance_report,staffattendancereport,biometric_attlog,reportbymonthstudent,reportbymonth,staffdaywiseattendancereport' WHERE `sidebar_sub_menus`.`id` = 133;

UPDATE `sidebar_sub_menus` SET `access_permissions` = '(\'syllabus_status_report\', \'can_view\') || (\'subject_lesson_plan_report\', \'can_view\')' WHERE `sidebar_sub_menus`.`id` = 135;

UPDATE `sidebar_sub_menus` SET `access_permissions` = '(\'homework\', \'can_view\') || (\'daily_assignment\', \'can_view\') || (\'homework_marks_report\', \'can_view\') || (\'homehork_evaluation_report\', \'can_view\')' WHERE `sidebar_sub_menus`.`id` = 144;

UPDATE `sidebar_sub_menus` SET `activate_methods` = 'homeworkordailyassignmentreport,homeworkreport,evaluation_report,dailyassignmentreport,homework_marksreport' WHERE `sidebar_sub_menus`.`id` = 144;

UPDATE `sidebar_sub_menus` SET `activate_methods` = 'index,logo,miscellaneous,backendtheme,mobileapp,studentguardianpanel,fees,idautogeneration,attendancetype,maintenance,whatsappsettings,chatsetting' WHERE `sidebar_sub_menus`.`id` = 146;

INSERT INTO `sidebar_sub_menus` (`id`, `sidebar_menu_id`, `menu`, `key`, `lang_key`, `url`, `level`, `access_permissions`, `permission_group_id`, `activate_controller`, `activate_methods`, `addon_permission`, `is_active`, `created_at`, `updated_at`) VALUES
(230, 23, 'transfer_certificate', NULL, 'transfer_certificate', 'admin/transfercertificate/download', 1, '(\'download_tc\', \'can_view\') || (\'prepare_tc\', \'can_view\') || (\'tc_settings\', \'can_view\') || (\'verify_tc\', \'can_view\')', NULL, 'transfercertificate', 'download,index,verify_tc,prepare_tc,edit_custom_field,edit_header', '', 1, '2022-07-23 08:44:30', '2025-10-03 11:54:09');

UPDATE `notification_setting` SET `variables` = '{{student_name}} {{exam_roll_no}} {{exam}} {{exam_marksheet_url}} ' WHERE `notification_setting`.`type` = 'exam_result';

UPDATE `notification_setting` SET `variables` = '{{student_name}} {{class}} {{section}} {{fine_type}} {{fine_percentage}} {{fine_amount}} {{fee_group_name}} {{type}} {{code}} {{email}} {{contact_no}} {{invoice_id}} {{sub_invoice_id}} {{due_date}} {{amount}} {{fee_amount}} {{fee_receipt_url}}' WHERE `notification_setting`.`type` = 'fee_submission';

INSERT INTO `permission_category` (`id`, `perm_group_id`, `name`, `short_code`, `enable_view`, `enable_add`, `enable_edit`, `enable_delete`, `created_at`, `updated_at`) VALUES
(294, 14, 'My Leave Request Report', 'my_leave_request_report', 1, 0, 0, 0, '2019-10-24 23:39:07', '2025-10-03 11:54:07');

INSERT INTO `print_headerfooter` (`id`, `print_type`, `header_image`, `footer_content`, `created_by`, `entry_date`, `created_at`, `updated_at`) VALUES
(6, 'email', 'header_image.jpg', '<br><div>Note: This email was sent from an email address that can\"t receive emails. Please don\"t reply to this email                                            </div>', 1, '2025-10-03 11:54:08', '2022-09-08 15:28:34', '2025-10-03 11:54:08');


UPDATE `sch_settings` SET `theme_font_color` = '#fff' WHERE `sch_settings`.`id` = 1;

UPDATE `sch_settings` SET `student_form_multi_class` = 'disabled' WHERE `sch_settings`.`id` = 1;

UPDATE `addons` SET `directory` = 'two_factor_authentication' WHERE `addons`.`id` = 2;

UPDATE `sidebar_menus` SET `access_permissions` = '(\'student\', \'can_view\') || (\'student\', \'can_add\') || (\'student_categories\', \'can_view\') || (\'student_houses\', \'can_view\') || (\'disable_student\', \'can_view\') || (\'disable_reason\', \'can_view\') || (\'online_admission\', \'can_view\') || (\'multiclass_student\', \'can_view\') || (\'disable_reason\', \'can_view\')' WHERE `sidebar_menus`.`id` = 2;

UPDATE `sidebar_menus` SET `access_permissions` = '(\'collect_fees\', \'can_view\') || (\'search_fees_payment\', \'can_view\') || (\'search_due_fees\', \'can_view\') || (\'fees_statement\', \'can_view\') || (\'fees_carry_forward\', \'can_view\') || (\'fees_master\', \'can_view\') || (\'fees_group\', \'can_view\') || (\'fees_type\', \'can_view\') || (\'fees_discount\', \'can_view\') || (\'fees_reminder\', \'can_view\') || (\'offline_bank_payments\', \'can_view\')' WHERE `sidebar_menus`.`id` = 3;

UPDATE `sidebar_menus` SET `access_permissions` = '(\'student_report\', \'can_view\') || (\'guardian_report\', \'can_view\') || (\'student_history\', \'can_view\') || (\'student_login_credential_report\', \'can_view\') || (\'class_subject_report\', \'can_view\') || (\'admission_report\', \'can_view\') || (\'sibling_report\', \'can_view\') || (\'evaluation_report\', \'can_view\') || (\'student_profile\', \'can_view\') || (\'fees_statement\', \'can_view\') || (\'balance_fees_report\', \'can_view\') || (\'fees_collection_report\', \'can_view\') || (\'online_fees_collection_report\', \'can_view\') || (\'income_report\', \'can_view\') || (\'expense_report\', \'can_view\') || (\'income_group_report\', \'can_view\') || (\'expense_group_report\', \'can_view\') || (\'attendance_report\', \'can_view\') || (\'staff_attendance_report\', \'can_view\') || (\'exam_marks_report\', \'can_view\') || (\'online_exam_wise_report\', \'can_view\') || (\'online_exams_report\', \'can_view\') || (\'online_exams_attempt_report\', \'can_view\') || (\'online_exams_rank_report\', \'can_view\') || (\'payroll_report\', \'can_view\') || (\'transport_report\', \'can_view\') || (\'hostel_report\', \'can_view\') || (\'audit_trail_report\', \'can_view\') || (\'user_log\', \'can_view\') || (\'book_issue_report\', \'can_view\') || (\'book_due_report\', \'can_view\') || (\'book_inventory_report\', \'can_view\') || (\'stock_report\', \'can_view\') ||      (\'add_item_report\', \'can_view\') || (\'issue_inventory_report\', \'can_view\') || (\'syllabus_status_report\', \'can_view\') ||    (\'subject_lesson_plan_report\', \'can_view\') || (\'daily_collection_report\', \'can_view\') || (\'balance_fees_statement\', \'can_view\') || (\'balance_fees_report_with_remark\', \'can_view\') || (\'staff_leave_request_report\', \'can_view\') || (\'my_leave_request_report\', \'can_view\')' WHERE `sidebar_menus`.`id` = 26;

UPDATE `sidebar_sub_menus` SET `url` = 'admin/front/menus/additem/main-menu' WHERE `sidebar_sub_menus`.`id` = 127;

UPDATE `sidebar_sub_menus` SET `access_permissions` = '(\'staff_report\', \'can_view\') || (\'payroll_report\', \'can_view\') || (\'staff_leave_request_report\', \'can_view\') || (\'my_leave_request_report\', \'can_view\')  ', `activate_methods` = 'human_resource,staff_report,payrollreport,myleaverequestreport,leaverequestreport' WHERE `sidebar_sub_menus`.`id` = 136;

INSERT INTO `addons` (`id`, `product_id`, `image`, `name`, `config_name`, `short_name`, `directory`, `description`, `price`, `current_version`, `article_link`, `installation_by`, `uninstall_version`, `unistall_by`, `addon_prod`, `addon_ver`, `last_update`, `current_stage`, `product_order`, `created_at`, `updated_at`) VALUES
(11, 61574315, 'uploads/addon_images/sswm_images.jpg', 'Smart School Whatsapp Messaging', 'whatsapp-messaging-config', 'sswm', 'whatsapp_messaging', 'Smart School WhatsApp Messaging addon adds WhatsApp messaging module in Smart School. Using this module you can send notification or direct messages to student/parent/staff WhatsApp number on their mobile.', 0.00, NULL, 'https://go.smart-school.in/whatsapp-messaging', NULL, NULL, NULL, NULL, NULL, '2025-12-15 12:18:16', 0, 0, '2025-01-13 12:10:06', '2025-12-15 06:48:16');

UPDATE `sidebar_sub_menus` SET `level` = '2' WHERE `sidebar_sub_menus`.`id` = 121;

UPDATE `sidebar_sub_menus` SET `level` = '2' WHERE `sidebar_sub_menus`.`id` = 120;

UPDATE `sidebar_sub_menus` SET `level` = '2' WHERE `sidebar_sub_menus`.`id` = 119;

UPDATE `sidebar_sub_menus` SET `level` = '2' WHERE `sidebar_sub_menus`.`id` = 118;

UPDATE `sidebar_sub_menus` SET `level` = '2' WHERE `sidebar_sub_menus`.`id` = 117;

UPDATE `sidebar_sub_menus` SET `level` = '2' WHERE `sidebar_sub_menus`.`id` = 116;

ALTER TABLE `transfer_certificate_settings` ADD `affiliation_no` VARCHAR(255) NULL DEFAULT NULL AFTER `tc_no_start`;

UPDATE `notification_setting` SET `display_whatsapp` = '0' WHERE `notification_setting`.`type` = 'forgot_password';

UPDATE `notification_setting` SET `display_whatsapp` = '0' WHERE `notification_setting`.`type` = 'email_pdf_exam_marksheet';

UPDATE `sidebar_sub_menus` SET `level` = '2' WHERE `sidebar_sub_menus`.`id` = 89;

UPDATE `sidebar_sub_menus` SET `level` = '3' WHERE `sidebar_sub_menus`.`id` = 91;

UPDATE `sidebar_sub_menus` SET `level` = '4' WHERE `sidebar_sub_menus`.`id` = 88;

