@kipicore/dbcore 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/configs/postgresConfig.d.ts +8 -0
  2. package/dist/configs/postgresConfig.js +32 -0
  3. package/dist/db/psql/index.d.ts +16 -0
  4. package/dist/db/psql/index.js +105 -0
  5. package/dist/db/psql/migrations/20241225101052-add-deleted-by-and-deleted-at-fields.d.ts +2 -0
  6. package/dist/db/psql/migrations/20241225101052-add-deleted-by-and-deleted-at-fields.js +71 -0
  7. package/dist/db/psql/migrations/20250106070945-add-user-fields-and-deleted-user-fields.d.ts +3 -0
  8. package/dist/db/psql/migrations/20250106070945-add-user-fields-and-deleted-user-fields.js +33 -0
  9. package/dist/db/psql/migrations/20250106080059-add-fields-and-deleted-fields.d.ts +3 -0
  10. package/dist/db/psql/migrations/20250106080059-add-fields-and-deleted-fields.js +94 -0
  11. package/dist/db/psql/migrations/20250108092439-update-batch-model-fields.d.ts +2 -0
  12. package/dist/db/psql/migrations/20250108092439-update-batch-model-fields.js +38 -0
  13. package/dist/db/psql/migrations/20250210102846-add-profileImage-coverImage-to-users.d.ts +3 -0
  14. package/dist/db/psql/migrations/20250210102846-add-profileImage-coverImage-to-users.js +102 -0
  15. package/dist/db/psql/migrations/20250211071743-add-action-user-has-histroy.d.ts +3 -0
  16. package/dist/db/psql/migrations/20250211071743-add-action-user-has-histroy.js +76 -0
  17. package/dist/db/psql/migrations/20250213140815-add-assignQuantity-user-has-histroy.d.ts +3 -0
  18. package/dist/db/psql/migrations/20250213140815-add-assignQuantity-user-has-histroy.js +80 -0
  19. package/dist/db/psql/migrations/20250214072626-add-middlename-user.d.ts +3 -0
  20. package/dist/db/psql/migrations/20250214072626-add-middlename-user.js +80 -0
  21. package/dist/db/psql/migrations/20250224085333-add-apptype-in-user.d.ts +3 -0
  22. package/dist/db/psql/migrations/20250224085333-add-apptype-in-user.js +78 -0
  23. package/dist/db/psql/migrations/20250226053006-add-brouchure-in-institute.d.ts +3 -0
  24. package/dist/db/psql/migrations/20250226053006-add-brouchure-in-institute.js +80 -0
  25. package/dist/db/psql/migrations/20250227123530-add-defult-in-fee-reminder.d.ts +3 -0
  26. package/dist/db/psql/migrations/20250227123530-add-defult-in-fee-reminder.js +78 -0
  27. package/dist/db/psql/migrations/20250304052831-add-institued-in-school-data-clm.d.ts +3 -0
  28. package/dist/db/psql/migrations/20250304052831-add-institued-in-school-data-clm.js +112 -0
  29. package/dist/db/psql/migrations/20250306053557-add-shifyId-in-batch.d.ts +3 -0
  30. package/dist/db/psql/migrations/20250306053557-add-shifyId-in-batch.js +86 -0
  31. package/dist/db/psql/migrations/20250311044606-add-institued-in-school-data-clm-subtype.d.ts +2 -0
  32. package/dist/db/psql/migrations/20250311044606-add-institued-in-school-data-clm-subtype.js +43 -0
  33. package/dist/db/psql/migrations/20250402090653-add-user-area.d.ts +3 -0
  34. package/dist/db/psql/migrations/20250402090653-add-user-area.js +94 -0
  35. package/dist/db/psql/migrations/20250407094125-update-type-in-typeManagement.d.ts +2 -0
  36. package/dist/db/psql/migrations/20250407094125-update-type-in-typeManagement.js +64 -0
  37. package/dist/db/psql/migrations/20250409105229-add-user-type-in-role.d.ts +3 -0
  38. package/dist/db/psql/migrations/20250409105229-add-user-type-in-role.js +55 -0
  39. package/dist/db/psql/migrations/20250417121316-make-institute-id-nullable-in-type-management.d.ts +2 -0
  40. package/dist/db/psql/migrations/20250417121316-make-institute-id-nullable-in-type-management.js +16 -0
  41. package/dist/db/psql/migrations/20250419071236-fee_histroy_add_school_clm.d.ts +3 -0
  42. package/dist/db/psql/migrations/20250419071236-fee_histroy_add_school_clm.js +134 -0
  43. package/dist/db/psql/migrations/20250419085334-fee_histroy_add_school_clm.d.ts +3 -0
  44. package/dist/db/psql/migrations/20250419085334-fee_histroy_add_school_clm.js +86 -0
  45. package/dist/db/psql/migrations/20250421085618-add-entityIds-field-in-announcements.d.ts +3 -0
  46. package/dist/db/psql/migrations/20250421085618-add-entityIds-field-in-announcements.js +81 -0
  47. package/dist/db/psql/migrations/20250422114032-add-account.d.ts +3 -0
  48. package/dist/db/psql/migrations/20250422114032-add-account.js +86 -0
  49. package/dist/db/psql/migrations/20250423051841-add-master-leave-clm.d.ts +3 -0
  50. package/dist/db/psql/migrations/20250423051841-add-master-leave-clm.js +71 -0
  51. package/dist/db/psql/migrations/20250423064522-update-calender-enum.d.ts +2 -0
  52. package/dist/db/psql/migrations/20250423064522-update-calender-enum.js +34 -0
  53. package/dist/db/psql/migrations/20250423093827-update-institued-district.d.ts +3 -0
  54. package/dist/db/psql/migrations/20250423093827-update-institued-district.js +78 -0
  55. package/dist/db/psql/migrations/20250424044755-update-fee-history-feeTyps-clm.d.ts +3 -0
  56. package/dist/db/psql/migrations/20250424044755-update-fee-history-feeTyps-clm.js +34 -0
  57. package/dist/db/psql/migrations/20250424053841-update-fee-history-key.d.ts +2 -0
  58. package/dist/db/psql/migrations/20250424053841-update-fee-history-key.js +35 -0
  59. package/dist/db/psql/migrations/20250426070309-update-banner-clm-userType.d.ts +3 -0
  60. package/dist/db/psql/migrations/20250426070309-update-banner-clm-userType.js +55 -0
  61. package/dist/db/psql/migrations/20250505035157-update-fee-collection-clm-add.d.ts +3 -0
  62. package/dist/db/psql/migrations/20250505035157-update-fee-collection-clm-add.js +86 -0
  63. package/dist/db/psql/migrations/20250505082924-update-banner-clm.d.ts +3 -0
  64. package/dist/db/psql/migrations/20250505082924-update-banner-clm.js +18 -0
  65. package/dist/db/psql/migrations/20250505094616-about-as-clm-in-institued.d.ts +2 -0
  66. package/dist/db/psql/migrations/20250505094616-about-as-clm-in-institued.js +16 -0
  67. package/dist/db/psql/migrations/20250506070110-add-dayOfWeek-clm-in-working-model.d.ts +3 -0
  68. package/dist/db/psql/migrations/20250506070110-add-dayOfWeek-clm-in-working-model.js +80 -0
  69. package/dist/db/psql/migrations/20250509055920-add-feecollection-isleft-clm.d.ts +3 -0
  70. package/dist/db/psql/migrations/20250509055920-add-feecollection-isleft-clm.js +80 -0
  71. package/dist/db/psql/migrations/20250513061037-add-techer-clm-batch.d.ts +3 -0
  72. package/dist/db/psql/migrations/20250513061037-add-techer-clm-batch.js +88 -0
  73. package/dist/db/psql/migrations/20250514101801-add-slotId-workingShif.d.ts +3 -0
  74. package/dist/db/psql/migrations/20250514101801-add-slotId-workingShif.js +86 -0
  75. package/dist/db/psql/migrations/20250516062917-add-globalId-clm-user-model.d.ts +3 -0
  76. package/dist/db/psql/migrations/20250516062917-add-globalId-clm-user-model.js +80 -0
  77. package/dist/db/psql/migrations/20250516063542-add-globalId-clm-institute-model.d.ts +3 -0
  78. package/dist/db/psql/migrations/20250516063542-add-globalId-clm-institute-model.js +80 -0
  79. package/dist/db/psql/migrations/20250520061231-add-institued_mobile_person_data.d.ts +3 -0
  80. package/dist/db/psql/migrations/20250520061231-add-institued_mobile_person_data.js +116 -0
  81. package/dist/db/psql/migrations/20250522044729-add-institued_update_add_2.d.ts +2 -0
  82. package/dist/db/psql/migrations/20250522044729-add-institued_update_add_2.js +16 -0
  83. package/dist/db/psql/migrations/20250526035543-add-totalQuantity_add_remainingQuantiy_clm_userHasInventoryHistory.d.ts +3 -0
  84. package/dist/db/psql/migrations/20250526035543-add-totalQuantity_add_remainingQuantiy_clm_userHasInventoryHistory.js +98 -0
  85. package/dist/db/psql/migrations/20250526093322-add-appType_clm_in_module.d.ts +3 -0
  86. package/dist/db/psql/migrations/20250526093322-add-appType_clm_in_module.js +80 -0
  87. package/dist/db/psql/migrations/20250526094030-add-appType_clm_in_action.d.ts +3 -0
  88. package/dist/db/psql/migrations/20250526094030-add-appType_clm_in_action.js +80 -0
  89. package/dist/db/psql/migrations/20250526094233-add-appType_clm_in_module_features.d.ts +3 -0
  90. package/dist/db/psql/migrations/20250526094233-add-appType_clm_in_module_features.js +80 -0
  91. package/dist/db/psql/migrations/20250527065001-add-app-type-in-role-model.d.ts +3 -0
  92. package/dist/db/psql/migrations/20250527065001-add-app-type-in-role-model.js +57 -0
  93. package/dist/db/psql/migrations/20250528045906-add-module-type-to-notifications.d.ts +2 -0
  94. package/dist/db/psql/migrations/20250528045906-add-module-type-to-notifications.js +13 -0
  95. package/dist/db/psql/migrations/20250602090331-add-or-update-user-model-medicalHistory.d.ts +3 -0
  96. package/dist/db/psql/migrations/20250602090331-add-or-update-user-model-medicalHistory.js +107 -0
  97. package/dist/db/psql/migrations/20250602100550-add-planner-sync-status-to-institute.d.ts +3 -0
  98. package/dist/db/psql/migrations/20250602100550-add-planner-sync-status-to-institute.js +113 -0
  99. package/dist/db/psql/migrations/20250603054900-add-clm-for-defult-data-add-or-not-in-ins-model.d.ts +3 -0
  100. package/dist/db/psql/migrations/20250603054900-add-clm-for-defult-data-add-or-not-in-ins-model.js +80 -0
  101. package/dist/db/psql/migrations/20250604103905-add-is-institute-default-field-in-role.d.ts +3 -0
  102. package/dist/db/psql/migrations/20250604103905-add-is-institute-default-field-in-role.js +57 -0
  103. package/dist/db/psql/migrations/20250604121051-update-mobile-number-opstion.d.ts +3 -0
  104. package/dist/db/psql/migrations/20250604121051-update-mobile-number-opstion.js +15 -0
  105. package/dist/db/psql/migrations/20250617064159-update-type-management-jun-17.d.ts +2 -0
  106. package/dist/db/psql/migrations/20250617064159-update-type-management-jun-17.js +11 -0
  107. package/dist/db/psql/migrations/20250627065013-is-institute-default-added-type-managemente.d.ts +2 -0
  108. package/dist/db/psql/migrations/20250627065013-is-institute-default-added-type-managemente.js +12 -0
  109. package/dist/db/psql/migrations/20250701095321-add-clm-institute-pdfId.d.ts +3 -0
  110. package/dist/db/psql/migrations/20250701095321-add-clm-institute-pdfId.js +57 -0
  111. package/dist/db/psql/migrations/20250704102117-add-clm-isDefult-in-typeManagemet.d.ts +2 -0
  112. package/dist/db/psql/migrations/20250704102117-add-clm-isDefult-in-typeManagemet.js +12 -0
  113. package/dist/db/psql/migrations/20250715103324-add-academic-calendar-id-to-batches.d.ts +2 -0
  114. package/dist/db/psql/migrations/20250715103324-add-academic-calendar-id-to-batches.js +13 -0
  115. package/dist/db/psql/migrations/20250715121047-remove-batch-id-from-academic-calendars.d.ts +2 -0
  116. package/dist/db/psql/migrations/20250715121047-remove-batch-id-from-academic-calendars.js +12 -0
  117. package/dist/db/psql/migrations/20250716131731-rename-user-id-to-primary-user-id.d.ts +2 -0
  118. package/dist/db/psql/migrations/20250716131731-rename-user-id-to-primary-user-id.js +9 -0
  119. package/dist/db/psql/migrations/20250717092933-add-floor-id-to-class-rooms.d.ts +3 -0
  120. package/dist/db/psql/migrations/20250717092933-add-floor-id-to-class-rooms.js +86 -0
  121. package/dist/db/psql/migrations/20250718121251-add-clm-classroom-typeid.d.ts +3 -0
  122. package/dist/db/psql/migrations/20250718121251-add-clm-classroom-typeid.js +86 -0
  123. package/dist/db/psql/migrations/20250721065317-add-instituteId-fileSize-to-fileStorage.d.ts +2 -0
  124. package/dist/db/psql/migrations/20250721065317-add-instituteId-fileSize-to-fileStorage.js +22 -0
  125. package/dist/db/psql/migrations/20250721100004-add-shift-slot-id-to-lectures.d.ts +2 -0
  126. package/dist/db/psql/migrations/20250721100004-add-shift-slot-id-to-lectures.js +17 -0
  127. package/dist/db/psql/migrations/20250721105455-add-clm-classroom-add-classroomnumber.d.ts +3 -0
  128. package/dist/db/psql/migrations/20250721105455-add-clm-classroom-add-classroomnumber.js +78 -0
  129. package/dist/db/psql/migrations/20250722071836-add-title-to-floor-management.d.ts +2 -0
  130. package/dist/db/psql/migrations/20250722071836-add-title-to-floor-management.js +14 -0
  131. package/dist/db/psql/migrations/20250723150111-add-clm-batch-slotId.d.ts +3 -0
  132. package/dist/db/psql/migrations/20250723150111-add-clm-batch-slotId.js +86 -0
  133. package/dist/db/psql/migrations/20250724062458-update_classRoom_number_clm_to_string.d.ts +2 -0
  134. package/dist/db/psql/migrations/20250724062458-update_classRoom_number_clm_to_string.js +15 -0
  135. package/dist/db/psql/migrations/20250725132424-add-unique-index-on-instituteId-name-type.d.ts +2 -0
  136. package/dist/db/psql/migrations/20250725132424-add-unique-index-on-instituteId-name-type.js +24 -0
  137. package/dist/db/psql/migrations/20250730104844-update-unique-key-assessment-type.d.ts +2 -0
  138. package/dist/db/psql/migrations/20250730104844-update-unique-key-assessment-type.js +30 -0
  139. package/dist/db/psql/migrations/20250804090437-update_ins_in_pdf_id_string_to_uuid.d.ts +3 -0
  140. package/dist/db/psql/migrations/20250804090437-update_ins_in_pdf_id_string_to_uuid.js +62 -0
  141. package/dist/db/psql/migrations/20250805062440-remove_unique_key_into_batch_subject_project_assessments.d.ts +2 -0
  142. package/dist/db/psql/migrations/20250805062440-remove_unique_key_into_batch_subject_project_assessments.js +21 -0
  143. package/dist/db/psql/migrations/20250805115805-add-descriptions-to-lectures.d.ts +2 -0
  144. package/dist/db/psql/migrations/20250805115805-add-descriptions-to-lectures.js +12 -0
  145. package/dist/db/psql/migrations/20250808100700-add_clm_contectFeed_in_ins_givenId.d.ts +3 -0
  146. package/dist/db/psql/migrations/20250808100700-add_clm_contectFeed_in_ins_givenId.js +86 -0
  147. package/dist/db/psql/migrations/20250808101515-add-sequence-to-institute_entities.d.ts +2 -0
  148. package/dist/db/psql/migrations/20250808101515-add-sequence-to-institute_entities.js +12 -0
  149. package/dist/db/psql/migrations/20250812080521-add-title-and-descriptions-to-batch-subject-project-assessments.d.ts +2 -0
  150. package/dist/db/psql/migrations/20250812080521-add-title-and-descriptions-to-batch-subject-project-assessments.js +17 -0
  151. package/dist/db/psql/migrations/20250820092836-add-sequence-number-to-institute-entities.d.ts +2 -0
  152. package/dist/db/psql/migrations/20250820092836-add-sequence-number-to-institute-entities.js +15 -0
  153. package/dist/db/psql/migrations/20250829103203-remove-syllabus-composit-index.d.ts +2 -0
  154. package/dist/db/psql/migrations/20250829103203-remove-syllabus-composit-index.js +15 -0
  155. package/dist/db/psql/migrations/20250905132024-add-uuid-to-users.d.ts +2 -0
  156. package/dist/db/psql/migrations/20250905132024-add-uuid-to-users.js +12 -0
  157. package/dist/db/psql/migrations/20250908054025-userHasOffer_model_update.d.ts +3 -0
  158. package/dist/db/psql/migrations/20250908054025-userHasOffer_model_update.js +112 -0
  159. package/dist/db/psql/migrations/20250908054754-offer_in_add_offertype_clm.d.ts +3 -0
  160. package/dist/db/psql/migrations/20250908054754-offer_in_add_offertype_clm.js +70 -0
  161. package/dist/db/psql/migrations/20250909061117-add-instituteId-isDefault-to-entityGroup.d.ts +2 -0
  162. package/dist/db/psql/migrations/20250909061117-add-instituteId-isDefault-to-entityGroup.js +17 -0
  163. package/dist/db/psql/migrations/20250911060106-change-wallet-history-columns-to-float.d.ts +2 -0
  164. package/dist/db/psql/migrations/20250911060106-change-wallet-history-columns-to-float.js +39 -0
  165. package/dist/db/psql/migrations/20250911060245-change-coin-to-float-in-wallets.d.ts +2 -0
  166. package/dist/db/psql/migrations/20250911060245-change-coin-to-float-in-wallets.js +17 -0
  167. package/dist/db/psql/migrations/20250917135646-change-storageInBytes-to-float.d.ts +2 -0
  168. package/dist/db/psql/migrations/20250917135646-change-storageInBytes-to-float.js +17 -0
  169. package/dist/db/psql/seeders/20240809100759-add-countries-states-cities.d.ts +2 -0
  170. package/dist/db/psql/seeders/20240809100759-add-countries-states-cities.js +64 -0
  171. package/dist/db/psql/seeders/20250101122757-add-default-permissions-modules.d.ts +2 -0
  172. package/dist/db/psql/seeders/20250101122757-add-default-permissions-modules.js +159 -0
  173. package/dist/db/psql/seeders/Data/AcademicCalendarModule.d.ts +13 -0
  174. package/dist/db/psql/seeders/Data/AcademicCalendarModule.js +24 -0
  175. package/dist/db/psql/seeders/Data/AdministrativeStaffModule.d.ts +10 -0
  176. package/dist/db/psql/seeders/Data/AdministrativeStaffModule.js +38 -0
  177. package/dist/db/psql/seeders/Data/AnnouncementsModule.d.ts +13 -0
  178. package/dist/db/psql/seeders/Data/AnnouncementsModule.js +50 -0
  179. package/dist/db/psql/seeders/Data/AssetsModule.d.ts +10 -0
  180. package/dist/db/psql/seeders/Data/AssetsModule.js +37 -0
  181. package/dist/db/psql/seeders/Data/AttendanceModule.d.ts +13 -0
  182. package/dist/db/psql/seeders/Data/AttendanceModule.js +57 -0
  183. package/dist/db/psql/seeders/Data/BannerModule.d.ts +13 -0
  184. package/dist/db/psql/seeders/Data/BannerModule.js +24 -0
  185. package/dist/db/psql/seeders/Data/BatchModule.d.ts +13 -0
  186. package/dist/db/psql/seeders/Data/BatchModule.js +34 -0
  187. package/dist/db/psql/seeders/Data/BoardModule .d.ts +10 -0
  188. package/dist/db/psql/seeders/Data/BoardModule .js +18 -0
  189. package/dist/db/psql/seeders/Data/BookAssessmentsModule.d.ts +13 -0
  190. package/dist/db/psql/seeders/Data/BookAssessmentsModule.js +23 -0
  191. package/dist/db/psql/seeders/Data/CategoriesModule.d.ts +10 -0
  192. package/dist/db/psql/seeders/Data/CategoriesModule.js +18 -0
  193. package/dist/db/psql/seeders/Data/ClassroomModule.d.ts +13 -0
  194. package/dist/db/psql/seeders/Data/ClassroomModule.js +37 -0
  195. package/dist/db/psql/seeders/Data/DivisionModule.d.ts +13 -0
  196. package/dist/db/psql/seeders/Data/DivisionModule.js +25 -0
  197. package/dist/db/psql/seeders/Data/EventModule.d.ts +13 -0
  198. package/dist/db/psql/seeders/Data/EventModule.js +22 -0
  199. package/dist/db/psql/seeders/Data/ExamsAndResultsModule.d.ts +13 -0
  200. package/dist/db/psql/seeders/Data/ExamsAndResultsModule.js +113 -0
  201. package/dist/db/psql/seeders/Data/FacilityModule.d.ts +13 -0
  202. package/dist/db/psql/seeders/Data/FacilityModule.js +22 -0
  203. package/dist/db/psql/seeders/Data/FeeAndDiscountModule.d.ts +13 -0
  204. package/dist/db/psql/seeders/Data/FeeAndDiscountModule.js +239 -0
  205. package/dist/db/psql/seeders/Data/FeedBackModule.d.ts +13 -0
  206. package/dist/db/psql/seeders/Data/FeedBackModule.js +27 -0
  207. package/dist/db/psql/seeders/Data/FileModule.d.ts +10 -0
  208. package/dist/db/psql/seeders/Data/FileModule.js +38 -0
  209. package/dist/db/psql/seeders/Data/GenerateIdModule.d.ts +13 -0
  210. package/dist/db/psql/seeders/Data/GenerateIdModule.js +19 -0
  211. package/dist/db/psql/seeders/Data/HolidayModule.d.ts +13 -0
  212. package/dist/db/psql/seeders/Data/HolidayModule.js +22 -0
  213. package/dist/db/psql/seeders/Data/HomeworkModule.d.ts +13 -0
  214. package/dist/db/psql/seeders/Data/HomeworkModule.js +42 -0
  215. package/dist/db/psql/seeders/Data/IndexModule.d.ts +13 -0
  216. package/dist/db/psql/seeders/Data/IndexModule.js +97 -0
  217. package/dist/db/psql/seeders/Data/InquiryModule.d.ts +13 -0
  218. package/dist/db/psql/seeders/Data/InquiryModule.js +22 -0
  219. package/dist/db/psql/seeders/Data/InstituteModule.d.ts +13 -0
  220. package/dist/db/psql/seeders/Data/InstituteModule.js +63 -0
  221. package/dist/db/psql/seeders/Data/InventoryModule.d.ts +13 -0
  222. package/dist/db/psql/seeders/Data/InventoryModule.js +42 -0
  223. package/dist/db/psql/seeders/Data/JobApplyModule.d.ts +13 -0
  224. package/dist/db/psql/seeders/Data/JobApplyModule.js +22 -0
  225. package/dist/db/psql/seeders/Data/LectureModule.d.ts +10 -0
  226. package/dist/db/psql/seeders/Data/LectureModule.js +28 -0
  227. package/dist/db/psql/seeders/Data/ParentModule.d.ts +10 -0
  228. package/dist/db/psql/seeders/Data/ParentModule.js +38 -0
  229. package/dist/db/psql/seeders/Data/PayoutModule.d.ts +10 -0
  230. package/dist/db/psql/seeders/Data/PayoutModule.js +18 -0
  231. package/dist/db/psql/seeders/Data/PdcChequesModule.d.ts +13 -0
  232. package/dist/db/psql/seeders/Data/PdcChequesModule.js +27 -0
  233. package/dist/db/psql/seeders/Data/PhotosGalleryModule.d.ts +13 -0
  234. package/dist/db/psql/seeders/Data/PhotosGalleryModule.js +27 -0
  235. package/dist/db/psql/seeders/Data/PlannerModule.d.ts +10 -0
  236. package/dist/db/psql/seeders/Data/PlannerModule.js +18 -0
  237. package/dist/db/psql/seeders/Data/ProjectAssessmentsModule.d.ts +13 -0
  238. package/dist/db/psql/seeders/Data/ProjectAssessmentsModule.js +23 -0
  239. package/dist/db/psql/seeders/Data/ReplaceTeacherModule.d.ts +13 -0
  240. package/dist/db/psql/seeders/Data/ReplaceTeacherModule.js +22 -0
  241. package/dist/db/psql/seeders/Data/RoleModule.d.ts +13 -0
  242. package/dist/db/psql/seeders/Data/RoleModule.js +53 -0
  243. package/dist/db/psql/seeders/Data/RollNumberModule.d.ts +13 -0
  244. package/dist/db/psql/seeders/Data/RollNumberModule.js +22 -0
  245. package/dist/db/psql/seeders/Data/SchoolFeeModule.d.ts +10 -0
  246. package/dist/db/psql/seeders/Data/SchoolFeeModule.js +38 -0
  247. package/dist/db/psql/seeders/Data/SchoolModule.d.ts +13 -0
  248. package/dist/db/psql/seeders/Data/SchoolModule.js +63 -0
  249. package/dist/db/psql/seeders/Data/SchoolRegistration.d.ts +13 -0
  250. package/dist/db/psql/seeders/Data/SchoolRegistration.js +22 -0
  251. package/dist/db/psql/seeders/Data/SettingsModule.d.ts +10 -0
  252. package/dist/db/psql/seeders/Data/SettingsModule.js +28 -0
  253. package/dist/db/psql/seeders/Data/StaffTimingModule.d.ts +13 -0
  254. package/dist/db/psql/seeders/Data/StaffTimingModule.js +22 -0
  255. package/dist/db/psql/seeders/Data/StudentModule.d.ts +10 -0
  256. package/dist/db/psql/seeders/Data/StudentModule.js +18 -0
  257. package/dist/db/psql/seeders/Data/SubjectModule.d.ts +10 -0
  258. package/dist/db/psql/seeders/Data/SubjectModule.js +37 -0
  259. package/dist/db/psql/seeders/Data/SyllabusManagementModule.d.ts +13 -0
  260. package/dist/db/psql/seeders/Data/SyllabusManagementModule.js +25 -0
  261. package/dist/db/psql/seeders/Data/TeacherModule.d.ts +10 -0
  262. package/dist/db/psql/seeders/Data/TeacherModule.js +68 -0
  263. package/dist/db/psql/seeders/Data/TestimonialsModule.d.ts +13 -0
  264. package/dist/db/psql/seeders/Data/TestimonialsModule.js +27 -0
  265. package/dist/db/psql/seeders/Data/TimetableModule.d.ts +13 -0
  266. package/dist/db/psql/seeders/Data/TimetableModule.js +43 -0
  267. package/dist/db/psql/seeders/Data/To-doModule.d.ts +13 -0
  268. package/dist/db/psql/seeders/Data/To-doModule.js +27 -0
  269. package/dist/db/psql/seeders/Data/TypeManagementModule.d.ts +13 -0
  270. package/dist/db/psql/seeders/Data/TypeManagementModule.js +28 -0
  271. package/dist/db/psql/seeders/Data/UserModule.d.ts +13 -0
  272. package/dist/db/psql/seeders/Data/UserModule.js +266 -0
  273. package/dist/db/psql/seeders/Data/appType.d.ts +4 -0
  274. package/dist/db/psql/seeders/Data/appType.js +8 -0
  275. package/dist/index.d.ts +415 -415
  276. package/dist/index.js +418 -446
  277. package/package.json +3 -3
  278. package/dist/generate-index.d.ts +0 -1
  279. package/dist/generate-index.js +0 -47
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ const dataTables = [
5
+ {
6
+ tableName: 'master_leaves',
7
+ addFields: [
8
+ {
9
+ fieldName: 'status',
10
+ type: {
11
+ type: Sequelize.ENUM('ACTIVE', 'INACTIVE'),
12
+ defaultValue: 'ACTIVE',
13
+ allowNull: true,
14
+ },
15
+ },
16
+ {
17
+ fieldName: 'leave',
18
+ type: {
19
+ type: Sequelize.ENUM('PAID', 'UN_PAID'),
20
+ defaultValue: 'PAID',
21
+ allowNull: true,
22
+ },
23
+ },
24
+ ],
25
+ },
26
+ ];
27
+ for (const table of dataTables) {
28
+ const tableDescription = await queryInterface.describeTable(table.tableName);
29
+ for (const field of table.addFields) {
30
+ const columnName = field.type.field || field.fieldName;
31
+ if (!tableDescription[columnName]) {
32
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
33
+ }
34
+ }
35
+ }
36
+ };
37
+ const down = async (queryInterface, Sequelize) => {
38
+ const dataTables = [
39
+ {
40
+ tableName: 'master_leaves',
41
+ addFields: [
42
+ {
43
+ fieldName: 'status',
44
+ type: {
45
+ type: Sequelize.ENUM('ACTIVE', 'INACTIVE'),
46
+ defaultValue: 'ACTIVE',
47
+ allowNull: true,
48
+ },
49
+ },
50
+ {
51
+ fieldName: 'leave',
52
+ type: {
53
+ type: Sequelize.ENUM('PAID', 'UN_PAID'),
54
+ defaultValue: 'PAID',
55
+ allowNull: true,
56
+ },
57
+ },
58
+ ],
59
+ },
60
+ ];
61
+ for (const table of dataTables) {
62
+ const tableDescription = await queryInterface.describeTable(table.tableName);
63
+ for (const field of table.addFields) {
64
+ const columnName = field.type.field || field.fieldName;
65
+ if (tableDescription[columnName]) {
66
+ await queryInterface.removeColumn(table.tableName, columnName);
67
+ }
68
+ }
69
+ }
70
+ };
71
+ module.exports = { up, down };
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any, Sequelize: any): Promise<void>;
2
+ export function down(): Promise<void>;
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const tableUpdates = [
4
+ {
5
+ tableName: 'academic_calendars', // Table name
6
+ fieldName: 'status',
7
+ newEnumValues: ['CURRENT_ACADEMIC_CALENDAR', 'FUTURE_ACADEMIC_CALENDAR', 'PAST_ACADEMIC_CALENDAR'],
8
+ oldEnumValues: ['CURRENT_ACADEMIC_CALENDAR', 'FUTURE_ACADEMIC_CALENDAR'],
9
+ },
10
+ ];
11
+ const up = async (queryInterface, Sequelize) => {
12
+ for (const table of tableUpdates) {
13
+ const tableDescription = await queryInterface.describeTable(table.tableName);
14
+ if (tableDescription[table.fieldName]) {
15
+ // Step 1: Change column to a neutral type (TEXT)
16
+ await queryInterface.changeColumn(table.tableName, table.fieldName, {
17
+ type: Sequelize.STRING, // Temporary type
18
+ allowNull: true,
19
+ });
20
+ // Step 2: Forcefully drop the ENUM type
21
+ await queryInterface.sequelize.query(`ALTER TABLE "${table.tableName}" ALTER COLUMN "${table.fieldName}" TYPE TEXT USING "${table.fieldName}"::text;`);
22
+ await queryInterface.sequelize.query(`DROP TYPE IF EXISTS "enum_${table.tableName}_${table.fieldName}" CASCADE;`);
23
+ }
24
+ // Step 3: Recreate ENUM column with new values
25
+ await queryInterface.changeColumn(table.tableName, table.fieldName, {
26
+ type: Sequelize.ENUM('CURRENT_ACADEMIC_CALENDAR', 'FUTURE_ACADEMIC_CALENDAR', 'PAST_ACADEMIC_CALENDAR'),
27
+ allowNull: true,
28
+ });
29
+ }
30
+ };
31
+ const down = async () => {
32
+ //
33
+ };
34
+ module.exports = { up, down };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,78 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ const dataTables = [
5
+ {
6
+ tableName: 'institutes',
7
+ addFields: [
8
+ {
9
+ fieldName: 'district',
10
+ type: {
11
+ type: Sequelize.STRING,
12
+ allowNull: true,
13
+ defaultValue: null,
14
+ },
15
+ },
16
+ ],
17
+ updateFields: [],
18
+ deleteFields: [],
19
+ },
20
+ ];
21
+ for (const table of dataTables) {
22
+ const tableDescription = await queryInterface.describeTable(table.tableName);
23
+ for (const field of table.addFields) {
24
+ const columnName = field.type.field || field.fieldName;
25
+ if (!tableDescription[columnName]) {
26
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
27
+ }
28
+ }
29
+ for (const field of table.updateFields) {
30
+ const columnName = field.type.field || field.fieldName;
31
+ if (tableDescription[columnName]) {
32
+ await queryInterface.changeColumn(table.tableName, columnName, field.type);
33
+ }
34
+ }
35
+ for (const field of table.deleteFields) {
36
+ const columnName = field.type.field || field.fieldName;
37
+ if (tableDescription[columnName]) {
38
+ await queryInterface.removeColumn(table.tableName, columnName);
39
+ }
40
+ }
41
+ }
42
+ };
43
+ const down = async (queryInterface, Sequelize) => {
44
+ const dataTables = [
45
+ {
46
+ tableName: 'institutes', // Table name
47
+ addFields: [
48
+ {
49
+ fieldName: 'district',
50
+ type: {
51
+ type: Sequelize.STRING,
52
+ allowNull: true,
53
+ defaultValue: null,
54
+ },
55
+ },
56
+ ],
57
+ updateFields: [],
58
+ deleteFields: [],
59
+ },
60
+ ];
61
+ for (const table of dataTables) {
62
+ const tableDescription = await queryInterface.describeTable(table.tableName);
63
+ for (const field of table.addFields) {
64
+ const columnName = field.type.field || field.fieldName;
65
+ if (tableDescription[columnName]) {
66
+ await queryInterface.removeColumn(table.tableName, columnName);
67
+ }
68
+ }
69
+ // Add deleted fields back (if necessary)
70
+ for (const field of table.deleteFields) {
71
+ const columnName = field.type.field || field.fieldName;
72
+ if (!tableDescription[columnName]) {
73
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
74
+ }
75
+ }
76
+ }
77
+ };
78
+ module.exports = { up, down };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ const tableName = 'fee_history';
5
+ const columnName = 'fee_type_id';
6
+ const tableDescription = await queryInterface.describeTable(tableName);
7
+ // Remove the old column if it exists
8
+ if (tableDescription[columnName]) {
9
+ await queryInterface.removeColumn(tableName, columnName);
10
+ }
11
+ // Add the new column with ARRAY(UUID)
12
+ await queryInterface.addColumn(tableName, columnName, {
13
+ type: Sequelize.ARRAY(Sequelize.UUID),
14
+ allowNull: true,
15
+ defaultValue: Sequelize.literal('ARRAY[]::UUID[]'),
16
+ field: columnName,
17
+ });
18
+ };
19
+ const down = async (queryInterface, Sequelize) => {
20
+ const tableName = 'fee_history';
21
+ const columnName = 'fee_type_id';
22
+ const tableDescription = await queryInterface.describeTable(tableName);
23
+ // Remove the ARRAY column if it exists
24
+ if (tableDescription[columnName]) {
25
+ await queryInterface.removeColumn(tableName, columnName);
26
+ }
27
+ // Add the original UUID column back
28
+ await queryInterface.addColumn(tableName, columnName, {
29
+ type: Sequelize.UUID,
30
+ allowNull: true,
31
+ field: columnName,
32
+ });
33
+ };
34
+ module.exports = { up, down };
@@ -0,0 +1,2 @@
1
+ export function up(queryInterface: any): Promise<void>;
2
+ export function down(queryInterface: any): Promise<void>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ module.exports = {
3
+ up: async (queryInterface) => {
4
+ // Drop existing index if it exists
5
+ await queryInterface.sequelize.query(`
6
+ DROP INDEX IF EXISTS unique_invoice_institute;
7
+ `);
8
+ // Create partial unique index
9
+ await queryInterface.sequelize.query(`
10
+ CREATE UNIQUE INDEX unique_invoice_institute
11
+ ON fee_history (institute_id, invoice_id)
12
+ WHERE invoice_id IS NOT NULL;
13
+ `);
14
+ },
15
+ down: async (queryInterface) => {
16
+ // Rollback: Drop the custom index
17
+ await queryInterface.sequelize.query(`
18
+ DROP INDEX IF EXISTS unique_invoice_institute;
19
+ `);
20
+ },
21
+ // CREATE UNIQUE INDEX fee_history_institute_id_invoice_id
22
+ // ON fee_history (institute_id, invoice_id);
23
+ // npx sequelize-cli migration:generate --name recreate-old-full-index
24
+ // module.exports = {
25
+ // up: async (queryInterface, Sequelize) => {
26
+ // await queryInterface.addIndex('fee_history', ['institute_id', 'invoice_id'], {
27
+ // unique: true,
28
+ // name: 'fee_history_institute_id_invoice_id',
29
+ // });
30
+ // },
31
+ // down: async (queryInterface, Sequelize) => {
32
+ // await queryInterface.removeIndex('fee_history', 'fee_history_institute_id_invoice_id');
33
+ // }
34
+ // };
35
+ };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ const dataTables = [
5
+ {
6
+ tableName: 'banners',
7
+ addFields: [
8
+ {
9
+ fieldName: 'user_type',
10
+ type: {
11
+ type: Sequelize.ENUM('MASTER_ADMIN', 'ADMIN', 'INSTITUTE_MASTER_ADMIN', 'INSTITUTE_ADMIN', 'TEACHER', 'STUDENT', 'PARENTS'),
12
+ defaultValue: null,
13
+ allowNull: true,
14
+ },
15
+ },
16
+ ],
17
+ },
18
+ ];
19
+ for (const table of dataTables) {
20
+ const tableDescription = await queryInterface.describeTable(table.tableName);
21
+ for (const field of table.addFields) {
22
+ const columnName = field.type.field || field.fieldName;
23
+ if (!tableDescription[columnName]) {
24
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
25
+ }
26
+ }
27
+ }
28
+ };
29
+ const down = async (queryInterface, Sequelize) => {
30
+ const dataTables = [
31
+ {
32
+ tableName: 'banners',
33
+ addFields: [
34
+ {
35
+ fieldName: 'user_type',
36
+ type: {
37
+ type: Sequelize.ENUM('MASTER_ADMIN', 'ADMIN', 'INSTITUTE_MASTER_ADMIN', 'INSTITUTE_ADMIN', 'TEACHER', 'STUDENT', 'PARENTS'),
38
+ defaultValue: null,
39
+ allowNull: true,
40
+ },
41
+ },
42
+ ],
43
+ },
44
+ ];
45
+ for (const table of dataTables) {
46
+ const tableDescription = await queryInterface.describeTable(table.tableName);
47
+ for (const field of table.addFields) {
48
+ const columnName = field.type.field || field.fieldName;
49
+ if (tableDescription[columnName]) {
50
+ await queryInterface.removeColumn(table.tableName, columnName);
51
+ }
52
+ }
53
+ }
54
+ };
55
+ module.exports = { up, down };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,86 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ const dataTables = [
5
+ {
6
+ tableName: 'fees_collections',
7
+ addFields: [
8
+ {
9
+ fieldName: 'academicCalendarId',
10
+ type: {
11
+ type: Sequelize.UUID,
12
+ allowNull: true,
13
+ field: 'academic_calendar_id',
14
+ ref: {
15
+ model: 'academic_calendars',
16
+ key: 'id',
17
+ },
18
+ },
19
+ },
20
+ ],
21
+ updateFields: [],
22
+ deleteFields: [],
23
+ },
24
+ ];
25
+ for (const table of dataTables) {
26
+ const tableDescription = await queryInterface.describeTable(table.tableName);
27
+ for (const field of table.addFields) {
28
+ const columnName = field.type.field || field.fieldName;
29
+ if (!tableDescription[columnName]) {
30
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
31
+ }
32
+ }
33
+ for (const field of table.updateFields) {
34
+ const columnName = field.type.field || field.fieldName;
35
+ if (tableDescription[columnName]) {
36
+ await queryInterface.changeColumn(table.tableName, columnName, field.type);
37
+ }
38
+ }
39
+ for (const field of table.deleteFields) {
40
+ const columnName = field.type.field || field.fieldName;
41
+ if (tableDescription[columnName]) {
42
+ await queryInterface.removeColumn(table.tableName, columnName);
43
+ }
44
+ }
45
+ }
46
+ };
47
+ const down = async (queryInterface, Sequelize) => {
48
+ const dataTables = [
49
+ {
50
+ tableName: 'fees_collections',
51
+ addFields: [
52
+ {
53
+ fieldName: 'academicCalendarId',
54
+ type: {
55
+ type: Sequelize.UUID,
56
+ allowNull: true,
57
+ field: 'academic_calendar_id',
58
+ ref: {
59
+ model: 'academic_calendars',
60
+ key: 'id',
61
+ },
62
+ },
63
+ },
64
+ ],
65
+ updateFields: [],
66
+ deleteFields: [],
67
+ },
68
+ ];
69
+ for (const table of dataTables) {
70
+ const tableDescription = await queryInterface.describeTable(table.tableName);
71
+ for (const field of table.addFields) {
72
+ const columnName = field.type.field || field.fieldName;
73
+ if (tableDescription[columnName]) {
74
+ await queryInterface.removeColumn(table.tableName, columnName);
75
+ }
76
+ }
77
+ // Add deleted fields back (if necessary)
78
+ for (const field of table.deleteFields) {
79
+ const columnName = field.type.field || field.fieldName;
80
+ if (!tableDescription[columnName]) {
81
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
82
+ }
83
+ }
84
+ }
85
+ };
86
+ module.exports = { up, down };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ // 1. Alter the existing column to allow null
5
+ await queryInterface.changeColumn('banners', 'user_type', {
6
+ type: Sequelize.ENUM('MASTER_ADMIN', 'ADMIN', 'INSTITUTE_MASTER_ADMIN', 'INSTITUTE_ADMIN', 'TEACHER', 'STUDENT', 'PARENTS'),
7
+ allowNull: true,
8
+ defaultValue: null,
9
+ });
10
+ };
11
+ const down = async (queryInterface, Sequelize) => {
12
+ // 1. Revert back to NOT NULL if needed
13
+ await queryInterface.changeColumn('banners', 'user_type', {
14
+ type: Sequelize.ENUM('MASTER_ADMIN', 'ADMIN', 'INSTITUTE_MASTER_ADMIN', 'INSTITUTE_ADMIN', 'TEACHER', 'STUDENT', 'PARENTS'),
15
+ allowNull: false,
16
+ });
17
+ };
18
+ module.exports = { up, down };
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ await queryInterface.changeColumn('institutes', 'about_institute', {
6
+ type: Sequelize.STRING(1000),
7
+ allowNull: true,
8
+ });
9
+ },
10
+ down: async (queryInterface, Sequelize) => {
11
+ await queryInterface.changeColumn('institutes', 'about_institute', {
12
+ type: Sequelize.STRING(255),
13
+ allowNull: true,
14
+ });
15
+ },
16
+ };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ const dataTables = [
5
+ {
6
+ tableName: 'working_days',
7
+ addFields: [
8
+ {
9
+ fieldName: 'dayOfWeek',
10
+ type: {
11
+ type: Sequelize.INTEGER,
12
+ allowNull: true,
13
+ defaultValue: null,
14
+ field: 'day_of_week',
15
+ },
16
+ },
17
+ ],
18
+ updateFields: [],
19
+ deleteFields: [],
20
+ },
21
+ ];
22
+ for (const table of dataTables) {
23
+ const tableDescription = await queryInterface.describeTable(table.tableName);
24
+ for (const field of table.addFields) {
25
+ const columnName = field.type.field || field.fieldName;
26
+ if (!tableDescription[columnName]) {
27
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
28
+ }
29
+ }
30
+ for (const field of table.updateFields) {
31
+ const columnName = field.type.field || field.fieldName;
32
+ if (tableDescription[columnName]) {
33
+ await queryInterface.changeColumn(table.tableName, columnName, field.type);
34
+ }
35
+ }
36
+ for (const field of table.deleteFields) {
37
+ const columnName = field.type.field || field.fieldName;
38
+ if (tableDescription[columnName]) {
39
+ await queryInterface.removeColumn(table.tableName, columnName);
40
+ }
41
+ }
42
+ }
43
+ };
44
+ const down = async (queryInterface, Sequelize) => {
45
+ const dataTables = [
46
+ {
47
+ tableName: 'working_days', // Table name
48
+ addFields: [
49
+ {
50
+ fieldName: 'dayOfWeek',
51
+ type: {
52
+ type: Sequelize.INTEGER,
53
+ allowNull: true,
54
+ defaultValue: null,
55
+ field: 'day_of_week',
56
+ },
57
+ },
58
+ ],
59
+ updateFields: [],
60
+ deleteFields: [],
61
+ },
62
+ ];
63
+ for (const table of dataTables) {
64
+ const tableDescription = await queryInterface.describeTable(table.tableName);
65
+ for (const field of table.addFields) {
66
+ const columnName = field.type.field || field.fieldName;
67
+ if (tableDescription[columnName]) {
68
+ await queryInterface.removeColumn(table.tableName, columnName);
69
+ }
70
+ }
71
+ // Add deleted fields back (if necessary)
72
+ for (const field of table.deleteFields) {
73
+ const columnName = field.type.field || field.fieldName;
74
+ if (!tableDescription[columnName]) {
75
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
76
+ }
77
+ }
78
+ }
79
+ };
80
+ module.exports = { up, down };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+ /** @type {import('sequelize-cli').Migration} */
3
+ const up = async (queryInterface, Sequelize) => {
4
+ const dataTables = [
5
+ {
6
+ tableName: 'fees_collections',
7
+ addFields: [
8
+ {
9
+ fieldName: 'isLeft',
10
+ type: {
11
+ type: Sequelize.BOOLEAN,
12
+ defaultValue: false,
13
+ allowNull: true,
14
+ field: 'is_left',
15
+ },
16
+ },
17
+ ],
18
+ updateFields: [],
19
+ deleteFields: [],
20
+ },
21
+ ];
22
+ for (const table of dataTables) {
23
+ const tableDescription = await queryInterface.describeTable(table.tableName);
24
+ for (const field of table.addFields) {
25
+ const columnName = field.type.field || field.fieldName;
26
+ if (!tableDescription[columnName]) {
27
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
28
+ }
29
+ }
30
+ for (const field of table.updateFields) {
31
+ const columnName = field.type.field || field.fieldName;
32
+ if (tableDescription[columnName]) {
33
+ await queryInterface.changeColumn(table.tableName, columnName, field.type);
34
+ }
35
+ }
36
+ for (const field of table.deleteFields) {
37
+ const columnName = field.type.field || field.fieldName;
38
+ if (tableDescription[columnName]) {
39
+ await queryInterface.removeColumn(table.tableName, columnName);
40
+ }
41
+ }
42
+ }
43
+ };
44
+ const down = async (queryInterface, Sequelize) => {
45
+ const dataTables = [
46
+ {
47
+ tableName: 'fees_collections', // Table name
48
+ addFields: [
49
+ {
50
+ fieldName: 'isLeft',
51
+ type: {
52
+ type: Sequelize.BOOLEAN,
53
+ defaultValue: false,
54
+ allowNull: true,
55
+ field: 'is_left',
56
+ },
57
+ },
58
+ ],
59
+ updateFields: [],
60
+ deleteFields: [],
61
+ },
62
+ ];
63
+ for (const table of dataTables) {
64
+ const tableDescription = await queryInterface.describeTable(table.tableName);
65
+ for (const field of table.addFields) {
66
+ const columnName = field.type.field || field.fieldName;
67
+ if (tableDescription[columnName]) {
68
+ await queryInterface.removeColumn(table.tableName, columnName);
69
+ }
70
+ }
71
+ // Add deleted fields back (if necessary)
72
+ for (const field of table.deleteFields) {
73
+ const columnName = field.type.field || field.fieldName;
74
+ if (!tableDescription[columnName]) {
75
+ await queryInterface.addColumn(table.tableName, columnName, field.type);
76
+ }
77
+ }
78
+ }
79
+ };
80
+ module.exports = { up, down };
@@ -0,0 +1,3 @@
1
+ /** @type {import('sequelize-cli').Migration} */
2
+ export const up: any;
3
+ export function down(queryInterface: any, Sequelize: any): Promise<void>;