@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.
- package/dist/generated/entities.ids.generated.js +0 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +0 -2
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/modules/api_keys/setup.js +11 -0
- package/dist/modules/api_keys/setup.js.map +7 -0
- package/dist/modules/attachments/components/AttachmentLibrary.js +1 -1
- package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
- package/dist/modules/attachments/lib/assignmentDetails.js +31 -17
- package/dist/modules/attachments/lib/assignmentDetails.js.map +2 -2
- package/dist/modules/attachments/lib/partitions.js +3 -3
- package/dist/modules/attachments/lib/partitions.js.map +2 -2
- package/dist/modules/attachments/setup.js +11 -0
- package/dist/modules/attachments/setup.js.map +7 -0
- package/dist/modules/audit_logs/setup.js +12 -0
- package/dist/modules/audit_logs/setup.js.map +7 -0
- package/dist/modules/auth/lib/setup-app.js +29 -159
- package/dist/modules/auth/lib/setup-app.js.map +2 -2
- package/dist/modules/auth/setup.js +11 -0
- package/dist/modules/auth/setup.js.map +7 -0
- package/dist/modules/business_rules/data/validators.js +0 -34
- package/dist/modules/business_rules/data/validators.js.map +2 -2
- package/dist/modules/business_rules/index.js +1 -21
- package/dist/modules/business_rules/index.js.map +2 -2
- package/dist/modules/business_rules/lib/rule-engine.js +1 -182
- package/dist/modules/business_rules/lib/rule-engine.js.map +2 -2
- package/dist/modules/business_rules/setup.js +11 -0
- package/dist/modules/business_rules/setup.js.map +7 -0
- package/dist/modules/catalog/setup.js +22 -0
- package/dist/modules/catalog/setup.js.map +7 -0
- package/dist/modules/configs/lib/upgrade-actions.js +65 -15
- package/dist/modules/configs/lib/upgrade-actions.js.map +2 -2
- package/dist/modules/configs/setup.js +16 -0
- package/dist/modules/configs/setup.js.map +7 -0
- package/dist/modules/currencies/setup.js +16 -0
- package/dist/modules/currencies/setup.js.map +7 -0
- package/dist/modules/customers/setup.js +36 -0
- package/dist/modules/customers/setup.js.map +7 -0
- package/dist/modules/dashboards/setup.js +12 -0
- package/dist/modules/dashboards/setup.js.map +7 -0
- package/dist/modules/dictionaries/setup.js +12 -0
- package/dist/modules/dictionaries/setup.js.map +7 -0
- package/dist/modules/directory/setup.js +12 -0
- package/dist/modules/directory/setup.js.map +7 -0
- package/dist/modules/entities/setup.js +11 -0
- package/dist/modules/entities/setup.js.map +7 -0
- package/dist/modules/feature_toggles/setup.js +11 -0
- package/dist/modules/feature_toggles/setup.js.map +7 -0
- package/dist/modules/perspectives/setup.js +12 -0
- package/dist/modules/perspectives/setup.js.map +7 -0
- package/dist/modules/planner/setup.js +21 -0
- package/dist/modules/planner/setup.js.map +7 -0
- package/dist/modules/query_index/setup.js +11 -0
- package/dist/modules/query_index/setup.js.map +7 -0
- package/dist/modules/resources/setup.js +21 -0
- package/dist/modules/resources/setup.js.map +7 -0
- package/dist/modules/sales/acl.js +0 -1
- package/dist/modules/sales/acl.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +0 -12
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/commands/documents.js +0 -62
- package/dist/modules/sales/commands/documents.js.map +2 -2
- package/dist/modules/sales/lib/dictionaries.js +0 -3
- package/dist/modules/sales/lib/dictionaries.js.map +2 -2
- package/dist/modules/sales/setup.js +99 -0
- package/dist/modules/sales/setup.js.map +7 -0
- package/dist/modules/staff/setup.js +27 -0
- package/dist/modules/staff/setup.js.map +7 -0
- package/dist/modules/workflows/acl.js +0 -2
- package/dist/modules/workflows/acl.js.map +2 -2
- package/dist/modules/workflows/api/instances/route.js +6 -18
- package/dist/modules/workflows/api/instances/route.js.map +2 -2
- package/dist/modules/workflows/api/tasks/route.js +1 -6
- package/dist/modules/workflows/api/tasks/route.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/[id]/page.js +1 -9
- package/dist/modules/workflows/backend/definitions/[id]/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/[id]/page.meta.js +1 -1
- package/dist/modules/workflows/backend/definitions/[id]/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/create/page.js +15 -24
- package/dist/modules/workflows/backend/definitions/create/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/create/page.meta.js +1 -1
- package/dist/modules/workflows/backend/definitions/create/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js +132 -150
- package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
- package/dist/modules/workflows/backend/definitions/visual-editor/page.meta.js +1 -1
- package/dist/modules/workflows/backend/definitions/visual-editor/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/events/[id]/page.js +1 -1
- package/dist/modules/workflows/backend/events/[id]/page.js.map +2 -2
- package/dist/modules/workflows/backend/events/[id]/page.meta.js +2 -2
- package/dist/modules/workflows/backend/events/[id]/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/instances/[id]/page.meta.js +2 -2
- package/dist/modules/workflows/backend/instances/[id]/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/[id]/page.js +1 -1
- package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/[id]/page.meta.js +2 -2
- package/dist/modules/workflows/backend/tasks/[id]/page.meta.js.map +2 -2
- package/dist/modules/workflows/backend/tasks/page.js +6 -5
- package/dist/modules/workflows/backend/tasks/page.js.map +2 -2
- package/dist/modules/workflows/cli.js +3 -81
- package/dist/modules/workflows/cli.js.map +3 -3
- package/dist/modules/workflows/data/entities.js +1 -64
- package/dist/modules/workflows/data/entities.js.map +2 -2
- package/dist/modules/workflows/data/validators.js +0 -115
- package/dist/modules/workflows/data/validators.js.map +2 -2
- package/dist/modules/workflows/examples/checkout-demo-definition.json +5 -1
- package/dist/modules/workflows/lib/activity-executor.js +13 -75
- package/dist/modules/workflows/lib/activity-executor.js.map +2 -2
- package/dist/modules/workflows/lib/graph-utils.js +2 -71
- package/dist/modules/workflows/lib/graph-utils.js.map +2 -2
- package/dist/modules/workflows/lib/seeds.js +7 -36
- package/dist/modules/workflows/lib/seeds.js.map +2 -2
- package/dist/modules/workflows/lib/start-validator.js +23 -33
- package/dist/modules/workflows/lib/start-validator.js.map +2 -2
- package/dist/modules/workflows/lib/transition-handler.js +45 -157
- package/dist/modules/workflows/lib/transition-handler.js.map +3 -3
- package/dist/modules/workflows/migrations/Migration20251207131955.js +76 -72
- package/dist/modules/workflows/migrations/Migration20251207131955.js.map +2 -2
- package/dist/modules/workflows/setup.js +16 -0
- package/dist/modules/workflows/setup.js.map +7 -0
- package/generated/entities.ids.generated.ts +0 -1
- package/generated/entity-fields-registry.ts +0 -2
- package/package.json +2 -2
- package/src/__tests__/module-decoupling.test.ts +356 -0
- package/src/modules/api_keys/setup.ts +9 -0
- package/src/modules/attachments/components/AttachmentLibrary.tsx +2 -2
- package/src/modules/attachments/lib/assignmentDetails.ts +32 -16
- package/src/modules/attachments/lib/partitions.ts +3 -3
- package/src/modules/attachments/setup.ts +9 -0
- package/src/modules/audit_logs/setup.ts +10 -0
- package/src/modules/auth/__tests__/cli-setup-acl.test.ts +30 -0
- package/src/modules/auth/lib/setup-app.ts +40 -177
- package/src/modules/auth/setup.ts +9 -0
- package/src/modules/business_rules/data/validators.ts +0 -40
- package/src/modules/business_rules/index.ts +0 -25
- package/src/modules/business_rules/lib/rule-engine.ts +1 -281
- package/src/modules/business_rules/setup.ts +9 -0
- package/src/modules/catalog/setup.ts +22 -0
- package/src/modules/configs/lib/upgrade-actions.ts +78 -17
- package/src/modules/configs/setup.ts +14 -0
- package/src/modules/currencies/setup.ts +15 -0
- package/src/modules/customers/setup.ts +36 -0
- package/src/modules/dashboards/setup.ts +10 -0
- package/src/modules/dictionaries/setup.ts +10 -0
- package/src/modules/directory/setup.ts +10 -0
- package/src/modules/entities/setup.ts +9 -0
- package/src/modules/feature_toggles/setup.ts +9 -0
- package/src/modules/perspectives/setup.ts +10 -0
- package/src/modules/planner/setup.ts +21 -0
- package/src/modules/query_index/setup.ts +9 -0
- package/src/modules/resources/setup.ts +21 -0
- package/src/modules/sales/acl.ts +0 -1
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +0 -16
- package/src/modules/sales/commands/documents.ts +1 -74
- package/src/modules/sales/lib/dictionaries.ts +0 -3
- package/src/modules/sales/setup.ts +108 -0
- package/src/modules/staff/setup.ts +27 -0
- package/src/modules/workflows/acl.ts +0 -2
- package/src/modules/workflows/api/__tests__/instances.route.test.ts +2 -5
- package/src/modules/workflows/api/instances/route.ts +7 -21
- package/src/modules/workflows/api/tasks/route.ts +1 -7
- package/src/modules/workflows/backend/definitions/[id]/page.meta.ts +1 -1
- package/src/modules/workflows/backend/definitions/[id]/page.tsx +0 -9
- package/src/modules/workflows/backend/definitions/create/page.meta.ts +1 -1
- package/src/modules/workflows/backend/definitions/create/page.tsx +0 -9
- package/src/modules/workflows/backend/definitions/visual-editor/page.meta.ts +1 -1
- package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +3 -21
- package/src/modules/workflows/backend/events/[id]/page.meta.ts +2 -2
- package/src/modules/workflows/backend/events/[id]/page.tsx +1 -1
- package/src/modules/workflows/backend/instances/[id]/page.meta.ts +2 -2
- package/src/modules/workflows/backend/tasks/[id]/page.meta.ts +2 -2
- package/src/modules/workflows/backend/tasks/[id]/page.tsx +1 -1
- package/src/modules/workflows/backend/tasks/page.tsx +6 -5
- package/src/modules/workflows/cli.ts +0 -111
- package/src/modules/workflows/data/entities.ts +0 -124
- package/src/modules/workflows/data/validators.ts +0 -138
- package/src/modules/workflows/examples/checkout-demo-definition.json +5 -1
- package/src/modules/workflows/i18n/en.json +0 -71
- package/src/modules/workflows/lib/__tests__/activity-executor.test.ts +36 -43
- package/src/modules/workflows/lib/__tests__/transition-handler.test.ts +90 -170
- package/src/modules/workflows/lib/activity-executor.ts +16 -129
- package/src/modules/workflows/lib/graph-utils.ts +2 -117
- package/src/modules/workflows/lib/seeds.ts +12 -50
- package/src/modules/workflows/lib/start-validator.ts +28 -38
- package/src/modules/workflows/lib/transition-handler.ts +55 -208
- package/src/modules/workflows/migrations/Migration20251207131955.ts +77 -143
- package/src/modules/workflows/setup.ts +15 -0
- package/dist/generated/entities/workflow_event_trigger/index.js +0 -33
- package/dist/generated/entities/workflow_event_trigger/index.js.map +0 -7
- package/dist/modules/auth/events.js +0 -30
- package/dist/modules/auth/events.js.map +0 -7
- package/dist/modules/business_rules/api/execute/[ruleId]/route.js +0 -145
- package/dist/modules/business_rules/api/execute/[ruleId]/route.js.map +0 -7
- package/dist/modules/catalog/events.js +0 -34
- package/dist/modules/catalog/events.js.map +0 -7
- package/dist/modules/customers/events.js +0 -49
- package/dist/modules/customers/events.js.map +0 -7
- package/dist/modules/directory/events.js +0 -23
- package/dist/modules/directory/events.js.map +0 -7
- package/dist/modules/sales/events.js +0 -63
- package/dist/modules/sales/events.js.map +0 -7
- package/dist/modules/sales/lib/frontend/documentDataEvents.js +0 -25
- package/dist/modules/sales/lib/frontend/documentDataEvents.js.map +0 -7
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js +0 -481
- package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +0 -7
- package/dist/modules/workflows/components/EventTriggersEditor.js +0 -553
- package/dist/modules/workflows/components/EventTriggersEditor.js.map +0 -7
- package/dist/modules/workflows/events.js +0 -38
- package/dist/modules/workflows/events.js.map +0 -7
- package/dist/modules/workflows/examples/order-approval-definition.json +0 -257
- package/dist/modules/workflows/examples/order-approval-guard-rules.json +0 -32
- package/dist/modules/workflows/lib/event-trigger-service.js +0 -308
- package/dist/modules/workflows/lib/event-trigger-service.js.map +0 -7
- package/dist/modules/workflows/migrations/Migration20260123143500.js +0 -36
- package/dist/modules/workflows/migrations/Migration20260123143500.js.map +0 -7
- package/dist/modules/workflows/subscribers/event-trigger.js +0 -78
- package/dist/modules/workflows/subscribers/event-trigger.js.map +0 -7
- package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js +0 -323
- package/dist/modules/workflows/widgets/injection/order-approval/widget.client.js.map +0 -7
- package/dist/modules/workflows/widgets/injection/order-approval/widget.js +0 -17
- package/dist/modules/workflows/widgets/injection/order-approval/widget.js.map +0 -7
- package/dist/modules/workflows/widgets/injection-table.js +0 -19
- package/dist/modules/workflows/widgets/injection-table.js.map +0 -7
- package/generated/entities/workflow_event_trigger/index.ts +0 -15
- package/src/modules/auth/events.ts +0 -39
- package/src/modules/business_rules/api/execute/[ruleId]/route.ts +0 -163
- package/src/modules/catalog/events.ts +0 -45
- package/src/modules/customers/events.ts +0 -63
- package/src/modules/directory/events.ts +0 -31
- package/src/modules/sales/events.ts +0 -82
- package/src/modules/sales/lib/frontend/documentDataEvents.ts +0 -28
- package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +0 -581
- package/src/modules/workflows/components/EventTriggersEditor.tsx +0 -664
- package/src/modules/workflows/events.ts +0 -49
- package/src/modules/workflows/examples/order-approval-definition.json +0 -257
- package/src/modules/workflows/examples/order-approval-guard-rules.json +0 -32
- package/src/modules/workflows/lib/event-trigger-service.ts +0 -557
- package/src/modules/workflows/migrations/Migration20260123143500.ts +0 -38
- package/src/modules/workflows/subscribers/event-trigger.ts +0 -109
- package/src/modules/workflows/widgets/injection/order-approval/widget.client.tsx +0 -446
- package/src/modules/workflows/widgets/injection/order-approval/widget.ts +0 -16
- 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.
|
|
5
|
-
this.
|
|
6
|
-
this.
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
58
|
-
this.
|
|
59
|
-
this.
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
73
|
-
this.
|
|
74
|
-
this.
|
|
75
|
-
this.
|
|
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");`);
|