@taodigital/database 0.0.0-stage → 1.2.0
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/README.md +21 -2
- package/dist/index.d.ts +58 -0
- package/dist/index.js +209 -0
- package/package.json +29 -4
- package/prisma/migrations/0000_init/migration.sql +220 -0
- package/prisma/migrations/0001_tenant_isolation/migration.sql +43 -0
- package/prisma/migrations/0002_app_runtime_role/migration.sql +14 -0
- package/prisma/migrations/0003_skill_taxonomy/migration.sql +30 -0
- package/prisma/migrations/0004_extended_models/migration.sql +215 -0
- package/prisma/migrations/0005_enhanced_test_artifacts/migration.sql +24 -0
- package/prisma/migrations/0006_tenant_settings/migration.sql +28 -0
- package/prisma/migrations/0007_project_slug/migration.sql +11 -0
- package/prisma/migrations/0008_project_crawl_config/migration.sql +3 -0
- package/prisma/migrations/0009_tenant_slug/migration.sql +11 -0
- package/prisma/migrations/0010_user_password/migration.sql +3 -0
- package/prisma/migrations/0011_oauth_connections/migration.sql +78 -0
- package/prisma/migrations/0012_agent_webhooks/migration.sql +46 -0
- package/prisma/migrations/0013_project_artifacts/migration.sql +27 -0
- package/prisma/migrations/0014_knowledge_chunks/migration.sql +37 -0
- package/prisma/migrations/20260626022056_platform_job_migration/migration.sql +44 -0
- package/prisma/migrations/20260626053339_kag_schema_update/migration.sql +27 -0
- package/prisma/migrations/20260626053340_restore_bm25_index/migration.sql +13 -0
- package/prisma/migrations/20260626063704_token_optimisation/migration.sql +86 -0
- package/prisma/migrations/20260626080000_job_name/migration.sql +2 -0
- package/prisma/migrations/20260626090000_rls_missing_tables/migration.sql +39 -0
- package/prisma/migrations/20260626100000_token_budget/migration.sql +21 -0
- package/prisma/migrations/20260626110000_screen_groups/migration.sql +42 -0
- package/prisma/migrations/20260626120000_artifact_intelligence/migration.sql +5 -0
- package/prisma/migrations/20260626130000_notifications/migration.sql +34 -0
- package/prisma/migrations/20260627100000_element_viewport/migration.sql +2 -0
- package/prisma/migrations/20260627100000_screenshot_cloud_url/migration.sql +2 -0
- package/prisma/migrations/20260627110000_screenshot_index/migration.sql +2 -0
- package/prisma/migrations/20260627140000_artifact_storage_key/migration.sql +3 -0
- package/prisma/migrations/20260627150000_screen_lifecycle/migration.sql +5 -0
- package/prisma/migrations/20260627160000_native_app_support/migration.sql +41 -0
- package/prisma/migrations/20260627200000_rls_missing_tables/migration.sql +57 -0
- package/prisma/migrations/20260627210000_llmcalllog_tasktype/migration.sql +1 -0
- package/prisma/migrations/20260628100000_element_enrichment/migration.sql +7 -0
- package/prisma/migrations/20260628110000_element_hash/migration.sql +6 -0
- package/prisma/migrations/20260628120000_screen_diff/migration.sql +20 -0
- package/prisma/migrations/20260628130000_probe_observations/migration.sql +19 -0
- package/prisma/migrations/20260629100000_visual_baseline_masking/migration.sql +1 -0
- package/prisma/migrations/20260629110000_testcase_viewports/migration.sql +1 -0
- package/prisma/migrations/20260630100000_visual_baseline_element_snapshot/migration.sql +1 -0
- package/prisma/migrations/20260630110000_git_branched_baselines/migration.sql +11 -0
- package/prisma/migrations/20260630120000_testcase_viewport_constraint/migration.sql +1 -0
- package/prisma/migrations/20260630130000_test_case_runs/migration.sql +22 -0
- package/prisma/migrations/20260630140000_perf_env_comments/migration.sql +68 -0
- package/prisma/migrations/20260630150000_testcase_gen_at/migration.sql +2 -0
- package/prisma/migrations/20260630160000_rls_catchup_late_tables/migration.sql +41 -0
- package/prisma/migrations/20260701100000_skill_file_diff_approval/migration.sql +9 -0
- package/prisma/migrations/20260701200000_workspace_connector/migration.sql +20 -0
- package/prisma/migrations/20260701220000_screen_a11y_security/migration.sql +2 -0
- package/prisma/migrations/20260702100000_ci_threshold_root_cause/migration.sql +2 -0
- package/prisma/migrations/20260702120000_medium_priority_gaps/migration.sql +28 -0
- package/prisma/migrations/20260702140000_testcase_v2_technique/migration.sql +7 -0
- package/prisma/migrations/20260702150000_add_app_field/migration.sql +40 -0
- package/prisma/migrations/20260702160000_add_requirement_model/migration.sql +62 -0
- package/prisma/migrations/20260702180000_add_invitation_model/migration.sql +53 -0
- package/prisma/migrations/20260702190000_suite_hierarchy_artifact_trace/migration.sql +28 -0
- package/prisma/migrations/20260702200000_project_member_access/migration.sql +31 -0
- package/prisma/migrations/20260703000000_add_system_config/migration.sql +11 -0
- package/prisma/migrations/20260703000000_custom_roles/migration.sql +29 -0
- package/prisma/migrations/20260703100000_platform_admin/migration.sql +11 -0
- package/prisma/migrations/20260703110000_add_extension_models/migration.sql +106 -0
- package/prisma/migrations/20260703120000_project_restricted_column/migration.sql +1 -0
- package/prisma/migrations/20260703200000_system_config_category_index/migration.sql +1 -0
- package/prisma/migrations/20260703210000_workspace_layer/migration.sql +24 -0
- package/prisma/migrations/20260703230000_workspace_agent_tokens/migration.sql +2 -0
- package/prisma/migrations/20260704000000_requirement_rls_policy/migration.sql +35 -0
- package/prisma/migrations/20260704100000_fix_oauth_auditlog_cascade/migration.sql +9 -0
- package/prisma/migrations/20260704110000_skillfile_approval_status/migration.sql +2 -0
- package/prisma/migrations/20260704120000_scenario_suspect_workspace/migration.sql +35 -0
- package/prisma/migrations/20260704130000_testcase_traceto_suspect_indexes/migration.sql +5 -0
- package/prisma/migrations/20260704140000_workspace_rls/migration.sql +19 -0
- package/prisma/migrations/20260704150000_project_cascade_deletes/migration.sql +125 -0
- package/prisma/migrations/20260705100000_platform_job_worker_id/migration.sql +12 -0
- package/prisma/migrations/20260705110000_screen_discovery_method/migration.sql +7 -0
- package/prisma/migrations/20260705120000_webhook_delivery/migration.sql +32 -0
- package/prisma/migrations/20260705130000_tenant_feature_flags/migration.sql +23 -0
- package/prisma/migrations/20260705140000_auth_sessions/migration.sql +30 -0
- package/prisma/migrations/20260705150000_fix_rls_wrong_session_var/migration.sql +51 -0
- package/prisma/migrations/20260705160000_testcase_flaky_quarantine/migration.sql +14 -0
- package/prisma/migrations/20260705170000_testcaserun_browser/migration.sql +6 -0
- package/prisma/migrations/20260705180000_allow_custom_roles/migration.sql +22 -0
- package/prisma/migrations/20260706050000_screen_markdown_extraction/migration.sql +8 -0
- package/prisma/migrations/20260706090000_add_lighthouse_to_performance_snapshot/migration.sql +4 -0
- package/prisma/migrations/20260706100000_add_lighthouse_bp_and_job_index/migration.sql +5 -0
- package/prisma/migrations/20260706110000_add_visual_diff_ai_summary/migration.sql +2 -0
- package/prisma/migrations/20260707120000_script_bundles/migration.sql +25 -0
- package/prisma/migrations/20260707130000_requirement_source_section/migration.sql +4 -0
- package/prisma/migrations/20260707140000_structured_skill_metadata/migration.sql +8 -0
- package/prisma/migrations/20260707150000_crawler_platform_primitives/migration.sql +112 -0
- package/prisma/migrations/20260707160000_screen_group_versioning/migration.sql +9 -0
- package/prisma/migrations/20260707170000_add_mfa_fields/migration.sql +24 -0
- package/prisma/migrations/20260707180000_add_missing_tables/migration.sql +158 -0
- package/prisma/migrations/20260707190000_add_missing_columns/migration.sql +15 -0
- package/prisma/migrations/20260707200000_add_plan_sessions/migration.sql +1 -0
- package/prisma/migrations/20260708100000_missing_columns_comprehensive/migration.sql +15 -0
- package/prisma/migrations/20260708200000_testcase_dataset_column/migration.sql +16 -0
- package/prisma/migrations/20260709100000_add_filename_to_native_app_build/migration.sql +1 -0
- package/prisma/migrations/20260709200000_cloud_url_visual_artifacts/migration.sql +6 -0
- package/prisma/migrations/20260714200000_add_cached_scenarios_to_artifact/migration.sql +4 -0
- package/prisma/migrations/20260715200000_screen_markdown_content/migration.sql +2 -0
- package/prisma/migrations/20260716100000_github_repo_coverage_tables/migration.sql +114 -0
- package/prisma/migrations/20260716200000_github_pr_script_validation/migration.sql +48 -0
- package/prisma/migrations/20260716210000_s3_content_keys/migration.sql +20 -0
- package/prisma/migrations/20260717220000_ide_push_token/migration.sql +21 -0
- package/prisma/migrations/20260717230000_ide_push_script_ids/migration.sql +2 -0
- package/prisma/migrations/20260730040000_add_step_evidence_and_validation/migration.sql +93 -0
- package/prisma/migrations/20260803000000_add_tenantId_to_test_data_row/migration.sql +40 -0
- package/prisma/migrations/20260804000000_add_project_restricted/migration.sql +6 -0
- package/prisma/migrations/20260804000000_add_user_avatar_url/migration.sql +4 -0
- package/prisma/migrations/20260805000000_add_auditlog_ipaddress/migration.sql +2 -0
- package/prisma/migrations/20260807000000_add_test_data_classification/migration.sql +18 -0
- package/prisma/migrations/20260807000001_add_test_case_notes/migration.sql +5 -0
- package/prisma/migrations/20260807000002_add_visual_baseline_browser_structured_steps/migration.sql +11 -0
- package/prisma/migrations/20260807100000_add_tenant_plan_config/migration.sql +14 -0
- package/prisma/migrations/20260808000000_agent_token_missing_columns/migration.sql +22 -0
- package/prisma/migrations/20260808000001_visual_diff_image_and_threshold/migration.sql +8 -0
- package/prisma/migrations/20260808000002_ssoconfig_email_domains/migration.sql +7 -0
- package/prisma/migrations/20260808000003_project_status_description_updatedat/migration.sql +7 -0
- package/prisma/migrations/20260814000000_workspace_require_mfa/migration.sql +2 -0
- package/prisma/migrations/20260814000001_add_screenshot_dpr/migration.sql +2 -0
- package/prisma/migrations/20260818000000_add_content_hash_to_test_case/migration.sql +6 -0
- package/prisma/migrations/20260818000001_add_grounding_hash_to_test_case/migration.sql +3 -0
- package/prisma/migrations/20260819000000_coverage_mapping_cross_encoder_fields/migration.sql +3 -0
- package/prisma/migrations/20260820000000_add_locators_json_to_test_case/migration.sql +6 -0
- package/prisma/migrations/20260820000001_add_test_case_version/migration.sql +27 -0
- package/prisma/migrations/20260826000000_add_capture_step_screenshots/migration.sql +1 -0
- package/prisma/migrations/20260903000000_add_platform_job_dlq/migration.sql +10 -0
- package/prisma/migrations/20260903000002_add_versioning_tables/migration.sql +38 -0
- package/prisma/migrations/20260903000003_add_learning_models/migration.sql +71 -0
- package/prisma/migrations/20260903000004_add_workspace_agent_prompts/migration.sql +33 -0
- package/prisma/migrations/20260903000005_add_config_history/migration.sql +70 -0
- package/prisma/migrations/20260903000006_add_skill_file_config/migration.sql +24 -0
- package/prisma/migrations/20260904000000_add_agent_prompt_platform_table/migration.sql +23 -0
- package/prisma/migrations/20260904180424_rbac_role_configs_admin_roles/migration.sql +606 -0
- package/prisma/migrations/20260907000000_fix_testcase_timestamps/migration.sql +13 -0
- package/prisma/migrations/20260907000001_add_artifact_imported_suite_id/migration.sql +1 -0
- package/prisma/migrations/20260907000002_add_user_login_tracking/migration.sql +9 -0
- package/prisma/migrations/20260907000003_add_artifact_import_tracking/migration.sql +9 -0
- package/prisma/migrations/20260907000004_add_artifact_version_chain/migration.sql +18 -0
- package/prisma/migrations/20260908000000_add_project_vsa_enabled/migration.sql +2 -0
- package/prisma/migrations/20260908000001_rbac_migration_catchup/migration.sql +314 -0
- package/prisma/migrations/20260908000002_fix_role_configs_empty_permissions/migration.sql +22 -0
- package/prisma/migrations/20260908000003_sync_builtin_role_permissions/migration.sql +38 -0
- package/prisma/migrations/20260909000000_add_filepath_to_testscript/migration.sql +5 -0
- package/prisma/migrations/20260909000001_add_alignment_result_table/migration.sql +31 -0
- package/prisma/migrations/20260910000000_add_admin_mfa/migration.sql +35 -0
- package/prisma/migrations/20260910000000_add_dom_snapshot_cloud_url/migration.sql +2 -0
- package/prisma/migrations/20260910000001_add_requires_auth_to_screen/migration.sql +1 -0
- package/prisma/migrations/20260910000002_add_screen_requires_auth/migration.sql +2 -0
- package/prisma/migrations/20260910000003_add_admin_auth_sessions/migration.sql +17 -0
- package/prisma/migrations/20260916000001_add_admin_last_login/migration.sql +1 -0
- package/prisma/migrations/20260916000002_add_admin_failed_login/migration.sql +2 -0
- package/prisma/migrations/20260916000003_seed_system_tenant/migration.sql +6 -0
- package/prisma/migrations/20260918000000_fix_permissions_comprehensive/migration.sql +63 -0
- package/prisma/migrations/20260924000000_add_screen_role_access/migration.sql +2 -0
- package/prisma/migrations/20260928000000_add_navigation_graph/migration.sql +41 -0
- package/prisma/migrations/20260929000000_artifact_content_hash_suite_unique/migration.sql +25 -0
- package/prisma/migrations/20260929000000_navigation_graph_unique_constraint/migration.sql +5 -0
- package/prisma/migrations/20260929000001_add_membership_status/migration.sql +7 -0
- package/prisma/migrations/20260929000002_add_sso_config_scim_token_hash/migration.sql +8 -0
- package/prisma/migrations/20261005000001_jobs_workers_hardening/migration.sql +63 -0
- package/prisma/migrations/20261009000001_add_suite_category/migration.sql +2 -0
- package/prisma/migrations/20261009000002_add_testcase_approved_fields/migration.sql +3 -0
- package/prisma/migrations/20261012_auto_version_history/migration.sql +111 -0
- package/prisma/migrations/20261015000001_traceability_alignment_gaps/migration.sql +11 -0
- package/prisma/migrations/20261028000001_context_intelligence_p1_p7/migration.sql +76 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +2901 -0
- package/prisma/seed.ts +1262 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
-- ZETA-232/234: content-based dedupe of uploaded artifacts (sha256 of the original file bytes).
|
|
2
|
+
-- Existing rows stay NULL; filename dedupe still covers them.
|
|
3
|
+
ALTER TABLE "ProjectArtifact" ADD COLUMN IF NOT EXISTS "contentHash" TEXT;
|
|
4
|
+
|
|
5
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "ProjectArtifact_projectId_contentHash_key"
|
|
6
|
+
ON "ProjectArtifact"("projectId", "contentHash")
|
|
7
|
+
WHERE "contentHash" IS NOT NULL;
|
|
8
|
+
|
|
9
|
+
-- ZETA-261: one suite per exact name within the same project and parent.
|
|
10
|
+
-- Existing duplicates are renamed (never deleted) so the index can be built; oldest keeps its name.
|
|
11
|
+
WITH ranked AS (
|
|
12
|
+
SELECT "id",
|
|
13
|
+
ROW_NUMBER() OVER (
|
|
14
|
+
PARTITION BY "tenantId", "projectId", COALESCE("parentId", ''), "name"
|
|
15
|
+
ORDER BY "createdAt", "id"
|
|
16
|
+
) AS rn
|
|
17
|
+
FROM "TestSuite"
|
|
18
|
+
)
|
|
19
|
+
UPDATE "TestSuite" s
|
|
20
|
+
SET "name" = s."name" || ' (duplicate ' || ranked.rn || ')'
|
|
21
|
+
FROM ranked
|
|
22
|
+
WHERE s."id" = ranked."id" AND ranked.rn > 1;
|
|
23
|
+
|
|
24
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "TestSuite_tenant_project_parent_name_key"
|
|
25
|
+
ON "TestSuite"("tenantId", "projectId", COALESCE("parentId", ''), "name");
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
-- Add unique constraint on DiscoveredLink(fromScreenId, href) to enable
|
|
2
|
+
-- createMany skipDuplicates deduplication and prevent link explosion on re-crawl.
|
|
3
|
+
-- Safe with CONCURRENTLY on a live system; falls back to plain if table is empty.
|
|
4
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "DiscoveredLink_fromScreenId_href_key"
|
|
5
|
+
ON "DiscoveredLink"("fromScreenId", "href");
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
-- Migration: 20260929000001_add_membership_status
|
|
2
|
+
-- Adds soft-suspend support to Membership so SCIM deprovisioning (and future
|
|
3
|
+
-- admin "suspend member" actions) can revoke access without destroying the
|
|
4
|
+
-- membership row / role assignment. See docs/100-GAPS-RBAC-SECURITY-ENTERPRISE.md
|
|
5
|
+
-- §3 NEW-2 — SCIM deactivation previously had nothing to set.
|
|
6
|
+
|
|
7
|
+
ALTER TABLE "Membership" ADD COLUMN "status" TEXT NOT NULL DEFAULT 'ACTIVE';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Migration: 20260929000002_add_sso_config_scim_token_hash
|
|
2
|
+
-- Adds per-tenant SCIM 2.0 bearer token support (hashed, generated via
|
|
3
|
+
-- /admin/tenants/:tenantId/sso/scim-token) and an SSO-enforcement flag.
|
|
4
|
+
-- See docs/100-GAPS-RBAC-SECURITY-ENTERPRISE.md §1 #42, §3 NEW-1.
|
|
5
|
+
|
|
6
|
+
ALTER TABLE "SsoConfig" ADD COLUMN "scimTokenHash" TEXT;
|
|
7
|
+
ALTER TABLE "SsoConfig" ADD COLUMN "ssoRequired" BOOLEAN NOT NULL DEFAULT false;
|
|
8
|
+
CREATE UNIQUE INDEX "SsoConfig_scimTokenHash_key" ON "SsoConfig"("scimTokenHash");
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
-- GAP-03: Worker lease / fencing token
|
|
2
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "leaseExpiresAt" TIMESTAMP(3);
|
|
3
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "fencingToken" TEXT;
|
|
4
|
+
|
|
5
|
+
-- GAP-04: Durable CRAWL checkpoint
|
|
6
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "checkpoint" JSONB;
|
|
7
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "checkpointAt" TIMESTAMP(3);
|
|
8
|
+
|
|
9
|
+
-- GAP-06: Parent-child relationship
|
|
10
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "parentJobId" TEXT;
|
|
11
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "rootJobId" TEXT;
|
|
12
|
+
ALTER TABLE "PlatformJob" ADD CONSTRAINT "PlatformJob_parentJobId_fkey" FOREIGN KEY ("parentJobId") REFERENCES "PlatformJob"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
13
|
+
|
|
14
|
+
-- GAP-09: Current step as column
|
|
15
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "currentStep" TEXT;
|
|
16
|
+
|
|
17
|
+
-- GAP-10/22: Re-queue timestamp
|
|
18
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "requeuedAt" TIMESTAMP(3);
|
|
19
|
+
|
|
20
|
+
-- GAP-13: DLQ lifecycle
|
|
21
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "dlqAt" TIMESTAMP(3);
|
|
22
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "dlqRedriveCount" INTEGER NOT NULL DEFAULT 0;
|
|
23
|
+
|
|
24
|
+
-- GAP-16: User attribution
|
|
25
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "submittedBy" TEXT;
|
|
26
|
+
|
|
27
|
+
-- GAP-21: Inline mode flag
|
|
28
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "inline" BOOLEAN NOT NULL DEFAULT false;
|
|
29
|
+
|
|
30
|
+
-- GAP-23: Priority
|
|
31
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "priority" INTEGER NOT NULL DEFAULT 0;
|
|
32
|
+
|
|
33
|
+
-- New indexes
|
|
34
|
+
CREATE INDEX "PlatformJob_status_nextRetryAt_idx" ON "PlatformJob"("status", "nextRetryAt");
|
|
35
|
+
CREATE INDEX "PlatformJob_parentJobId_idx" ON "PlatformJob"("parentJobId");
|
|
36
|
+
CREATE INDEX "PlatformJob_tenantId_status_idx" ON "PlatformJob"("tenantId", "status");
|
|
37
|
+
CREATE INDEX "PlatformJob_priority_queuedAt_idx" ON "PlatformJob"("priority", "queuedAt");
|
|
38
|
+
|
|
39
|
+
-- GAP-05: JobAttempt table
|
|
40
|
+
CREATE TABLE "JobAttempt" (
|
|
41
|
+
"id" TEXT NOT NULL,
|
|
42
|
+
"jobId" TEXT NOT NULL,
|
|
43
|
+
"tenantId" TEXT NOT NULL,
|
|
44
|
+
"attemptNumber" INTEGER NOT NULL,
|
|
45
|
+
"workerId" TEXT,
|
|
46
|
+
"fencingToken" TEXT,
|
|
47
|
+
"startedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
48
|
+
"finishedAt" TIMESTAMP(3),
|
|
49
|
+
"status" TEXT NOT NULL,
|
|
50
|
+
"error" TEXT,
|
|
51
|
+
"progress" INTEGER NOT NULL DEFAULT 0,
|
|
52
|
+
|
|
53
|
+
CONSTRAINT "JobAttempt_pkey" PRIMARY KEY ("id")
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
ALTER TABLE "JobAttempt" ADD CONSTRAINT "JobAttempt_jobId_fkey" FOREIGN KEY ("jobId") REFERENCES "PlatformJob"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
57
|
+
|
|
58
|
+
CREATE INDEX "JobAttempt_jobId_idx" ON "JobAttempt"("jobId");
|
|
59
|
+
CREATE INDEX "JobAttempt_tenantId_idx" ON "JobAttempt"("tenantId");
|
|
60
|
+
CREATE INDEX "JobAttempt_jobId_attemptNumber_idx" ON "JobAttempt"("jobId", "attemptNumber");
|
|
61
|
+
|
|
62
|
+
-- GAP-14/15: Failure type classification
|
|
63
|
+
ALTER TABLE "PlatformJob" ADD COLUMN "failureType" TEXT;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
-- ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
-- Migration: auto_version_history
|
|
3
|
+
-- Adds a PostgreSQL trigger that automatically creates a TestCaseVersion record
|
|
4
|
+
-- on every INSERT or meaningful UPDATE to the TestCase table.
|
|
5
|
+
--
|
|
6
|
+
-- "Meaningful" = at least one of: title, steps, preconditions, expectedResult,
|
|
7
|
+
-- kind, priority changed.
|
|
8
|
+
--
|
|
9
|
+
-- ON CONFLICT DO NOTHING on (testCaseId, versionNum) prevents double-writes
|
|
10
|
+
-- when the application layer (repository.ts) has already created the version
|
|
11
|
+
-- record for the same operation.
|
|
12
|
+
-- ─────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
|
|
14
|
+
-- Unique constraint required for ON CONFLICT to work.
|
|
15
|
+
-- Only add if it doesn't already exist (idempotent).
|
|
16
|
+
DO $$
|
|
17
|
+
BEGIN
|
|
18
|
+
IF NOT EXISTS (
|
|
19
|
+
SELECT 1 FROM pg_constraint
|
|
20
|
+
WHERE conname = 'TestCaseVersion_testCaseId_versionNum_key'
|
|
21
|
+
) THEN
|
|
22
|
+
ALTER TABLE "TestCaseVersion"
|
|
23
|
+
ADD CONSTRAINT "TestCaseVersion_testCaseId_versionNum_key"
|
|
24
|
+
UNIQUE ("testCaseId", "versionNum");
|
|
25
|
+
END IF;
|
|
26
|
+
END;
|
|
27
|
+
$$;
|
|
28
|
+
|
|
29
|
+
-- ── Trigger function ─────────────────────────────────────────────────────────
|
|
30
|
+
CREATE OR REPLACE FUNCTION trg_testcase_auto_version()
|
|
31
|
+
RETURNS TRIGGER
|
|
32
|
+
LANGUAGE plpgsql
|
|
33
|
+
AS $$
|
|
34
|
+
DECLARE
|
|
35
|
+
v_next_num INTEGER;
|
|
36
|
+
v_new_id TEXT;
|
|
37
|
+
BEGIN
|
|
38
|
+
-- ── INSERT: always create version 1 (application may have already done it) ──
|
|
39
|
+
IF TG_OP = 'INSERT' THEN
|
|
40
|
+
INSERT INTO "TestCaseVersion" (
|
|
41
|
+
"id", "testCaseId", "versionNum",
|
|
42
|
+
"title", "steps", "preconditions", "expectedResult", "kind", "priority",
|
|
43
|
+
"snapshot", "tenantId", "createdAt"
|
|
44
|
+
) VALUES (
|
|
45
|
+
gen_random_uuid()::text,
|
|
46
|
+
NEW."id",
|
|
47
|
+
1,
|
|
48
|
+
NEW."title",
|
|
49
|
+
NEW."steps",
|
|
50
|
+
NEW."preconditions",
|
|
51
|
+
NEW."expectedResult",
|
|
52
|
+
NEW."kind",
|
|
53
|
+
NEW."priority",
|
|
54
|
+
row_to_json(NEW),
|
|
55
|
+
NEW."tenantId",
|
|
56
|
+
NOW()
|
|
57
|
+
)
|
|
58
|
+
ON CONFLICT ("testCaseId", "versionNum") DO NOTHING;
|
|
59
|
+
|
|
60
|
+
-- ── UPDATE: only snapshot if a meaningful field changed ────────────────────
|
|
61
|
+
ELSIF TG_OP = 'UPDATE' THEN
|
|
62
|
+
-- Skip if none of the tracked fields changed.
|
|
63
|
+
IF (
|
|
64
|
+
OLD."title" IS NOT DISTINCT FROM NEW."title" AND
|
|
65
|
+
OLD."steps" IS NOT DISTINCT FROM NEW."steps" AND
|
|
66
|
+
OLD."preconditions" IS NOT DISTINCT FROM NEW."preconditions" AND
|
|
67
|
+
OLD."expectedResult" IS NOT DISTINCT FROM NEW."expectedResult" AND
|
|
68
|
+
OLD."kind" IS NOT DISTINCT FROM NEW."kind" AND
|
|
69
|
+
OLD."priority" IS NOT DISTINCT FROM NEW."priority"
|
|
70
|
+
) THEN
|
|
71
|
+
RETURN NEW;
|
|
72
|
+
END IF;
|
|
73
|
+
|
|
74
|
+
-- Compute next version number.
|
|
75
|
+
SELECT COALESCE(MAX("versionNum"), 0) + 1
|
|
76
|
+
INTO v_next_num
|
|
77
|
+
FROM "TestCaseVersion"
|
|
78
|
+
WHERE "testCaseId" = NEW."id";
|
|
79
|
+
|
|
80
|
+
INSERT INTO "TestCaseVersion" (
|
|
81
|
+
"id", "testCaseId", "versionNum",
|
|
82
|
+
"title", "steps", "preconditions", "expectedResult", "kind", "priority",
|
|
83
|
+
"snapshot", "tenantId", "createdAt"
|
|
84
|
+
) VALUES (
|
|
85
|
+
gen_random_uuid()::text,
|
|
86
|
+
NEW."id",
|
|
87
|
+
v_next_num,
|
|
88
|
+
NEW."title",
|
|
89
|
+
NEW."steps",
|
|
90
|
+
NEW."preconditions",
|
|
91
|
+
NEW."expectedResult",
|
|
92
|
+
NEW."kind",
|
|
93
|
+
NEW."priority",
|
|
94
|
+
row_to_json(NEW),
|
|
95
|
+
NEW."tenantId",
|
|
96
|
+
NOW()
|
|
97
|
+
)
|
|
98
|
+
ON CONFLICT ("testCaseId", "versionNum") DO NOTHING;
|
|
99
|
+
END IF;
|
|
100
|
+
|
|
101
|
+
RETURN NEW;
|
|
102
|
+
END;
|
|
103
|
+
$$;
|
|
104
|
+
|
|
105
|
+
-- ── Attach trigger to TestCase ───────────────────────────────────────────────
|
|
106
|
+
DROP TRIGGER IF EXISTS trg_testcase_auto_version ON "TestCase";
|
|
107
|
+
|
|
108
|
+
CREATE TRIGGER trg_testcase_auto_version
|
|
109
|
+
AFTER INSERT OR UPDATE ON "TestCase"
|
|
110
|
+
FOR EACH ROW
|
|
111
|
+
EXECUTE FUNCTION trg_testcase_auto_version();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- Traceability & alignment gap closure
|
|
2
|
+
-- 1. Many-to-many requirement links for test cases
|
|
3
|
+
ALTER TABLE "TestCase" ADD COLUMN IF NOT EXISTS "traceToExtra" JSONB NOT NULL DEFAULT '[]';
|
|
4
|
+
|
|
5
|
+
-- 2. Deterministic step coverage persisted next to the AI alignment score
|
|
6
|
+
ALTER TABLE "AlignmentResult" ADD COLUMN IF NOT EXISTS "stepCoveragePct" DOUBLE PRECISION;
|
|
7
|
+
ALTER TABLE "AlignmentResult" ADD COLUMN IF NOT EXISTS "stepCoverage" JSONB;
|
|
8
|
+
|
|
9
|
+
-- 3. External (Jira) metadata & change audit log on requirements
|
|
10
|
+
ALTER TABLE "Requirement" ADD COLUMN IF NOT EXISTS "externalMeta" JSONB;
|
|
11
|
+
ALTER TABLE "Requirement" ADD COLUMN IF NOT EXISTS "changeLog" JSONB DEFAULT '[]';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
-- Context Intelligence Platform P1-P7
|
|
2
|
+
-- AlterTable Project
|
|
3
|
+
ALTER TABLE "Project" ADD COLUMN IF NOT EXISTS "projectKind" TEXT NOT NULL DEFAULT 'WEB';
|
|
4
|
+
ALTER TABLE "Project" ADD COLUMN IF NOT EXISTS "contextSources" JSONB NOT NULL DEFAULT '{}';
|
|
5
|
+
ALTER TABLE "Project" ADD COLUMN IF NOT EXISTS "contextScore" INTEGER NOT NULL DEFAULT 0;
|
|
6
|
+
ALTER TABLE "Project" ADD COLUMN IF NOT EXISTS "contextPhase" TEXT NOT NULL DEFAULT 'PENDING_CONTEXT';
|
|
7
|
+
ALTER TABLE "Project" ADD COLUMN IF NOT EXISTS "contextSourceRequirements" JSONB NOT NULL DEFAULT '{}';
|
|
8
|
+
ALTER TABLE "Project" ADD COLUMN IF NOT EXISTS "approvalGateSummary" JSONB;
|
|
9
|
+
-- AlterTable Screen
|
|
10
|
+
ALTER TABLE "Screen" ADD COLUMN IF NOT EXISTS "figmaNodeId" TEXT;
|
|
11
|
+
-- AlterTable TestCase
|
|
12
|
+
ALTER TABLE "TestCase" ADD COLUMN IF NOT EXISTS "sourceEnhancementId" TEXT;
|
|
13
|
+
ALTER TABLE "TestCase" ADD COLUMN IF NOT EXISTS "contextQualityScore" INTEGER;
|
|
14
|
+
ALTER TABLE "TestCase" ADD COLUMN IF NOT EXISTS "crawlDiffId" TEXT;
|
|
15
|
+
-- AlterTable TestScript
|
|
16
|
+
ALTER TABLE "TestScript" ADD COLUMN IF NOT EXISTS "scriptContextSnapshot" JSONB;
|
|
17
|
+
-- AlterTable TestResult
|
|
18
|
+
ALTER TABLE "TestResult" ADD COLUMN IF NOT EXISTS "bugSignalId" TEXT;
|
|
19
|
+
-- AlterTable VisualDiff
|
|
20
|
+
ALTER TABLE "VisualDiff" ADD COLUMN IF NOT EXISTS "bugSignalVisualDiffId" TEXT;
|
|
21
|
+
-- CreateTable ContextEnhancement
|
|
22
|
+
CREATE TABLE IF NOT EXISTS "ContextEnhancement" ("id" TEXT NOT NULL,"tenantId" TEXT NOT NULL,"projectId" TEXT NOT NULL,"sourceType" TEXT NOT NULL,"sourceRef" TEXT,"crawlJobId" TEXT,"status" TEXT NOT NULL DEFAULT 'PENDING',"proposedChanges" JSONB NOT NULL DEFAULT '[]',"appliedAt" TIMESTAMP(3),"appliedBy" TEXT,"rejectedAt" TIMESTAMP(3),"rejectedBy" TEXT,"approvalRequestedAt" TIMESTAMP(3),"approvalRequestedBy" TEXT,"assignedReviewerId" TEXT,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT "ContextEnhancement_pkey" PRIMARY KEY ("id"));
|
|
23
|
+
CREATE INDEX IF NOT EXISTS "ContextEnhancement_tenantId_projectId_idx" ON "ContextEnhancement"("tenantId","projectId");
|
|
24
|
+
CREATE INDEX IF NOT EXISTS "ContextEnhancement_tenantId_projectId_status_idx" ON "ContextEnhancement"("tenantId","projectId","status");
|
|
25
|
+
CREATE INDEX IF NOT EXISTS "ContextEnhancement_tenantId_projectId_sourceType_idx" ON "ContextEnhancement"("tenantId","projectId","sourceType");
|
|
26
|
+
CREATE INDEX IF NOT EXISTS "ContextEnhancement_sourceRef_idx" ON "ContextEnhancement"("sourceRef");
|
|
27
|
+
-- CreateTable ExtractedElement
|
|
28
|
+
CREATE TABLE IF NOT EXISTS "ExtractedElement" ("id" TEXT NOT NULL,"tenantId" TEXT NOT NULL,"projectId" TEXT NOT NULL,"sourceEnhancementId" TEXT NOT NULL,"figmaComponentId" TEXT,"name" TEXT,"role" TEXT,"selector" TEXT,"confidence" DOUBLE PRECISION NOT NULL DEFAULT 0.5,"boundingBox" JSONB,"extractedFrom" TEXT NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT "ExtractedElement_pkey" PRIMARY KEY ("id"));
|
|
29
|
+
CREATE INDEX IF NOT EXISTS "ExtractedElement_tenantId_projectId_idx" ON "ExtractedElement"("tenantId","projectId");
|
|
30
|
+
CREATE INDEX IF NOT EXISTS "ExtractedElement_sourceEnhancementId_idx" ON "ExtractedElement"("sourceEnhancementId");
|
|
31
|
+
-- CreateTable ContextSourceApproval
|
|
32
|
+
CREATE TABLE IF NOT EXISTS "ContextSourceApproval" ("id" TEXT NOT NULL,"tenantId" TEXT NOT NULL,"projectId" TEXT NOT NULL,"sourceType" TEXT NOT NULL,"approvedBy" TEXT,"approvedAt" TIMESTAMP(3),"jobId" TEXT,"diffCount" INTEGER NOT NULL DEFAULT 0,"diffApprovedCount" INTEGER NOT NULL DEFAULT 0,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT "ContextSourceApproval_pkey" PRIMARY KEY ("id"));
|
|
33
|
+
CREATE INDEX IF NOT EXISTS "ContextSourceApproval_tenantId_projectId_idx" ON "ContextSourceApproval"("tenantId","projectId");
|
|
34
|
+
CREATE INDEX IF NOT EXISTS "ContextSourceApproval_tenantId_projectId_sourceType_idx" ON "ContextSourceApproval"("tenantId","projectId","sourceType");
|
|
35
|
+
-- CreateTable FigmaComponent
|
|
36
|
+
CREATE TABLE IF NOT EXISTS "FigmaComponent" ("id" TEXT NOT NULL,"tenantId" TEXT NOT NULL,"projectId" TEXT NOT NULL,"screenId" TEXT,"figmaNodeId" TEXT NOT NULL,"name" TEXT NOT NULL,"componentType" TEXT NOT NULL DEFAULT 'COMPONENT',"description" TEXT,"interactions" JSONB,"destinationScreenId" TEXT,"suggestedLocator" TEXT,"suggestedTestId" TEXT,"boundingBox" JSONB,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT "FigmaComponent_pkey" PRIMARY KEY ("id"));
|
|
37
|
+
CREATE INDEX IF NOT EXISTS "FigmaComponent_tenantId_projectId_idx" ON "FigmaComponent"("tenantId","projectId");
|
|
38
|
+
CREATE INDEX IF NOT EXISTS "FigmaComponent_screenId_idx" ON "FigmaComponent"("screenId");
|
|
39
|
+
CREATE INDEX IF NOT EXISTS "FigmaComponent_figmaNodeId_idx" ON "FigmaComponent"("figmaNodeId");
|
|
40
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "FigmaComponent_projectId_figmaNodeId_key" ON "FigmaComponent"("projectId","figmaNodeId");
|
|
41
|
+
-- CreateTable CrawlDiff
|
|
42
|
+
CREATE TABLE IF NOT EXISTS "CrawlDiff" ("id" TEXT NOT NULL,"tenantId" TEXT NOT NULL,"projectId" TEXT NOT NULL,"fromJobId" TEXT,"toJobId" TEXT NOT NULL,"fromScreenId" TEXT,"toScreenId" TEXT,"diffType" TEXT NOT NULL,"severity" TEXT NOT NULL DEFAULT 'MINOR',"description" TEXT,"beforeSnapshot" JSONB,"afterSnapshot" JSONB,"affectedTestCaseIds" JSONB NOT NULL DEFAULT '[]',"status" TEXT NOT NULL DEFAULT 'PENDING',"reviewedBy" TEXT,"reviewedAt" TIMESTAMP(3),"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT "CrawlDiff_pkey" PRIMARY KEY ("id"));
|
|
43
|
+
CREATE INDEX IF NOT EXISTS "CrawlDiff_tenantId_projectId_idx" ON "CrawlDiff"("tenantId","projectId");
|
|
44
|
+
CREATE INDEX IF NOT EXISTS "CrawlDiff_tenantId_projectId_status_idx" ON "CrawlDiff"("tenantId","projectId","status");
|
|
45
|
+
CREATE INDEX IF NOT EXISTS "CrawlDiff_toJobId_idx" ON "CrawlDiff"("toJobId");
|
|
46
|
+
CREATE INDEX IF NOT EXISTS "CrawlDiff_fromJobId_idx" ON "CrawlDiff"("fromJobId");
|
|
47
|
+
CREATE INDEX IF NOT EXISTS "CrawlDiff_severity_status_idx" ON "CrawlDiff"("severity","status");
|
|
48
|
+
-- CreateTable BugSignal
|
|
49
|
+
CREATE TABLE IF NOT EXISTS "BugSignal" ("id" TEXT NOT NULL,"tenantId" TEXT NOT NULL,"projectId" TEXT NOT NULL,"signalType" TEXT NOT NULL,"severity" TEXT NOT NULL DEFAULT 'MEDIUM',"title" TEXT NOT NULL,"description" TEXT,"sourceRef" JSONB NOT NULL DEFAULT '{}',"affectedTestCaseIds" JSONB NOT NULL DEFAULT '[]',"affectedRequirementIds" JSONB NOT NULL DEFAULT '[]',"status" TEXT NOT NULL DEFAULT 'OPEN',"resolution" TEXT,"assignedTo" TEXT,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT "BugSignal_pkey" PRIMARY KEY ("id"));
|
|
50
|
+
CREATE INDEX IF NOT EXISTS "BugSignal_tenantId_projectId_idx" ON "BugSignal"("tenantId","projectId");
|
|
51
|
+
CREATE INDEX IF NOT EXISTS "BugSignal_tenantId_projectId_status_idx" ON "BugSignal"("tenantId","projectId","status");
|
|
52
|
+
CREATE INDEX IF NOT EXISTS "BugSignal_tenantId_projectId_signalType_idx" ON "BugSignal"("tenantId","projectId","signalType");
|
|
53
|
+
CREATE INDEX IF NOT EXISTS "BugSignal_tenantId_projectId_severity_idx" ON "BugSignal"("tenantId","projectId","severity");
|
|
54
|
+
CREATE INDEX IF NOT EXISTS "BugSignal_assignedTo_idx" ON "BugSignal"("assignedTo");
|
|
55
|
+
-- CreateTable RequirementCoverage
|
|
56
|
+
CREATE TABLE IF NOT EXISTS "RequirementCoverage" ("id" TEXT NOT NULL,"tenantId" TEXT NOT NULL,"projectId" TEXT NOT NULL,"requirementId" TEXT NOT NULL,"testCaseIds" JSONB NOT NULL DEFAULT '[]',"coverageScore" DOUBLE PRECISION NOT NULL DEFAULT 0,"uncoveredAcIds" JSONB NOT NULL DEFAULT '[]',"computedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,CONSTRAINT "RequirementCoverage_pkey" PRIMARY KEY ("id"));
|
|
57
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "RequirementCoverage_projectId_requirementId_key" ON "RequirementCoverage"("projectId","requirementId");
|
|
58
|
+
CREATE INDEX IF NOT EXISTS "RequirementCoverage_tenantId_projectId_idx" ON "RequirementCoverage"("tenantId","projectId");
|
|
59
|
+
CREATE INDEX IF NOT EXISTS "RequirementCoverage_tenantId_projectId_coverageScore_idx" ON "RequirementCoverage"("tenantId","projectId","coverageScore");
|
|
60
|
+
-- AddForeignKeys
|
|
61
|
+
ALTER TABLE "ContextEnhancement" ADD CONSTRAINT "ContextEnhancement_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
62
|
+
ALTER TABLE "ExtractedElement" ADD CONSTRAINT "ExtractedElement_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
63
|
+
ALTER TABLE "ExtractedElement" ADD CONSTRAINT "ExtractedElement_sourceEnhancementId_fkey" FOREIGN KEY ("sourceEnhancementId") REFERENCES "ContextEnhancement"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
64
|
+
ALTER TABLE "ExtractedElement" ADD CONSTRAINT "ExtractedElement_figmaComponentId_fkey" FOREIGN KEY ("figmaComponentId") REFERENCES "FigmaComponent"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
65
|
+
ALTER TABLE "ContextSourceApproval" ADD CONSTRAINT "ContextSourceApproval_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
66
|
+
ALTER TABLE "FigmaComponent" ADD CONSTRAINT "FigmaComponent_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
67
|
+
ALTER TABLE "FigmaComponent" ADD CONSTRAINT "FigmaComponent_screenId_fkey" FOREIGN KEY ("screenId") REFERENCES "Screen"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
68
|
+
ALTER TABLE "CrawlDiff" ADD CONSTRAINT "CrawlDiff_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
69
|
+
ALTER TABLE "CrawlDiff" ADD CONSTRAINT "CrawlDiff_fromScreenId_fkey" FOREIGN KEY ("fromScreenId") REFERENCES "Screen"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
70
|
+
ALTER TABLE "CrawlDiff" ADD CONSTRAINT "CrawlDiff_toScreenId_fkey" FOREIGN KEY ("toScreenId") REFERENCES "Screen"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
71
|
+
ALTER TABLE "BugSignal" ADD CONSTRAINT "BugSignal_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
72
|
+
ALTER TABLE "RequirementCoverage" ADD CONSTRAINT "RequirementCoverage_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
73
|
+
ALTER TABLE "TestCase" ADD CONSTRAINT "TestCase_sourceEnhancementId_fkey" FOREIGN KEY ("sourceEnhancementId") REFERENCES "ContextEnhancement"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
74
|
+
ALTER TABLE "TestCase" ADD CONSTRAINT "TestCase_crawlDiffId_fkey" FOREIGN KEY ("crawlDiffId") REFERENCES "CrawlDiff"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
75
|
+
ALTER TABLE "TestResult" ADD CONSTRAINT "TestResult_bugSignalId_fkey" FOREIGN KEY ("bugSignalId") REFERENCES "BugSignal"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
|
76
|
+
ALTER TABLE "VisualDiff" ADD CONSTRAINT "VisualDiff_bugSignalVisualDiffId_fkey" FOREIGN KEY ("bugSignalVisualDiffId") REFERENCES "BugSignal"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|