@open-mercato/core 0.4.2-canary-ed15f2e753 → 0.4.2-canary-f075c3eb92

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 (241) hide show
  1. package/dist/generated/entities.ids.generated.js +0 -1
  2. package/dist/generated/entities.ids.generated.js.map +2 -2
  3. package/dist/generated/entity-fields-registry.js +0 -2
  4. package/dist/generated/entity-fields-registry.js.map +2 -2
  5. package/dist/modules/api_keys/setup.js +11 -0
  6. package/dist/modules/api_keys/setup.js.map +7 -0
  7. package/dist/modules/attachments/components/AttachmentLibrary.js +1 -1
  8. package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
  9. package/dist/modules/attachments/lib/assignmentDetails.js +31 -17
  10. package/dist/modules/attachments/lib/assignmentDetails.js.map +2 -2
  11. package/dist/modules/attachments/lib/partitions.js +3 -3
  12. package/dist/modules/attachments/lib/partitions.js.map +2 -2
  13. package/dist/modules/attachments/setup.js +11 -0
  14. package/dist/modules/attachments/setup.js.map +7 -0
  15. package/dist/modules/audit_logs/setup.js +12 -0
  16. package/dist/modules/audit_logs/setup.js.map +7 -0
  17. package/dist/modules/auth/lib/setup-app.js +29 -159
  18. package/dist/modules/auth/lib/setup-app.js.map +2 -2
  19. package/dist/modules/auth/setup.js +11 -0
  20. package/dist/modules/auth/setup.js.map +7 -0
  21. package/dist/modules/business_rules/data/validators.js +0 -34
  22. package/dist/modules/business_rules/data/validators.js.map +2 -2
  23. package/dist/modules/business_rules/index.js +1 -21
  24. package/dist/modules/business_rules/index.js.map +2 -2
  25. package/dist/modules/business_rules/lib/rule-engine.js +1 -182
  26. package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
  27. package/dist/modules/business_rules/setup.js +11 -0
  28. package/dist/modules/business_rules/setup.js.map +7 -0
  29. package/dist/modules/catalog/setup.js +22 -0
  30. package/dist/modules/catalog/setup.js.map +7 -0
  31. package/dist/modules/configs/lib/upgrade-actions.js +65 -15
  32. package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
  33. package/dist/modules/configs/setup.js +16 -0
  34. package/dist/modules/configs/setup.js.map +7 -0
  35. package/dist/modules/currencies/setup.js +16 -0
  36. package/dist/modules/currencies/setup.js.map +7 -0
  37. package/dist/modules/customers/setup.js +36 -0
  38. package/dist/modules/customers/setup.js.map +7 -0
  39. package/dist/modules/dashboards/setup.js +12 -0
  40. package/dist/modules/dashboards/setup.js.map +7 -0
  41. package/dist/modules/dictionaries/setup.js +12 -0
  42. package/dist/modules/dictionaries/setup.js.map +7 -0
  43. package/dist/modules/directory/setup.js +12 -0
  44. package/dist/modules/directory/setup.js.map +7 -0
  45. package/dist/modules/entities/setup.js +11 -0
  46. package/dist/modules/entities/setup.js.map +7 -0
  47. package/dist/modules/feature_toggles/setup.js +11 -0
  48. package/dist/modules/feature_toggles/setup.js.map +7 -0
  49. package/dist/modules/perspectives/setup.js +12 -0
  50. package/dist/modules/perspectives/setup.js.map +7 -0
  51. package/dist/modules/planner/setup.js +21 -0
  52. package/dist/modules/planner/setup.js.map +7 -0
  53. package/dist/modules/query_index/setup.js +11 -0
  54. package/dist/modules/query_index/setup.js.map +7 -0
  55. package/dist/modules/resources/setup.js +21 -0
  56. package/dist/modules/resources/setup.js.map +7 -0
  57. package/dist/modules/sales/acl.js +0 -1
  58. package/dist/modules/sales/acl.js.map +2 -2
  59. package/dist/modules/sales/backend/sales/documents/[id]/page.js +0 -12
  60. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
  61. package/dist/modules/sales/commands/documents.js +0 -62
  62. package/dist/modules/sales/commands/documents.js.map +2 -2
  63. package/dist/modules/sales/lib/dictionaries.js +0 -3
  64. package/dist/modules/sales/lib/dictionaries.js.map +2 -2
  65. package/dist/modules/sales/setup.js +99 -0
  66. package/dist/modules/sales/setup.js.map +7 -0
  67. package/dist/modules/staff/setup.js +27 -0
  68. package/dist/modules/staff/setup.js.map +7 -0
  69. package/dist/modules/workflows/acl.js +0 -2
  70. package/dist/modules/workflows/acl.js.map +2 -2
  71. package/dist/modules/workflows/api/instances/route.js +6 -18
  72. package/dist/modules/workflows/api/instances/route.js.map +2 -2
  73. package/dist/modules/workflows/api/tasks/route.js +1 -6
  74. package/dist/modules/workflows/api/tasks/route.js.map +2 -2
  75. package/dist/modules/workflows/backend/definitions/[id]/page.js +1 -9
  76. package/dist/modules/workflows/backend/definitions/[id]/page.js.map +2 -2
  77. package/dist/modules/workflows/backend/definitions/[id]/page.meta.js +1 -1
  78. package/dist/modules/workflows/backend/definitions/[id]/page.meta.js.map +2 -2
  79. package/dist/modules/workflows/backend/definitions/create/page.js +15 -24
  80. package/dist/modules/workflows/backend/definitions/create/page.js.map +2 -2
  81. package/dist/modules/workflows/backend/definitions/create/page.meta.js +1 -1
  82. package/dist/modules/workflows/backend/definitions/create/page.meta.js.map +2 -2
  83. package/dist/modules/workflows/backend/definitions/visual-editor/page.js +132 -150
  84. package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
  85. package/dist/modules/workflows/backend/definitions/visual-editor/page.meta.js +1 -1
  86. package/dist/modules/workflows/backend/definitions/visual-editor/page.meta.js.map +2 -2
  87. package/dist/modules/workflows/backend/events/[id]/page.js +1 -1
  88. package/dist/modules/workflows/backend/events/[id]/page.js.map +2 -2
  89. package/dist/modules/workflows/backend/events/[id]/page.meta.js +2 -2
  90. package/dist/modules/workflows/backend/events/[id]/page.meta.js.map +2 -2
  91. package/dist/modules/workflows/backend/instances/[id]/page.meta.js +2 -2
  92. package/dist/modules/workflows/backend/instances/[id]/page.meta.js.map +2 -2
  93. package/dist/modules/workflows/backend/tasks/[id]/page.js +1 -1
  94. package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
  95. package/dist/modules/workflows/backend/tasks/[id]/page.meta.js +2 -2
  96. package/dist/modules/workflows/backend/tasks/[id]/page.meta.js.map +2 -2
  97. package/dist/modules/workflows/backend/tasks/page.js +6 -5
  98. package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
  99. package/dist/modules/workflows/cli.js +3 -81
  100. package/dist/modules/workflows/cli.js.map +3 -3
  101. package/dist/modules/workflows/data/entities.js +1 -64
  102. package/dist/modules/workflows/data/entities.js.map +2 -2
  103. package/dist/modules/workflows/data/validators.js +0 -115
  104. package/dist/modules/workflows/data/validators.js.map +2 -2
  105. package/dist/modules/workflows/examples/checkout-demo-definition.json +5 -1
  106. package/dist/modules/workflows/lib/activity-executor.js +13 -75
  107. package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
  108. package/dist/modules/workflows/lib/graph-utils.js +2 -71
  109. package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
  110. package/dist/modules/workflows/lib/seeds.js +7 -36
  111. package/dist/modules/workflows/lib/seeds.js.map +2 -2
  112. package/dist/modules/workflows/lib/start-validator.js +23 -33
  113. package/dist/modules/workflows/lib/start-validator.js.map +2 -2
  114. package/dist/modules/workflows/lib/transition-handler.js +45 -157
  115. package/dist/modules/workflows/lib/transition-handler.js.map +3 -3
  116. package/dist/modules/workflows/migrations/Migration20251207131955.js +76 -72
  117. package/dist/modules/workflows/migrations/Migration20251207131955.js.map +2 -2
  118. package/dist/modules/workflows/setup.js +16 -0
  119. package/dist/modules/workflows/setup.js.map +7 -0
  120. package/generated/entities.ids.generated.ts +0 -1
  121. package/generated/entity-fields-registry.ts +0 -2
  122. package/package.json +2 -2
  123. package/src/__tests__/module-decoupling.test.ts +356 -0
  124. package/src/modules/api_keys/setup.ts +9 -0
  125. package/src/modules/attachments/components/AttachmentLibrary.tsx +2 -2
  126. package/src/modules/attachments/lib/assignmentDetails.ts +32 -16
  127. package/src/modules/attachments/lib/partitions.ts +3 -3
  128. package/src/modules/attachments/setup.ts +9 -0
  129. package/src/modules/audit_logs/setup.ts +10 -0
  130. package/src/modules/auth/__tests__/cli-setup-acl.test.ts +30 -0
  131. package/src/modules/auth/lib/setup-app.ts +40 -177
  132. package/src/modules/auth/setup.ts +9 -0
  133. package/src/modules/business_rules/data/validators.ts +0 -40
  134. package/src/modules/business_rules/index.ts +0 -25
  135. package/src/modules/business_rules/lib/rule-engine.ts +1 -281
  136. package/src/modules/business_rules/setup.ts +9 -0
  137. package/src/modules/catalog/setup.ts +22 -0
  138. package/src/modules/configs/lib/upgrade-actions.ts +78 -17
  139. package/src/modules/configs/setup.ts +14 -0
  140. package/src/modules/currencies/setup.ts +15 -0
  141. package/src/modules/customers/setup.ts +36 -0
  142. package/src/modules/dashboards/setup.ts +10 -0
  143. package/src/modules/dictionaries/setup.ts +10 -0
  144. package/src/modules/directory/setup.ts +10 -0
  145. package/src/modules/entities/setup.ts +9 -0
  146. package/src/modules/feature_toggles/setup.ts +9 -0
  147. package/src/modules/perspectives/setup.ts +10 -0
  148. package/src/modules/planner/setup.ts +21 -0
  149. package/src/modules/query_index/setup.ts +9 -0
  150. package/src/modules/resources/setup.ts +21 -0
  151. package/src/modules/sales/acl.ts +0 -1
  152. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +0 -16
  153. package/src/modules/sales/commands/documents.ts +1 -74
  154. package/src/modules/sales/lib/dictionaries.ts +0 -3
  155. package/src/modules/sales/setup.ts +108 -0
  156. package/src/modules/staff/setup.ts +27 -0
  157. package/src/modules/workflows/acl.ts +0 -2
  158. package/src/modules/workflows/api/__tests__/instances.route.test.ts +2 -5
  159. package/src/modules/workflows/api/instances/route.ts +7 -21
  160. package/src/modules/workflows/api/tasks/route.ts +1 -7
  161. package/src/modules/workflows/backend/definitions/[id]/page.meta.ts +1 -1
  162. package/src/modules/workflows/backend/definitions/[id]/page.tsx +0 -9
  163. package/src/modules/workflows/backend/definitions/create/page.meta.ts +1 -1
  164. package/src/modules/workflows/backend/definitions/create/page.tsx +0 -9
  165. package/src/modules/workflows/backend/definitions/visual-editor/page.meta.ts +1 -1
  166. package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +3 -21
  167. package/src/modules/workflows/backend/events/[id]/page.meta.ts +2 -2
  168. package/src/modules/workflows/backend/events/[id]/page.tsx +1 -1
  169. package/src/modules/workflows/backend/instances/[id]/page.meta.ts +2 -2
  170. package/src/modules/workflows/backend/tasks/[id]/page.meta.ts +2 -2
  171. package/src/modules/workflows/backend/tasks/[id]/page.tsx +1 -1
  172. package/src/modules/workflows/backend/tasks/page.tsx +6 -5
  173. package/src/modules/workflows/cli.ts +0 -111
  174. package/src/modules/workflows/data/entities.ts +0 -124
  175. package/src/modules/workflows/data/validators.ts +0 -138
  176. package/src/modules/workflows/examples/checkout-demo-definition.json +5 -1
  177. package/src/modules/workflows/i18n/en.json +0 -71
  178. package/src/modules/workflows/lib/__tests__/activity-executor.test.ts +36 -43
  179. package/src/modules/workflows/lib/__tests__/transition-handler.test.ts +90 -170
  180. package/src/modules/workflows/lib/activity-executor.ts +16 -129
  181. package/src/modules/workflows/lib/graph-utils.ts +2 -117
  182. package/src/modules/workflows/lib/seeds.ts +12 -50
  183. package/src/modules/workflows/lib/start-validator.ts +28 -38
  184. package/src/modules/workflows/lib/transition-handler.ts +55 -208
  185. package/src/modules/workflows/migrations/Migration20251207131955.ts +77 -143
  186. package/src/modules/workflows/setup.ts +15 -0
  187. package/dist/generated/entities/workflow_event_trigger/index.js +0 -33
  188. package/dist/generated/entities/workflow_event_trigger/index.js.map +0 -7
  189. package/dist/modules/auth/events.js +0 -30
  190. package/dist/modules/auth/events.js.map +0 -7
  191. package/dist/modules/business_rules/api/execute/[ruleId]/route.js +0 -145
  192. package/dist/modules/business_rules/api/execute/[ruleId]/route.js.map +0 -7
  193. package/dist/modules/catalog/events.js +0 -34
  194. package/dist/modules/catalog/events.js.map +0 -7
  195. package/dist/modules/customers/events.js +0 -49
  196. package/dist/modules/customers/events.js.map +0 -7
  197. package/dist/modules/directory/events.js +0 -23
  198. package/dist/modules/directory/events.js.map +0 -7
  199. package/dist/modules/sales/events.js +0 -63
  200. package/dist/modules/sales/events.js.map +0 -7
  201. package/dist/modules/sales/lib/frontend/documentDataEvents.js +0 -25
  202. package/dist/modules/sales/lib/frontend/documentDataEvents.js.map +0 -7
  203. package/dist/modules/workflows/components/DefinitionTriggersEditor.js +0 -481
  204. package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +0 -7
  205. package/dist/modules/workflows/components/EventTriggersEditor.js +0 -553
  206. package/dist/modules/workflows/components/EventTriggersEditor.js.map +0 -7
  207. package/dist/modules/workflows/events.js +0 -38
  208. package/dist/modules/workflows/events.js.map +0 -7
  209. package/dist/modules/workflows/examples/order-approval-definition.json +0 -257
  210. package/dist/modules/workflows/examples/order-approval-guard-rules.json +0 -32
  211. package/dist/modules/workflows/lib/event-trigger-service.js +0 -308
  212. package/dist/modules/workflows/lib/event-trigger-service.js.map +0 -7
  213. package/dist/modules/workflows/migrations/Migration20260123143500.js +0 -36
  214. package/dist/modules/workflows/migrations/Migration20260123143500.js.map +0 -7
  215. package/dist/modules/workflows/subscribers/event-trigger.js +0 -78
  216. package/dist/modules/workflows/subscribers/event-trigger.js.map +0 -7
  217. package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js +0 -323
  218. package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js.map +0 -7
  219. package/dist/modules/workflows/widgets/injection/order-approval/widget.js +0 -17
  220. package/dist/modules/workflows/widgets/injection/order-approval/widget.js.map +0 -7
  221. package/dist/modules/workflows/widgets/injection-table.js +0 -19
  222. package/dist/modules/workflows/widgets/injection-table.js.map +0 -7
  223. package/generated/entities/workflow_event_trigger/index.ts +0 -15
  224. package/src/modules/auth/events.ts +0 -39
  225. package/src/modules/business_rules/api/execute/[ruleId]/route.ts +0 -163
  226. package/src/modules/catalog/events.ts +0 -45
  227. package/src/modules/customers/events.ts +0 -63
  228. package/src/modules/directory/events.ts +0 -31
  229. package/src/modules/sales/events.ts +0 -82
  230. package/src/modules/sales/lib/frontend/documentDataEvents.ts +0 -28
  231. package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +0 -581
  232. package/src/modules/workflows/components/EventTriggersEditor.tsx +0 -664
  233. package/src/modules/workflows/events.ts +0 -49
  234. package/src/modules/workflows/examples/order-approval-definition.json +0 -257
  235. package/src/modules/workflows/examples/order-approval-guard-rules.json +0 -32
  236. package/src/modules/workflows/lib/event-trigger-service.ts +0 -557
  237. package/src/modules/workflows/migrations/Migration20260123143500.ts +0 -38
  238. package/src/modules/workflows/subscribers/event-trigger.ts +0 -109
  239. package/src/modules/workflows/widgets/injection/order-approval/widget.client.tsx +0 -446
  240. package/src/modules/workflows/widgets/injection/order-approval/widget.ts +0 -16
  241. package/src/modules/workflows/widgets/injection-table.ts +0 -21
@@ -1,78 +1,82 @@
1
1
  import { Migration } from "@mikro-orm/migrations";
2
2
  class Migration20251207131955 extends Migration {
3
+ /** Drop a foreign key constraint only when the owning table exists (safe for disabled modules). */
4
+ dropConstraintIfTableExists(table, constraint) {
5
+ this.addSql(`DO $$ BEGIN IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_name = '${table}') THEN ALTER TABLE "${table}" DROP CONSTRAINT IF EXISTS "${constraint}"; END IF; END $$;`);
6
+ }
3
7
  async up() {
4
- this.addSql(`alter table "rule_execution_logs" drop constraint "rule_execution_logs_rule_id_foreign";`);
5
- this.addSql(`alter table "rule_set_members" drop constraint "rule_set_members_rule_id_foreign";`);
6
- this.addSql(`alter table "catalog_product_variant_prices" drop constraint "catalog_product_variant_prices_price_kind_id_foreign";`);
7
- this.addSql(`alter table "catalog_product_category_assignments" drop constraint "catalog_product_category_assignments_category_id_foreign";`);
8
- this.addSql(`alter table "catalog_product_variant_prices" drop constraint "catalog_product_variant_prices_offer_id_foreign";`);
9
- this.addSql(`alter table "catalog_products" drop constraint "catalog_products_option_schema_id_foreign";`);
10
- this.addSql(`alter table "catalog_product_tag_assignments" drop constraint "catalog_product_tag_assignments_tag_id_foreign";`);
11
- this.addSql(`alter table "catalog_product_variant_option_values" drop constraint "catalog_product_variant_option_values_variant_id_foreign";`);
12
- this.addSql(`alter table "catalog_product_variant_prices" drop constraint "catalog_product_variant_prices_variant_id_foreign";`);
13
- this.addSql(`alter table "catalog_product_variant_relations" drop constraint "catalog_product_variant_relations_child_variant_id_foreign";`);
14
- this.addSql(`alter table "catalog_product_variant_relations" drop constraint "catalog_product_variant_relations_parent_variant_id_foreign";`);
15
- this.addSql(`alter table "catalog_product_category_assignments" drop constraint "catalog_product_category_assignments_product_id_foreign";`);
16
- this.addSql(`alter table "catalog_product_offers" drop constraint "catalog_product_offers_product_id_foreign";`);
17
- this.addSql(`alter table "catalog_product_options" drop constraint "catalog_product_options_product_id_foreign";`);
18
- this.addSql(`alter table "catalog_product_relations" drop constraint "catalog_product_relations_child_product_id_foreign";`);
19
- this.addSql(`alter table "catalog_product_relations" drop constraint "catalog_product_relations_parent_product_id_foreign";`);
20
- this.addSql(`alter table "catalog_product_tag_assignments" drop constraint "catalog_product_tag_assignments_product_id_foreign";`);
21
- this.addSql(`alter table "catalog_product_variant_prices" drop constraint "catalog_product_variant_prices_product_id_foreign";`);
22
- this.addSql(`alter table "catalog_product_variants" drop constraint "catalog_product_variants_product_id_foreign";`);
23
- this.addSql(`alter table "customer_activities" drop constraint "customer_activities_deal_id_foreign";`);
24
- this.addSql(`alter table "customer_comments" drop constraint "customer_comments_deal_id_foreign";`);
25
- this.addSql(`alter table "customer_deal_companies" drop constraint "customer_deal_companies_deal_id_foreign";`);
26
- this.addSql(`alter table "customer_deal_people" drop constraint "customer_deal_people_deal_id_foreign";`);
27
- this.addSql(`alter table "customer_activities" drop constraint "customer_activities_entity_id_foreign";`);
28
- this.addSql(`alter table "customer_addresses" drop constraint "customer_addresses_entity_id_foreign";`);
29
- this.addSql(`alter table "customer_comments" drop constraint "customer_comments_entity_id_foreign";`);
30
- this.addSql(`alter table "customer_companies" drop constraint "customer_companies_entity_id_foreign";`);
31
- this.addSql(`alter table "customer_deal_companies" drop constraint "customer_deal_companies_company_entity_id_foreign";`);
32
- this.addSql(`alter table "customer_deal_people" drop constraint "customer_deal_people_person_entity_id_foreign";`);
33
- this.addSql(`alter table "customer_people" drop constraint "customer_people_company_entity_id_foreign";`);
34
- this.addSql(`alter table "customer_people" drop constraint "customer_people_entity_id_foreign";`);
35
- this.addSql(`alter table "customer_tag_assignments" drop constraint "customer_tag_assignments_entity_id_foreign";`);
36
- this.addSql(`alter table "customer_todo_links" drop constraint "customer_todo_links_entity_id_foreign";`);
37
- this.addSql(`alter table "customer_tag_assignments" drop constraint "customer_tag_assignments_tag_id_foreign";`);
38
- this.addSql(`alter table "dictionary_entries" drop constraint "dictionary_entries_dictionary_id_foreign";`);
39
- this.addSql(`alter table "role_acls" drop constraint "role_acls_role_id_foreign";`);
40
- this.addSql(`alter table "role_sidebar_preferences" drop constraint "role_sidebar_preferences_role_id_foreign";`);
41
- this.addSql(`alter table "user_roles" drop constraint "user_roles_role_id_foreign";`);
42
- this.addSql(`alter table "rule_set_members" drop constraint "rule_set_members_rule_set_id_foreign";`);
43
- this.addSql(`alter table "sales_orders" drop constraint "sales_orders_channel_ref_id_foreign";`);
44
- this.addSql(`alter table "sales_credit_memo_lines" drop constraint "sales_credit_memo_lines_credit_memo_id_foreign";`);
45
- this.addSql(`alter table "sales_orders" drop constraint "sales_orders_delivery_window_ref_id_foreign";`);
46
- this.addSql(`alter table "sales_credit_memos" drop constraint "sales_credit_memos_invoice_id_foreign";`);
47
- this.addSql(`alter table "sales_invoice_lines" drop constraint "sales_invoice_lines_invoice_id_foreign";`);
48
- this.addSql(`alter table "sales_payment_allocations" drop constraint "sales_payment_allocations_invoice_id_foreign";`);
49
- this.addSql(`alter table "sales_credit_memo_lines" drop constraint "sales_credit_memo_lines_order_line_id_foreign";`);
50
- this.addSql(`alter table "sales_invoice_lines" drop constraint "sales_invoice_lines_order_line_id_foreign";`);
51
- this.addSql(`alter table "sales_order_adjustments" drop constraint "sales_order_adjustments_order_line_id_foreign";`);
52
- this.addSql(`alter table "sales_shipment_items" drop constraint "sales_shipment_items_order_line_id_foreign";`);
53
- this.addSql(`alter table "sales_credit_memos" drop constraint "sales_credit_memos_order_id_foreign";`);
54
- this.addSql(`alter table "sales_invoices" drop constraint "sales_invoices_order_id_foreign";`);
55
- this.addSql(`alter table "sales_notes" drop constraint "sales_notes_order_id_foreign";`);
56
- this.addSql(`alter table "sales_order_adjustments" drop constraint "sales_order_adjustments_order_id_foreign";`);
57
- this.addSql(`alter table "sales_order_lines" drop constraint "sales_order_lines_order_id_foreign";`);
58
- this.addSql(`alter table "sales_payment_allocations" drop constraint "sales_payment_allocations_order_id_foreign";`);
59
- this.addSql(`alter table "sales_payments" drop constraint "sales_payments_order_id_foreign";`);
60
- this.addSql(`alter table "sales_shipments" drop constraint "sales_shipments_order_id_foreign";`);
61
- this.addSql(`alter table "sales_orders" drop constraint "sales_orders_payment_method_ref_id_foreign";`);
62
- this.addSql(`alter table "sales_payments" drop constraint "sales_payments_payment_method_id_foreign";`);
63
- this.addSql(`alter table "sales_payment_allocations" drop constraint "sales_payment_allocations_payment_id_foreign";`);
64
- this.addSql(`alter table "sales_quote_adjustments" drop constraint "sales_quote_adjustments_quote_line_id_foreign";`);
65
- this.addSql(`alter table "sales_notes" drop constraint "sales_notes_quote_id_foreign";`);
66
- this.addSql(`alter table "sales_quote_adjustments" drop constraint "sales_quote_adjustments_quote_id_foreign";`);
67
- this.addSql(`alter table "sales_quote_lines" drop constraint "sales_quote_lines_quote_id_foreign";`);
68
- this.addSql(`alter table "sales_shipment_items" drop constraint "sales_shipment_items_shipment_id_foreign";`);
69
- this.addSql(`alter table "sales_orders" drop constraint "sales_orders_shipping_method_ref_id_foreign";`);
70
- this.addSql(`alter table "organizations" drop constraint "organizations_tenant_id_foreign";`);
71
- this.addSql(`alter table "password_resets" drop constraint "password_resets_user_id_foreign";`);
72
- this.addSql(`alter table "sessions" drop constraint "sessions_user_id_foreign";`);
73
- this.addSql(`alter table "user_acls" drop constraint "user_acls_user_id_foreign";`);
74
- this.addSql(`alter table "user_roles" drop constraint "user_roles_user_id_foreign";`);
75
- this.addSql(`alter table "user_sidebar_preferences" drop constraint "user_sidebar_preferences_user_id_foreign";`);
8
+ this.dropConstraintIfTableExists("rule_execution_logs", "rule_execution_logs_rule_id_foreign");
9
+ this.dropConstraintIfTableExists("rule_set_members", "rule_set_members_rule_id_foreign");
10
+ this.dropConstraintIfTableExists("catalog_product_variant_prices", "catalog_product_variant_prices_price_kind_id_foreign");
11
+ this.dropConstraintIfTableExists("catalog_product_category_assignments", "catalog_product_category_assignments_category_id_foreign");
12
+ this.dropConstraintIfTableExists("catalog_product_variant_prices", "catalog_product_variant_prices_offer_id_foreign");
13
+ this.dropConstraintIfTableExists("catalog_products", "catalog_products_option_schema_id_foreign");
14
+ this.dropConstraintIfTableExists("catalog_product_tag_assignments", "catalog_product_tag_assignments_tag_id_foreign");
15
+ this.dropConstraintIfTableExists("catalog_product_variant_option_values", "catalog_product_variant_option_values_variant_id_foreign");
16
+ this.dropConstraintIfTableExists("catalog_product_variant_prices", "catalog_product_variant_prices_variant_id_foreign");
17
+ this.dropConstraintIfTableExists("catalog_product_variant_relations", "catalog_product_variant_relations_child_variant_id_foreign");
18
+ this.dropConstraintIfTableExists("catalog_product_variant_relations", "catalog_product_variant_relations_parent_variant_id_foreign");
19
+ this.dropConstraintIfTableExists("catalog_product_category_assignments", "catalog_product_category_assignments_product_id_foreign");
20
+ this.dropConstraintIfTableExists("catalog_product_offers", "catalog_product_offers_product_id_foreign");
21
+ this.dropConstraintIfTableExists("catalog_product_options", "catalog_product_options_product_id_foreign");
22
+ this.dropConstraintIfTableExists("catalog_product_relations", "catalog_product_relations_child_product_id_foreign");
23
+ this.dropConstraintIfTableExists("catalog_product_relations", "catalog_product_relations_parent_product_id_foreign");
24
+ this.dropConstraintIfTableExists("catalog_product_tag_assignments", "catalog_product_tag_assignments_product_id_foreign");
25
+ this.dropConstraintIfTableExists("catalog_product_variant_prices", "catalog_product_variant_prices_product_id_foreign");
26
+ this.dropConstraintIfTableExists("catalog_product_variants", "catalog_product_variants_product_id_foreign");
27
+ this.dropConstraintIfTableExists("customer_activities", "customer_activities_deal_id_foreign");
28
+ this.dropConstraintIfTableExists("customer_comments", "customer_comments_deal_id_foreign");
29
+ this.dropConstraintIfTableExists("customer_deal_companies", "customer_deal_companies_deal_id_foreign");
30
+ this.dropConstraintIfTableExists("customer_deal_people", "customer_deal_people_deal_id_foreign");
31
+ this.dropConstraintIfTableExists("customer_activities", "customer_activities_entity_id_foreign");
32
+ this.dropConstraintIfTableExists("customer_addresses", "customer_addresses_entity_id_foreign");
33
+ this.dropConstraintIfTableExists("customer_comments", "customer_comments_entity_id_foreign");
34
+ this.dropConstraintIfTableExists("customer_companies", "customer_companies_entity_id_foreign");
35
+ this.dropConstraintIfTableExists("customer_deal_companies", "customer_deal_companies_company_entity_id_foreign");
36
+ this.dropConstraintIfTableExists("customer_deal_people", "customer_deal_people_person_entity_id_foreign");
37
+ this.dropConstraintIfTableExists("customer_people", "customer_people_company_entity_id_foreign");
38
+ this.dropConstraintIfTableExists("customer_people", "customer_people_entity_id_foreign");
39
+ this.dropConstraintIfTableExists("customer_tag_assignments", "customer_tag_assignments_entity_id_foreign");
40
+ this.dropConstraintIfTableExists("customer_todo_links", "customer_todo_links_entity_id_foreign");
41
+ this.dropConstraintIfTableExists("customer_tag_assignments", "customer_tag_assignments_tag_id_foreign");
42
+ this.dropConstraintIfTableExists("dictionary_entries", "dictionary_entries_dictionary_id_foreign");
43
+ this.dropConstraintIfTableExists("role_acls", "role_acls_role_id_foreign");
44
+ this.dropConstraintIfTableExists("role_sidebar_preferences", "role_sidebar_preferences_role_id_foreign");
45
+ this.dropConstraintIfTableExists("user_roles", "user_roles_role_id_foreign");
46
+ this.dropConstraintIfTableExists("rule_set_members", "rule_set_members_rule_set_id_foreign");
47
+ this.dropConstraintIfTableExists("sales_orders", "sales_orders_channel_ref_id_foreign");
48
+ this.dropConstraintIfTableExists("sales_credit_memo_lines", "sales_credit_memo_lines_credit_memo_id_foreign");
49
+ this.dropConstraintIfTableExists("sales_orders", "sales_orders_delivery_window_ref_id_foreign");
50
+ this.dropConstraintIfTableExists("sales_credit_memos", "sales_credit_memos_invoice_id_foreign");
51
+ this.dropConstraintIfTableExists("sales_invoice_lines", "sales_invoice_lines_invoice_id_foreign");
52
+ this.dropConstraintIfTableExists("sales_payment_allocations", "sales_payment_allocations_invoice_id_foreign");
53
+ this.dropConstraintIfTableExists("sales_credit_memo_lines", "sales_credit_memo_lines_order_line_id_foreign");
54
+ this.dropConstraintIfTableExists("sales_invoice_lines", "sales_invoice_lines_order_line_id_foreign");
55
+ this.dropConstraintIfTableExists("sales_order_adjustments", "sales_order_adjustments_order_line_id_foreign");
56
+ this.dropConstraintIfTableExists("sales_shipment_items", "sales_shipment_items_order_line_id_foreign");
57
+ this.dropConstraintIfTableExists("sales_credit_memos", "sales_credit_memos_order_id_foreign");
58
+ this.dropConstraintIfTableExists("sales_invoices", "sales_invoices_order_id_foreign");
59
+ this.dropConstraintIfTableExists("sales_notes", "sales_notes_order_id_foreign");
60
+ this.dropConstraintIfTableExists("sales_order_adjustments", "sales_order_adjustments_order_id_foreign");
61
+ this.dropConstraintIfTableExists("sales_order_lines", "sales_order_lines_order_id_foreign");
62
+ this.dropConstraintIfTableExists("sales_payment_allocations", "sales_payment_allocations_order_id_foreign");
63
+ this.dropConstraintIfTableExists("sales_payments", "sales_payments_order_id_foreign");
64
+ this.dropConstraintIfTableExists("sales_shipments", "sales_shipments_order_id_foreign");
65
+ this.dropConstraintIfTableExists("sales_orders", "sales_orders_payment_method_ref_id_foreign");
66
+ this.dropConstraintIfTableExists("sales_payments", "sales_payments_payment_method_id_foreign");
67
+ this.dropConstraintIfTableExists("sales_payment_allocations", "sales_payment_allocations_payment_id_foreign");
68
+ this.dropConstraintIfTableExists("sales_quote_adjustments", "sales_quote_adjustments_quote_line_id_foreign");
69
+ this.dropConstraintIfTableExists("sales_notes", "sales_notes_quote_id_foreign");
70
+ this.dropConstraintIfTableExists("sales_quote_adjustments", "sales_quote_adjustments_quote_id_foreign");
71
+ this.dropConstraintIfTableExists("sales_quote_lines", "sales_quote_lines_quote_id_foreign");
72
+ this.dropConstraintIfTableExists("sales_shipment_items", "sales_shipment_items_shipment_id_foreign");
73
+ this.dropConstraintIfTableExists("sales_orders", "sales_orders_shipping_method_ref_id_foreign");
74
+ this.dropConstraintIfTableExists("organizations", "organizations_tenant_id_foreign");
75
+ this.dropConstraintIfTableExists("password_resets", "password_resets_user_id_foreign");
76
+ this.dropConstraintIfTableExists("sessions", "sessions_user_id_foreign");
77
+ this.dropConstraintIfTableExists("user_acls", "user_acls_user_id_foreign");
78
+ this.dropConstraintIfTableExists("user_roles", "user_roles_user_id_foreign");
79
+ this.dropConstraintIfTableExists("user_sidebar_preferences", "user_sidebar_preferences_user_id_foreign");
76
80
  this.addSql(`create table "step_instances" ("id" uuid not null default gen_random_uuid(), "workflow_instance_id" uuid not null, "step_id" varchar(100) not null, "step_name" varchar(255) not null, "step_type" varchar(50) not null, "status" varchar(20) not null, "input_data" jsonb null, "output_data" jsonb null, "error_data" jsonb null, "entered_at" timestamptz null, "exited_at" timestamptz null, "execution_time_ms" int null, "retry_count" int not null default 0, "tenant_id" uuid not null, "organization_id" uuid not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "step_instances_pkey" primary key ("id"));`);
77
81
  this.addSql(`create index "step_instances_tenant_org_idx" on "step_instances" ("tenant_id", "organization_id");`);
78
82
  this.addSql(`create index "step_instances_step_id_idx" on "step_instances" ("step_id", "status");`);