efiber-prisma-schema 1.10.4 → 1.10.5

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 (218) hide show
  1. package/package.json +1 -1
  2. package/prisma/migrations/0_init/migration.sql +0 -0
  3. package/prisma/migrations/20240202082320_init/migration.sql +17 -0
  4. package/prisma/migrations/20240202091027_camusat_client/migration.sql +29 -0
  5. package/prisma/migrations/20240202124330_camusatcountry/migration.sql +20 -0
  6. package/prisma/migrations/20240203085209_feature/migration.sql +66 -0
  7. package/prisma/migrations/20240203123342_feature/migration.sql +38 -0
  8. package/prisma/migrations/20240203124454_featuretype/migration.sql +30 -0
  9. package/prisma/migrations/20240203134414_featuretype/migration.sql +8 -0
  10. package/prisma/migrations/20240203154141_featuretype/migration.sql +47 -0
  11. package/prisma/migrations/20240203203915_template/migration.sql +82 -0
  12. package/prisma/migrations/20240204040725_template_component/migration.sql +83 -0
  13. package/prisma/migrations/20240204043127_template_component/migration.sql +3 -0
  14. package/prisma/migrations/20240204051036_template_component/migration.sql +17 -0
  15. package/prisma/migrations/20240204052923_template_component/migration.sql +24 -0
  16. package/prisma/migrations/20240204103902_template_component/migration.sql +10 -0
  17. package/prisma/migrations/20240204112656_camusat_client/migration.sql +13 -0
  18. package/prisma/migrations/20240204113143_camusat_client/migration.sql +16 -0
  19. package/prisma/migrations/20240204133932_camusat_client/migration.sql +13 -0
  20. package/prisma/migrations/20240204134637_camusat_client/migration.sql +16 -0
  21. package/prisma/migrations/20240204135459_camusat_client/migration.sql +8 -0
  22. package/prisma/migrations/20240204135615_camusat_client/migration.sql +16 -0
  23. package/prisma/migrations/20240204141001_camusat_client/migration.sql +16 -0
  24. package/prisma/migrations/20240205070804_template/migration.sql +60 -0
  25. package/prisma/migrations/20240205071138_template/migration.sql +8 -0
  26. package/prisma/migrations/20240205074015_template/migration.sql +11 -0
  27. package/prisma/migrations/20240205100949_template/migration.sql +3 -0
  28. package/prisma/migrations/20240205170632_template/migration.sql +26 -0
  29. package/prisma/migrations/20240205171038_template/migration.sql +8 -0
  30. package/prisma/migrations/20240206115225_template/migration.sql +2 -0
  31. package/prisma/migrations/20240206115743_template/migration.sql +8 -0
  32. package/prisma/migrations/20240206122145_template/migration.sql +8 -0
  33. package/prisma/migrations/20240206122530_template/migration.sql +17 -0
  34. package/prisma/migrations/20240206124010_template/migration.sql +2 -0
  35. package/prisma/migrations/20240206124504_template/migration.sql +8 -0
  36. package/prisma/migrations/20240207123737_template_component/migration.sql +27 -0
  37. package/prisma/migrations/20240207182427_project_workflow/migration.sql +13 -0
  38. package/prisma/migrations/20240208080438_project_workflow/migration.sql +29 -0
  39. package/prisma/migrations/20240208094341_project_workflow/migration.sql +20 -0
  40. package/prisma/migrations/20240208094513_project_workflow/migration.sql +11 -0
  41. package/prisma/migrations/20240208110543_feature/migration.sql +42 -0
  42. package/prisma/migrations/20240209094123_feature/migration.sql +2 -0
  43. package/prisma/migrations/20240211174122_camusat_client/migration.sql +2 -0
  44. package/prisma/migrations/20240219060721_feature/migration.sql +14 -0
  45. package/prisma/migrations/20240301063634_material/migration.sql +40 -0
  46. package/prisma/migrations/20240301064450_material/migration.sql +8 -0
  47. package/prisma/migrations/20240301071914_bill_of_material/migration.sql +32 -0
  48. package/prisma/migrations/20240301130744_dispatch_material/migration.sql +19 -0
  49. package/prisma/migrations/20240304051150_dispatch_material/migration.sql +5 -0
  50. package/prisma/migrations/20240304060722_dispatch_material/migration.sql +5 -0
  51. package/prisma/migrations/20240304060902_dispatch_material/migration.sql +8 -0
  52. package/prisma/migrations/20240304061156_dispatch_material/migration.sql +9 -0
  53. package/prisma/migrations/20240304173952_stock_movement/migration.sql +40 -0
  54. package/prisma/migrations/20240305072137_stock_movement/migration.sql +239 -0
  55. package/prisma/migrations/20240305072744_stock_movement/migration.sql +12 -0
  56. package/prisma/migrations/20240306055959_stock_movement/migration.sql +11 -0
  57. package/prisma/migrations/20240306062724_stock_movement/migration.sql +2 -0
  58. package/prisma/migrations/20240306113309_stock_movement/migration.sql +8 -0
  59. package/prisma/migrations/20240306141448_stock_movement/migration.sql +5 -0
  60. package/prisma/migrations/20240306144254_stock_movement/migration.sql +5 -0
  61. package/prisma/migrations/20240306154800_stock_movement/migration.sql +8 -0
  62. package/prisma/migrations/20240307095205_stock_movement/migration.sql +16 -0
  63. package/prisma/migrations/20240308175028_new/migration.sql +8 -0
  64. package/prisma/migrations/20240310114206_dispatch_project/migration.sql +5 -0
  65. package/prisma/migrations/20240311121226_new/migration.sql +71 -0
  66. package/prisma/migrations/20240311171024_new/migration.sql +8 -0
  67. package/prisma/migrations/20240312090511_material/migration.sql +17 -0
  68. package/prisma/migrations/20240312095600_material/migration.sql +16 -0
  69. package/prisma/migrations/20240312115431_material/migration.sql +11 -0
  70. package/prisma/migrations/20240316161358_work_order/migration.sql +3 -0
  71. package/prisma/migrations/20240318112352_problem_categorization/migration.sql +14 -0
  72. package/prisma/migrations/20240318112616_problem_categorization/migration.sql +8 -0
  73. package/prisma/migrations/20240319072457_work_order/migration.sql +5 -0
  74. package/prisma/migrations/20240320124008_dispatch_project/migration.sql +26 -0
  75. package/prisma/migrations/20240321081929_dispatch_project/migration.sql +8 -0
  76. package/prisma/migrations/20240321102139_work_order/migration.sql +45 -0
  77. package/prisma/migrations/20240321103420_work_order/migration.sql +14 -0
  78. package/prisma/migrations/20240321103537_work_order/migration.sql +2 -0
  79. package/prisma/migrations/20240322061027_material/migration.sql +11 -0
  80. package/prisma/migrations/20240323122952_work_order/migration.sql +6 -0
  81. package/prisma/migrations/20240323125822_work_order/migration.sql +2 -0
  82. package/prisma/migrations/20240325082900_work_order/migration.sql +11 -0
  83. package/prisma/migrations/20240326115608_work_order/migration.sql +18 -0
  84. package/prisma/migrations/20240327051438_work_order/migration.sql +8 -0
  85. package/prisma/migrations/20240327100905_work_order/migration.sql +24 -0
  86. package/prisma/migrations/20240328121421_work_order/migration.sql +26 -0
  87. package/prisma/migrations/20240328122320_work_order/migration.sql +9 -0
  88. package/prisma/migrations/20240328123833_work_order/migration.sql +3 -0
  89. package/prisma/migrations/20240328132921_work_order/migration.sql +5 -0
  90. package/prisma/migrations/20240328142205_work_order/migration.sql +2 -0
  91. package/prisma/migrations/20240401184203_billof_material/migration.sql +8 -0
  92. package/prisma/migrations/20240402125649_feature/migration.sql +2 -0
  93. package/prisma/migrations/20240404054220_project/migration.sql +29 -0
  94. package/prisma/migrations/20240407224722_user/migration.sql +2 -0
  95. package/prisma/migrations/20240408100730_template_component/migration.sql +12 -0
  96. package/prisma/migrations/20240409094754_template/migration.sql +2 -0
  97. package/prisma/migrations/20240409095653_template/migration.sql +2 -0
  98. package/prisma/migrations/20240409100032_features/migration.sql +2 -0
  99. package/prisma/migrations/20240409100313_project/migration.sql +5 -0
  100. package/prisma/migrations/20240411073053_subject_email_configurations/migration.sql +2 -0
  101. package/prisma/migrations/20240412093517_work_order_tasks/migration.sql +3 -0
  102. package/prisma/migrations/20240413085449_problem_categorization/migration.sql +5 -0
  103. package/prisma/migrations/20240415101559_project/migration.sql +20 -0
  104. package/prisma/migrations/20240417062104_sync_to_git/migration.sql +122 -0
  105. package/prisma/migrations/20240417125606_workorder/migration.sql +2 -0
  106. package/prisma/migrations/20240422112728_movement_logs/migration.sql +17 -0
  107. package/prisma/migrations/20240423100846_work_order_task/migration.sql +3 -0
  108. package/prisma/migrations/20240428163748_email_count/migration.sql +6 -0
  109. package/prisma/migrations/20240430112607_work_order_edit_logs/migration.sql +25 -0
  110. package/prisma/migrations/20240502051952_template_status_color/migration.sql +2 -0
  111. package/prisma/migrations/20240506195539_projecttypes/migration.sql +29 -0
  112. package/prisma/migrations/20240508074229_workorder_task/migration.sql +2 -0
  113. package/prisma/migrations/20240515065236_coms/migration.sql +21 -0
  114. package/prisma/migrations/20240516093046_subsidiary_prefix/migration.sql +2 -0
  115. package/prisma/migrations/20240516170701_/migration.sql +9 -0
  116. package/prisma/migrations/20240520093356_emailconfig/migration.sql +13 -0
  117. package/prisma/migrations/20240530093136_emailtemplates/migration.sql +24 -0
  118. package/prisma/migrations/20240530110729_emailtemplates/migration.sql +4 -0
  119. package/prisma/migrations/20240530113416_emailtemplates/migration.sql +9 -0
  120. package/prisma/migrations/20240605072947_audit/migration.sql +2 -0
  121. package/prisma/migrations/20240605130105_notification_tokens/migration.sql +2 -0
  122. package/prisma/migrations/20240606074325_notifications/migration.sql +21 -0
  123. package/prisma/migrations/20240606074819_notif2/migration.sql +8 -0
  124. package/prisma/migrations/20240606172109_excel_config/migration.sql +2 -0
  125. package/prisma/migrations/20240607094457_reportformats/migration.sql +27 -0
  126. package/prisma/migrations/20240611101040_audit_matrices/migration.sql +2 -0
  127. package/prisma/migrations/20240611102951_workorder_audit_matrix/migration.sql +2 -0
  128. package/prisma/migrations/20240613063600_dispatch_roles/migration.sql +18 -0
  129. package/prisma/migrations/20240613071005_permissions_view_schedule/migration.sql +2 -0
  130. package/prisma/migrations/20240703093757_email_templates_templateinfo/migration.sql +2 -0
  131. package/prisma/migrations/20240715124159_mainproject_roles/migration.sql +5 -0
  132. package/prisma/migrations/20240722073020_admin_permissions_update/migration.sql +4 -0
  133. package/prisma/migrations/20240722082135_edit_projects/migration.sql +2 -0
  134. package/prisma/migrations/20240726090437_user_refresh_token/migration.sql +11 -0
  135. package/prisma/migrations/20240729135109_project_workflow_edit/migration.sql +2 -0
  136. package/prisma/migrations/20240729140705_template_component_project_index/migration.sql +2 -0
  137. package/prisma/migrations/20240731061332_report_format_bom_info/migration.sql +2 -0
  138. package/prisma/migrations/20240805073630_user_platform_relationship/migration.sql +17 -0
  139. package/prisma/migrations/20240809075746_workorder_sla/migration.sql +2 -0
  140. package/prisma/migrations/20240814094717_platform_to_project/migration.sql +17 -0
  141. package/prisma/migrations/20240814102025_platforms_to_project/migration.sql +8 -0
  142. package/prisma/migrations/20240819093908_network_elements/migration.sql +239 -0
  143. package/prisma/migrations/20240820092024_network_element_attributes/migration.sql +276 -0
  144. package/prisma/migrations/20240826083231_fat_template/migration.sql +45 -0
  145. package/prisma/migrations/20240826085204_pbo_pbo_template_to_project/migration.sql +23 -0
  146. package/prisma/migrations/20240826091924_attributes_to_fat_optional/migration.sql +15 -0
  147. package/prisma/migrations/20240902094457_email_signature/migration.sql +2 -0
  148. package/prisma/migrations/20240904092123_pbo_fat_zone_geometry/migration.sql +16 -0
  149. package/prisma/migrations/20240905125754_fat_name_attributes/migration.sql +3 -0
  150. package/prisma/migrations/20240905131742_fat_attribute_visible_on_mobile/migration.sql +2 -0
  151. package/prisma/migrations/20240911083041_country_list_user/migration.sql +17 -0
  152. package/prisma/migrations/20240911135957_actiondate_workorder_activity_log/migration.sql +2 -0
  153. package/prisma/migrations/20240911140227_workorder_activity_log_action_date_string_to_datetime/migration.sql +9 -0
  154. package/prisma/migrations/20240916130344_cable_template/migration.sql +72 -0
  155. package/prisma/migrations/20240916132002_cable_terminal_access/migration.sql +5 -0
  156. package/prisma/migrations/20240917113037_cable_id_on_cable_attributes_optional/migration.sql +8 -0
  157. package/prisma/migrations/20240917114004_visible_on_mobile_cable_attributes/migration.sql +2 -0
  158. package/prisma/migrations/20240917114107_visible_on_mobile_cable_attributes/migration.sql +9 -0
  159. package/prisma/migrations/20240919080014_create_cluster_and_central_office_tables/migration.sql +54 -0
  160. package/prisma/migrations/20240920092832_create_qr_code/migration.sql +39 -0
  161. package/prisma/migrations/20240924121308_qrcode_tag/migration.sql +23 -0
  162. package/prisma/migrations/20241003093709_integration_login_permissions/migration.sql +3 -0
  163. package/prisma/migrations/20241024090904_project_phase/migration.sql +2 -0
  164. package/prisma/migrations/20241024115650_project_phase_log/migration.sql +24 -0
  165. package/prisma/migrations/20241026095632_pbo_fat_attributes/migration.sql +2 -0
  166. package/prisma/migrations/20241028095307_qr_code_template_i_ds/migration.sql +9 -0
  167. package/prisma/migrations/20241029081315_add_more_network_elements/migration.sql +273 -0
  168. package/prisma/migrations/20241029084826_cable_coordinates/migration.sql +5 -0
  169. package/prisma/migrations/20241029092244_splice_closure_to_project/migration.sql +5 -0
  170. package/prisma/migrations/20241029092705_splice_closure_to_cluster/migration.sql +5 -0
  171. package/prisma/migrations/20241029094049_network_element_templates/migration.sql +295 -0
  172. package/prisma/migrations/20241029102645_network_elements_name/migration.sql +50 -0
  173. package/prisma/migrations/20241102074544_mail_carboncopy_list/migration.sql +2 -0
  174. package/prisma/migrations/20241104114549_change_qr_code_to_qr_code_template/migration.sql +122 -0
  175. package/prisma/migrations/20241104121110_qr_code_template_to_network_element_template/migration.sql +33 -0
  176. package/prisma/migrations/20241106101316_zone_coordinates/migration.sql +5 -0
  177. package/prisma/migrations/20241201141127_auto_name_elements/migration.sql +39 -0
  178. package/prisma/migrations/20241201144124_auto_name_element/migration.sql +39 -0
  179. package/prisma/migrations/20241201150401_template_index/migration.sql +29 -0
  180. package/prisma/migrations/20241205084445_template_id/migration.sql +59 -0
  181. package/prisma/migrations/20241205093552_integration_project_user_status/migration.sql +23 -0
  182. package/prisma/migrations/20241211093653_installation_sequence/migration.sql +90 -0
  183. package/prisma/migrations/20241211150807_installation_index/migration.sql +2 -0
  184. package/prisma/migrations/20241217082800_cluster_boundary/migration.sql +3 -0
  185. package/prisma/migrations/20250114092907_workorder_to_pbo_fat/migration.sql +5 -0
  186. package/prisma/migrations/20250114112746_workorder_to_sfu_and_building/migration.sql +9 -0
  187. package/prisma/migrations/20250211070850_networkelement_sequence/migration.sql +19 -0
  188. package/prisma/migrations/20250211072332_refresh_db/migration.sql +95 -0
  189. package/prisma/migrations/20250211080946_installation_sequence_self_relation/migration.sql +6 -0
  190. package/prisma/migrations/20250220100853_cluster_to_user_status/migration.sql +32 -0
  191. package/prisma/migrations/20250228100106_qr_code_template_to_cluster/migration.sql +5 -0
  192. package/prisma/migrations/20250304155122_clusters_to_users_centraloffices_to_users/migration.sql +50 -0
  193. package/prisma/migrations/20250306100801_templates_to_projects/migration.sql +244 -0
  194. package/prisma/migrations/20250306101814_cluster_naming_convention/migration.sql +2 -0
  195. package/prisma/migrations/migration_lock.toml +1 -1
  196. package/prisma/migrations_old/20231209164007_/migration.sql +8 -0
  197. package/prisma/migrations_old/20231209192452_country_table/migration.sql +7 -0
  198. package/prisma/migrations_old/20231209194848_/migration.sql +10 -0
  199. package/prisma/migrations_old/20231209195140_/migration.sql +8 -0
  200. package/prisma/migrations_old/20231209201218_country_update/migration.sql +29 -0
  201. package/prisma/migrations_old/20231209201405_/migration.sql +8 -0
  202. package/prisma/migrations_old/20231209213149_camusat_country/migration.sql +20 -0
  203. package/prisma/migrations_old/20231209221814_platform/migration.sql +26 -0
  204. package/prisma/migrations_old/20231209223246_/migration.sql +16 -0
  205. package/prisma/migrations_old/20231209231721_roles/migration.sql +34 -0
  206. package/prisma/migrations_old/20231210113501_team_and_users/migration.sql +119 -0
  207. package/prisma/migrations_old/20231210181832_user_update/migration.sql +25 -0
  208. package/prisma/migrations_old/20231219121311_add_projects/migration.sql +60 -0
  209. package/prisma/migrations_old/20231219123045_/migration.sql +8 -0
  210. package/prisma/migrations_old/20231219123850_audit/migration.sql +20 -0
  211. package/prisma/migrations_old/20240116090035_/migration.sql +57 -0
  212. package/prisma/migrations_old/20240220085809_emails/migration.sql +82 -0
  213. package/prisma/migrations_old/20240226075734_update_email_config_and_workorder/migration.sql +33 -0
  214. package/prisma/migrations_old/20240227112839_update_email_config/migration.sql +2 -0
  215. package/prisma/migrations_old/20240227124801_work_order_update/migration.sql +6 -0
  216. package/prisma/migrations_old/migration_lock.toml +3 -0
  217. package/prisma/schema.prisma +25 -1
  218. /package/prisma/{migrations → migrations_old}/20250121073034_homogenize_migrations/migration.sql +0 -0
@@ -0,0 +1,18 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Role" ADD COLUMN "dispatch_add_materials" BOOLEAN NOT NULL DEFAULT false,
3
+ ADD COLUMN "dispatch_add_teams" BOOLEAN NOT NULL DEFAULT false,
4
+ ADD COLUMN "dispatch_add_workorders" BOOLEAN NOT NULL DEFAULT false,
5
+ ADD COLUMN "dispatch_delete_materials" BOOLEAN NOT NULL DEFAULT false,
6
+ ADD COLUMN "dispatch_delete_teams" BOOLEAN NOT NULL DEFAULT false,
7
+ ADD COLUMN "dispatch_edit_materials" BOOLEAN NOT NULL DEFAULT false,
8
+ ADD COLUMN "dispatch_edit_projects" BOOLEAN NOT NULL DEFAULT false,
9
+ ADD COLUMN "dispatch_edit_teams" BOOLEAN NOT NULL DEFAULT false,
10
+ ADD COLUMN "dispatch_edit_workorders" BOOLEAN NOT NULL DEFAULT false,
11
+ ADD COLUMN "dispatch_mobile" BOOLEAN NOT NULL DEFAULT false,
12
+ ADD COLUMN "dispatch_view_kpi" BOOLEAN NOT NULL DEFAULT false,
13
+ ADD COLUMN "dispatch_view_materials" BOOLEAN NOT NULL DEFAULT false,
14
+ ADD COLUMN "dispatch_view_projects" BOOLEAN NOT NULL DEFAULT false,
15
+ ADD COLUMN "dispatch_view_reports" BOOLEAN NOT NULL DEFAULT false,
16
+ ADD COLUMN "dispatch_view_teams" BOOLEAN NOT NULL DEFAULT false,
17
+ ADD COLUMN "dispatch_view_workorders" BOOLEAN NOT NULL DEFAULT false,
18
+ ADD COLUMN "dispatch_web_access" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Role" ADD COLUMN "dispatch_view_schedule" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "EmailTemplates" ADD COLUMN "templateInfo" JSONB;
@@ -0,0 +1,5 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Role" ADD COLUMN "add_main_projects" BOOLEAN NOT NULL DEFAULT false,
3
+ ADD COLUMN "delete_main_projects" BOOLEAN NOT NULL DEFAULT false,
4
+ ADD COLUMN "delete_projects" BOOLEAN NOT NULL DEFAULT false,
5
+ ADD COLUMN "view_main_projects" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,4 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Role" ADD COLUMN "edit_main_projects" BOOLEAN NOT NULL DEFAULT false,
3
+ ADD COLUMN "view_audit" BOOLEAN NOT NULL DEFAULT false,
4
+ ADD COLUMN "view_settings" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "Role" ADD COLUMN "edit_projects" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,11 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - A unique constraint covering the columns `[refreshToken]` on the table `User` will be added. If there are existing duplicate values, this will fail.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "User" ADD COLUMN "refreshToken" TEXT;
9
+
10
+ -- CreateIndex
11
+ CREATE UNIQUE INDEX "User_refreshToken_key" ON "User"("refreshToken");
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "ProjectWorkFlow" ADD COLUMN "index" INTEGER;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "TemplateComponent" ADD COLUMN "index" INTEGER;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "ReportFormats" ADD COLUMN "materialInfo" JSONB;
@@ -0,0 +1,17 @@
1
+ -- CreateTable
2
+ CREATE TABLE "_PlatformToUser" (
3
+ "A" TEXT NOT NULL,
4
+ "B" TEXT NOT NULL
5
+ );
6
+
7
+ -- CreateIndex
8
+ CREATE UNIQUE INDEX "_PlatformToUser_AB_unique" ON "_PlatformToUser"("A", "B");
9
+
10
+ -- CreateIndex
11
+ CREATE INDEX "_PlatformToUser_B_index" ON "_PlatformToUser"("B");
12
+
13
+ -- AddForeignKey
14
+ ALTER TABLE "_PlatformToUser" ADD CONSTRAINT "_PlatformToUser_A_fkey" FOREIGN KEY ("A") REFERENCES "Platform"("id") ON DELETE CASCADE ON UPDATE CASCADE;
15
+
16
+ -- AddForeignKey
17
+ ALTER TABLE "_PlatformToUser" ADD CONSTRAINT "_PlatformToUser_B_fkey" FOREIGN KEY ("B") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "WorkOrder" ADD COLUMN "sla" TEXT;
@@ -0,0 +1,17 @@
1
+ -- CreateTable
2
+ CREATE TABLE "_PlatformToProject" (
3
+ "A" TEXT NOT NULL,
4
+ "B" TEXT NOT NULL
5
+ );
6
+
7
+ -- CreateIndex
8
+ CREATE UNIQUE INDEX "_PlatformToProject_AB_unique" ON "_PlatformToProject"("A", "B");
9
+
10
+ -- CreateIndex
11
+ CREATE INDEX "_PlatformToProject_B_index" ON "_PlatformToProject"("B");
12
+
13
+ -- AddForeignKey
14
+ ALTER TABLE "_PlatformToProject" ADD CONSTRAINT "_PlatformToProject_A_fkey" FOREIGN KEY ("A") REFERENCES "Platform"("id") ON DELETE CASCADE ON UPDATE CASCADE;
15
+
16
+ -- AddForeignKey
17
+ ALTER TABLE "_PlatformToProject" ADD CONSTRAINT "_PlatformToProject_B_fkey" FOREIGN KEY ("B") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,8 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `platforms` on the `Project` table. All the data in the column will be lost.
5
+
6
+ */
7
+ -- AlterTable
8
+ ALTER TABLE "Project" DROP COLUMN "platforms";
@@ -0,0 +1,239 @@
1
+ -- CreateTable
2
+ CREATE TABLE "NetworkElement" (
3
+ "id" TEXT NOT NULL,
4
+ "no" SERIAL NOT NULL,
5
+ "type" TEXT NOT NULL,
6
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
7
+ "updatedAt" TIMESTAMP(3) NOT NULL,
8
+ "deletedAt" TIMESTAMP(3),
9
+
10
+ CONSTRAINT "NetworkElement_pkey" PRIMARY KEY ("id")
11
+ );
12
+
13
+ -- CreateTable
14
+ CREATE TABLE "Cable" (
15
+ "id" TEXT NOT NULL,
16
+ "no" SERIAL NOT NULL,
17
+ "name" TEXT NOT NULL,
18
+ "type" TEXT NOT NULL,
19
+ "capacity" INTEGER NOT NULL,
20
+ "fibersActive" INTEGER NOT NULL,
21
+ "fibersReserved" INTEGER NOT NULL,
22
+ "fibersDark" INTEGER NOT NULL,
23
+ "fibersDedicated" INTEGER NOT NULL,
24
+ "length" INTEGER NOT NULL,
25
+ "brand" TEXT,
26
+ "description" TEXT,
27
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
28
+ "updatedAt" TIMESTAMP(3) NOT NULL,
29
+ "updatedById" TEXT,
30
+ "deletedAt" TIMESTAMP(3),
31
+ "networkElementId" TEXT NOT NULL,
32
+ "materialId" TEXT,
33
+ "projectId" TEXT NOT NULL,
34
+
35
+ CONSTRAINT "Cable_pkey" PRIMARY KEY ("id")
36
+ );
37
+
38
+ -- CreateTable
39
+ CREATE TABLE "Splitter" (
40
+ "id" TEXT NOT NULL,
41
+ "no" SERIAL NOT NULL,
42
+ "noOfPorts" INTEGER NOT NULL,
43
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
44
+ "updatedAt" TIMESTAMP(3) NOT NULL,
45
+ "deletedAt" TIMESTAMP(3),
46
+
47
+ CONSTRAINT "Splitter_pkey" PRIMARY KEY ("id")
48
+ );
49
+
50
+ -- CreateTable
51
+ CREATE TABLE "PboFat" (
52
+ "id" TEXT NOT NULL,
53
+ "no" SERIAL NOT NULL,
54
+ "name" TEXT NOT NULL,
55
+ "maxCapacity" INTEGER NOT NULL,
56
+ "currentCapacity" INTEGER NOT NULL,
57
+ "availableCapacity" INTEGER NOT NULL,
58
+ "address" TEXT,
59
+ "coordinates" TEXT,
60
+ "qrCode" TEXT,
61
+ "photo" TEXT,
62
+ "status" TEXT NOT NULL DEFAULT 'active',
63
+ "brand" TEXT,
64
+ "description" TEXT,
65
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
66
+ "updatedAt" TIMESTAMP(3) NOT NULL,
67
+ "deletedAt" TIMESTAMP(3),
68
+ "updatedById" TEXT,
69
+ "inputCableId" TEXT,
70
+ "outputCable1Id" TEXT,
71
+ "outputCable2Id" TEXT,
72
+ "outputCable3Id" TEXT,
73
+ "networkElementId" TEXT NOT NULL,
74
+ "projectId" TEXT NOT NULL,
75
+ "materialId" TEXT,
76
+
77
+ CONSTRAINT "PboFat_pkey" PRIMARY KEY ("id")
78
+ );
79
+
80
+ -- CreateTable
81
+ CREATE TABLE "SpliceClosure" (
82
+ "id" TEXT NOT NULL,
83
+ "no" SERIAL NOT NULL,
84
+ "name" TEXT NOT NULL,
85
+ "maxCapacity" INTEGER NOT NULL,
86
+ "coordinates" TEXT,
87
+ "qrCode" TEXT,
88
+ "photo" TEXT,
89
+ "status" TEXT NOT NULL DEFAULT 'active',
90
+ "brand" TEXT,
91
+ "description" TEXT,
92
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
93
+ "updatedAt" TIMESTAMP(3) NOT NULL,
94
+ "updatedById" TEXT,
95
+ "deletedAt" TIMESTAMP(3),
96
+ "networkElementId" TEXT NOT NULL,
97
+ "materialId" TEXT,
98
+ "projectId" TEXT NOT NULL,
99
+ "inputCableId" TEXT,
100
+ "outputCable1Id" TEXT,
101
+ "outputCable2Id" TEXT,
102
+ "outputCable3Id" TEXT,
103
+ "outputCable4Id" TEXT,
104
+ "outputCable5Id" TEXT,
105
+ "outputCable6Id" TEXT,
106
+ "outputCable7Id" TEXT,
107
+ "outputCable8Id" TEXT,
108
+
109
+ CONSTRAINT "SpliceClosure_pkey" PRIMARY KEY ("id")
110
+ );
111
+
112
+ -- CreateTable
113
+ CREATE TABLE "_PboFatToSplitter" (
114
+ "A" TEXT NOT NULL,
115
+ "B" TEXT NOT NULL
116
+ );
117
+
118
+ -- CreateTable
119
+ CREATE TABLE "_PboFatToWorkOrder" (
120
+ "A" TEXT NOT NULL,
121
+ "B" TEXT NOT NULL
122
+ );
123
+
124
+ -- CreateIndex
125
+ CREATE UNIQUE INDEX "NetworkElement_id_key" ON "NetworkElement"("id");
126
+
127
+ -- CreateIndex
128
+ CREATE UNIQUE INDEX "NetworkElement_type_key" ON "NetworkElement"("type");
129
+
130
+ -- CreateIndex
131
+ CREATE UNIQUE INDEX "Cable_id_key" ON "Cable"("id");
132
+
133
+ -- CreateIndex
134
+ CREATE UNIQUE INDEX "Splitter_id_key" ON "Splitter"("id");
135
+
136
+ -- CreateIndex
137
+ CREATE UNIQUE INDEX "PboFat_id_key" ON "PboFat"("id");
138
+
139
+ -- CreateIndex
140
+ CREATE UNIQUE INDEX "SpliceClosure_id_key" ON "SpliceClosure"("id");
141
+
142
+ -- CreateIndex
143
+ CREATE UNIQUE INDEX "_PboFatToSplitter_AB_unique" ON "_PboFatToSplitter"("A", "B");
144
+
145
+ -- CreateIndex
146
+ CREATE INDEX "_PboFatToSplitter_B_index" ON "_PboFatToSplitter"("B");
147
+
148
+ -- CreateIndex
149
+ CREATE UNIQUE INDEX "_PboFatToWorkOrder_AB_unique" ON "_PboFatToWorkOrder"("A", "B");
150
+
151
+ -- CreateIndex
152
+ CREATE INDEX "_PboFatToWorkOrder_B_index" ON "_PboFatToWorkOrder"("B");
153
+
154
+ -- AddForeignKey
155
+ ALTER TABLE "Cable" ADD CONSTRAINT "Cable_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
156
+
157
+ -- AddForeignKey
158
+ ALTER TABLE "Cable" ADD CONSTRAINT "Cable_networkElementId_fkey" FOREIGN KEY ("networkElementId") REFERENCES "NetworkElement"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
159
+
160
+ -- AddForeignKey
161
+ ALTER TABLE "Cable" ADD CONSTRAINT "Cable_materialId_fkey" FOREIGN KEY ("materialId") REFERENCES "Material"("id") ON DELETE SET NULL ON UPDATE CASCADE;
162
+
163
+ -- AddForeignKey
164
+ ALTER TABLE "Cable" ADD CONSTRAINT "Cable_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
165
+
166
+ -- AddForeignKey
167
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
168
+
169
+ -- AddForeignKey
170
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_inputCableId_fkey" FOREIGN KEY ("inputCableId") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
171
+
172
+ -- AddForeignKey
173
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_outputCable1Id_fkey" FOREIGN KEY ("outputCable1Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
174
+
175
+ -- AddForeignKey
176
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_outputCable2Id_fkey" FOREIGN KEY ("outputCable2Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
177
+
178
+ -- AddForeignKey
179
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_outputCable3Id_fkey" FOREIGN KEY ("outputCable3Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
180
+
181
+ -- AddForeignKey
182
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_networkElementId_fkey" FOREIGN KEY ("networkElementId") REFERENCES "NetworkElement"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
183
+
184
+ -- AddForeignKey
185
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
186
+
187
+ -- AddForeignKey
188
+ ALTER TABLE "PboFat" ADD CONSTRAINT "PboFat_materialId_fkey" FOREIGN KEY ("materialId") REFERENCES "Material"("id") ON DELETE SET NULL ON UPDATE CASCADE;
189
+
190
+ -- AddForeignKey
191
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
192
+
193
+ -- AddForeignKey
194
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_networkElementId_fkey" FOREIGN KEY ("networkElementId") REFERENCES "NetworkElement"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
195
+
196
+ -- AddForeignKey
197
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_materialId_fkey" FOREIGN KEY ("materialId") REFERENCES "Material"("id") ON DELETE SET NULL ON UPDATE CASCADE;
198
+
199
+ -- AddForeignKey
200
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
201
+
202
+ -- AddForeignKey
203
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_inputCableId_fkey" FOREIGN KEY ("inputCableId") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
204
+
205
+ -- AddForeignKey
206
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable1Id_fkey" FOREIGN KEY ("outputCable1Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
207
+
208
+ -- AddForeignKey
209
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable2Id_fkey" FOREIGN KEY ("outputCable2Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
210
+
211
+ -- AddForeignKey
212
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable3Id_fkey" FOREIGN KEY ("outputCable3Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
213
+
214
+ -- AddForeignKey
215
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable4Id_fkey" FOREIGN KEY ("outputCable4Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
216
+
217
+ -- AddForeignKey
218
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable5Id_fkey" FOREIGN KEY ("outputCable5Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
219
+
220
+ -- AddForeignKey
221
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable6Id_fkey" FOREIGN KEY ("outputCable6Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
222
+
223
+ -- AddForeignKey
224
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable7Id_fkey" FOREIGN KEY ("outputCable7Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
225
+
226
+ -- AddForeignKey
227
+ ALTER TABLE "SpliceClosure" ADD CONSTRAINT "SpliceClosure_outputCable8Id_fkey" FOREIGN KEY ("outputCable8Id") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
228
+
229
+ -- AddForeignKey
230
+ ALTER TABLE "_PboFatToSplitter" ADD CONSTRAINT "_PboFatToSplitter_A_fkey" FOREIGN KEY ("A") REFERENCES "PboFat"("id") ON DELETE CASCADE ON UPDATE CASCADE;
231
+
232
+ -- AddForeignKey
233
+ ALTER TABLE "_PboFatToSplitter" ADD CONSTRAINT "_PboFatToSplitter_B_fkey" FOREIGN KEY ("B") REFERENCES "Splitter"("id") ON DELETE CASCADE ON UPDATE CASCADE;
234
+
235
+ -- AddForeignKey
236
+ ALTER TABLE "_PboFatToWorkOrder" ADD CONSTRAINT "_PboFatToWorkOrder_A_fkey" FOREIGN KEY ("A") REFERENCES "PboFat"("id") ON DELETE CASCADE ON UPDATE CASCADE;
237
+
238
+ -- AddForeignKey
239
+ ALTER TABLE "_PboFatToWorkOrder" ADD CONSTRAINT "_PboFatToWorkOrder_B_fkey" FOREIGN KEY ("B") REFERENCES "WorkOrder"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,276 @@
1
+ /*
2
+ Warnings:
3
+
4
+ - You are about to drop the column `materialId` on the `Cable` table. All the data in the column will be lost.
5
+ - You are about to drop the column `projectId` on the `Cable` table. All the data in the column will be lost.
6
+ - You are about to drop the column `address` on the `PboFat` table. All the data in the column will be lost.
7
+ - You are about to drop the column `availableCapacity` on the `PboFat` table. All the data in the column will be lost.
8
+ - You are about to drop the column `brand` on the `PboFat` table. All the data in the column will be lost.
9
+ - You are about to drop the column `coordinates` on the `PboFat` table. All the data in the column will be lost.
10
+ - You are about to drop the column `currentCapacity` on the `PboFat` table. All the data in the column will be lost.
11
+ - You are about to drop the column `description` on the `PboFat` table. All the data in the column will be lost.
12
+ - You are about to drop the column `inputCableId` on the `PboFat` table. All the data in the column will be lost.
13
+ - You are about to drop the column `materialId` on the `PboFat` table. All the data in the column will be lost.
14
+ - You are about to drop the column `maxCapacity` on the `PboFat` table. All the data in the column will be lost.
15
+ - You are about to drop the column `name` on the `PboFat` table. All the data in the column will be lost.
16
+ - You are about to drop the column `outputCable1Id` on the `PboFat` table. All the data in the column will be lost.
17
+ - You are about to drop the column `outputCable2Id` on the `PboFat` table. All the data in the column will be lost.
18
+ - You are about to drop the column `outputCable3Id` on the `PboFat` table. All the data in the column will be lost.
19
+ - You are about to drop the column `photo` on the `PboFat` table. All the data in the column will be lost.
20
+ - You are about to drop the column `projectId` on the `PboFat` table. All the data in the column will be lost.
21
+ - You are about to drop the column `qrCode` on the `PboFat` table. All the data in the column will be lost.
22
+ - You are about to drop the column `inputCableId` on the `SpliceClosure` table. All the data in the column will be lost.
23
+ - You are about to drop the column `materialId` on the `SpliceClosure` table. All the data in the column will be lost.
24
+ - You are about to drop the column `outputCable1Id` on the `SpliceClosure` table. All the data in the column will be lost.
25
+ - You are about to drop the column `outputCable2Id` on the `SpliceClosure` table. All the data in the column will be lost.
26
+ - You are about to drop the column `outputCable3Id` on the `SpliceClosure` table. All the data in the column will be lost.
27
+ - You are about to drop the column `outputCable4Id` on the `SpliceClosure` table. All the data in the column will be lost.
28
+ - You are about to drop the column `outputCable5Id` on the `SpliceClosure` table. All the data in the column will be lost.
29
+ - You are about to drop the column `outputCable6Id` on the `SpliceClosure` table. All the data in the column will be lost.
30
+ - You are about to drop the column `outputCable7Id` on the `SpliceClosure` table. All the data in the column will be lost.
31
+ - You are about to drop the column `outputCable8Id` on the `SpliceClosure` table. All the data in the column will be lost.
32
+ - You are about to drop the column `projectId` on the `SpliceClosure` table. All the data in the column will be lost.
33
+ - You are about to drop the `_PboFatToSplitter` table. If the table is not empty, all the data it contains will be lost.
34
+ - You are about to drop the `_PboFatToWorkOrder` table. If the table is not empty, all the data it contains will be lost.
35
+
36
+ */
37
+ -- DropForeignKey
38
+ ALTER TABLE "Cable" DROP CONSTRAINT "Cable_materialId_fkey";
39
+
40
+ -- DropForeignKey
41
+ ALTER TABLE "Cable" DROP CONSTRAINT "Cable_projectId_fkey";
42
+
43
+ -- DropForeignKey
44
+ ALTER TABLE "PboFat" DROP CONSTRAINT "PboFat_inputCableId_fkey";
45
+
46
+ -- DropForeignKey
47
+ ALTER TABLE "PboFat" DROP CONSTRAINT "PboFat_materialId_fkey";
48
+
49
+ -- DropForeignKey
50
+ ALTER TABLE "PboFat" DROP CONSTRAINT "PboFat_outputCable1Id_fkey";
51
+
52
+ -- DropForeignKey
53
+ ALTER TABLE "PboFat" DROP CONSTRAINT "PboFat_outputCable2Id_fkey";
54
+
55
+ -- DropForeignKey
56
+ ALTER TABLE "PboFat" DROP CONSTRAINT "PboFat_outputCable3Id_fkey";
57
+
58
+ -- DropForeignKey
59
+ ALTER TABLE "PboFat" DROP CONSTRAINT "PboFat_projectId_fkey";
60
+
61
+ -- DropForeignKey
62
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_inputCableId_fkey";
63
+
64
+ -- DropForeignKey
65
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_materialId_fkey";
66
+
67
+ -- DropForeignKey
68
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable1Id_fkey";
69
+
70
+ -- DropForeignKey
71
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable2Id_fkey";
72
+
73
+ -- DropForeignKey
74
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable3Id_fkey";
75
+
76
+ -- DropForeignKey
77
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable4Id_fkey";
78
+
79
+ -- DropForeignKey
80
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable5Id_fkey";
81
+
82
+ -- DropForeignKey
83
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable6Id_fkey";
84
+
85
+ -- DropForeignKey
86
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable7Id_fkey";
87
+
88
+ -- DropForeignKey
89
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_outputCable8Id_fkey";
90
+
91
+ -- DropForeignKey
92
+ ALTER TABLE "SpliceClosure" DROP CONSTRAINT "SpliceClosure_projectId_fkey";
93
+
94
+ -- DropForeignKey
95
+ ALTER TABLE "_PboFatToSplitter" DROP CONSTRAINT "_PboFatToSplitter_A_fkey";
96
+
97
+ -- DropForeignKey
98
+ ALTER TABLE "_PboFatToSplitter" DROP CONSTRAINT "_PboFatToSplitter_B_fkey";
99
+
100
+ -- DropForeignKey
101
+ ALTER TABLE "_PboFatToWorkOrder" DROP CONSTRAINT "_PboFatToWorkOrder_A_fkey";
102
+
103
+ -- DropForeignKey
104
+ ALTER TABLE "_PboFatToWorkOrder" DROP CONSTRAINT "_PboFatToWorkOrder_B_fkey";
105
+
106
+ -- AlterTable
107
+ ALTER TABLE "Cable" DROP COLUMN "materialId",
108
+ DROP COLUMN "projectId";
109
+
110
+ -- AlterTable
111
+ ALTER TABLE "PboFat" DROP COLUMN "address",
112
+ DROP COLUMN "availableCapacity",
113
+ DROP COLUMN "brand",
114
+ DROP COLUMN "coordinates",
115
+ DROP COLUMN "currentCapacity",
116
+ DROP COLUMN "description",
117
+ DROP COLUMN "inputCableId",
118
+ DROP COLUMN "materialId",
119
+ DROP COLUMN "maxCapacity",
120
+ DROP COLUMN "name",
121
+ DROP COLUMN "outputCable1Id",
122
+ DROP COLUMN "outputCable2Id",
123
+ DROP COLUMN "outputCable3Id",
124
+ DROP COLUMN "photo",
125
+ DROP COLUMN "projectId",
126
+ DROP COLUMN "qrCode";
127
+
128
+ -- AlterTable
129
+ ALTER TABLE "SpliceClosure" DROP COLUMN "inputCableId",
130
+ DROP COLUMN "materialId",
131
+ DROP COLUMN "outputCable1Id",
132
+ DROP COLUMN "outputCable2Id",
133
+ DROP COLUMN "outputCable3Id",
134
+ DROP COLUMN "outputCable4Id",
135
+ DROP COLUMN "outputCable5Id",
136
+ DROP COLUMN "outputCable6Id",
137
+ DROP COLUMN "outputCable7Id",
138
+ DROP COLUMN "outputCable8Id",
139
+ DROP COLUMN "projectId";
140
+
141
+ -- DropTable
142
+ DROP TABLE "_PboFatToSplitter";
143
+
144
+ -- DropTable
145
+ DROP TABLE "_PboFatToWorkOrder";
146
+
147
+ -- CreateTable
148
+ CREATE TABLE "CableAtttributes" (
149
+ "id" TEXT NOT NULL,
150
+ "no" SERIAL NOT NULL,
151
+ "name" TEXT NOT NULL,
152
+ "description" TEXT,
153
+ "value" TEXT,
154
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
155
+ "updatedAt" TIMESTAMP(3) NOT NULL,
156
+ "deletedAt" TIMESTAMP(3),
157
+ "cableId" TEXT NOT NULL,
158
+ "projectId" TEXT,
159
+ "materialId" TEXT,
160
+
161
+ CONSTRAINT "CableAtttributes_pkey" PRIMARY KEY ("id")
162
+ );
163
+
164
+ -- CreateTable
165
+ CREATE TABLE "PboFatAttributes" (
166
+ "id" TEXT NOT NULL,
167
+ "no" SERIAL NOT NULL,
168
+ "name" TEXT NOT NULL,
169
+ "description" TEXT,
170
+ "value" TEXT,
171
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
172
+ "updatedAt" TIMESTAMP(3) NOT NULL,
173
+ "deletedAt" TIMESTAMP(3),
174
+ "cableId" TEXT,
175
+ "projectId" TEXT,
176
+ "materialId" TEXT,
177
+ "pboFatId" TEXT NOT NULL,
178
+
179
+ CONSTRAINT "PboFatAttributes_pkey" PRIMARY KEY ("id")
180
+ );
181
+
182
+ -- CreateTable
183
+ CREATE TABLE "SpliceClosureAttributes" (
184
+ "id" TEXT NOT NULL,
185
+ "no" SERIAL NOT NULL,
186
+ "name" TEXT NOT NULL,
187
+ "description" TEXT,
188
+ "value" TEXT,
189
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
190
+ "updatedAt" TIMESTAMP(3) NOT NULL,
191
+ "deletedAt" TIMESTAMP(3),
192
+ "cableId" TEXT,
193
+ "projectId" TEXT,
194
+ "materialId" TEXT,
195
+ "spliceClosureId" TEXT NOT NULL,
196
+
197
+ CONSTRAINT "SpliceClosureAttributes_pkey" PRIMARY KEY ("id")
198
+ );
199
+
200
+ -- CreateTable
201
+ CREATE TABLE "_PboFatAttributesToSplitter" (
202
+ "A" TEXT NOT NULL,
203
+ "B" TEXT NOT NULL
204
+ );
205
+
206
+ -- CreateTable
207
+ CREATE TABLE "_PboFatAttributesToWorkOrder" (
208
+ "A" TEXT NOT NULL,
209
+ "B" TEXT NOT NULL
210
+ );
211
+
212
+ -- CreateIndex
213
+ CREATE UNIQUE INDEX "CableAtttributes_id_key" ON "CableAtttributes"("id");
214
+
215
+ -- CreateIndex
216
+ CREATE UNIQUE INDEX "PboFatAttributes_id_key" ON "PboFatAttributes"("id");
217
+
218
+ -- CreateIndex
219
+ CREATE UNIQUE INDEX "SpliceClosureAttributes_id_key" ON "SpliceClosureAttributes"("id");
220
+
221
+ -- CreateIndex
222
+ CREATE UNIQUE INDEX "_PboFatAttributesToSplitter_AB_unique" ON "_PboFatAttributesToSplitter"("A", "B");
223
+
224
+ -- CreateIndex
225
+ CREATE INDEX "_PboFatAttributesToSplitter_B_index" ON "_PboFatAttributesToSplitter"("B");
226
+
227
+ -- CreateIndex
228
+ CREATE UNIQUE INDEX "_PboFatAttributesToWorkOrder_AB_unique" ON "_PboFatAttributesToWorkOrder"("A", "B");
229
+
230
+ -- CreateIndex
231
+ CREATE INDEX "_PboFatAttributesToWorkOrder_B_index" ON "_PboFatAttributesToWorkOrder"("B");
232
+
233
+ -- AddForeignKey
234
+ ALTER TABLE "CableAtttributes" ADD CONSTRAINT "CableAtttributes_cableId_fkey" FOREIGN KEY ("cableId") REFERENCES "Cable"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
235
+
236
+ -- AddForeignKey
237
+ ALTER TABLE "CableAtttributes" ADD CONSTRAINT "CableAtttributes_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE SET NULL ON UPDATE CASCADE;
238
+
239
+ -- AddForeignKey
240
+ ALTER TABLE "CableAtttributes" ADD CONSTRAINT "CableAtttributes_materialId_fkey" FOREIGN KEY ("materialId") REFERENCES "Material"("id") ON DELETE SET NULL ON UPDATE CASCADE;
241
+
242
+ -- AddForeignKey
243
+ ALTER TABLE "PboFatAttributes" ADD CONSTRAINT "PboFatAttributes_cableId_fkey" FOREIGN KEY ("cableId") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
244
+
245
+ -- AddForeignKey
246
+ ALTER TABLE "PboFatAttributes" ADD CONSTRAINT "PboFatAttributes_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE SET NULL ON UPDATE CASCADE;
247
+
248
+ -- AddForeignKey
249
+ ALTER TABLE "PboFatAttributes" ADD CONSTRAINT "PboFatAttributes_materialId_fkey" FOREIGN KEY ("materialId") REFERENCES "Material"("id") ON DELETE SET NULL ON UPDATE CASCADE;
250
+
251
+ -- AddForeignKey
252
+ ALTER TABLE "PboFatAttributes" ADD CONSTRAINT "PboFatAttributes_pboFatId_fkey" FOREIGN KEY ("pboFatId") REFERENCES "PboFat"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
253
+
254
+ -- AddForeignKey
255
+ ALTER TABLE "SpliceClosureAttributes" ADD CONSTRAINT "SpliceClosureAttributes_cableId_fkey" FOREIGN KEY ("cableId") REFERENCES "Cable"("id") ON DELETE SET NULL ON UPDATE CASCADE;
256
+
257
+ -- AddForeignKey
258
+ ALTER TABLE "SpliceClosureAttributes" ADD CONSTRAINT "SpliceClosureAttributes_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE SET NULL ON UPDATE CASCADE;
259
+
260
+ -- AddForeignKey
261
+ ALTER TABLE "SpliceClosureAttributes" ADD CONSTRAINT "SpliceClosureAttributes_materialId_fkey" FOREIGN KEY ("materialId") REFERENCES "Material"("id") ON DELETE SET NULL ON UPDATE CASCADE;
262
+
263
+ -- AddForeignKey
264
+ ALTER TABLE "SpliceClosureAttributes" ADD CONSTRAINT "SpliceClosureAttributes_spliceClosureId_fkey" FOREIGN KEY ("spliceClosureId") REFERENCES "SpliceClosure"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
265
+
266
+ -- AddForeignKey
267
+ ALTER TABLE "_PboFatAttributesToSplitter" ADD CONSTRAINT "_PboFatAttributesToSplitter_A_fkey" FOREIGN KEY ("A") REFERENCES "PboFatAttributes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
268
+
269
+ -- AddForeignKey
270
+ ALTER TABLE "_PboFatAttributesToSplitter" ADD CONSTRAINT "_PboFatAttributesToSplitter_B_fkey" FOREIGN KEY ("B") REFERENCES "Splitter"("id") ON DELETE CASCADE ON UPDATE CASCADE;
271
+
272
+ -- AddForeignKey
273
+ ALTER TABLE "_PboFatAttributesToWorkOrder" ADD CONSTRAINT "_PboFatAttributesToWorkOrder_A_fkey" FOREIGN KEY ("A") REFERENCES "PboFatAttributes"("id") ON DELETE CASCADE ON UPDATE CASCADE;
274
+
275
+ -- AddForeignKey
276
+ ALTER TABLE "_PboFatAttributesToWorkOrder" ADD CONSTRAINT "_PboFatAttributesToWorkOrder_B_fkey" FOREIGN KEY ("B") REFERENCES "WorkOrder"("id") ON DELETE CASCADE ON UPDATE CASCADE;