-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Context center #27558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
harshach
wants to merge
95
commits into
main
Choose a base branch
from
context_center
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Context center #27558
Changes from 2 commits
Commits
Show all changes
95 commits
Select commit
Hold shift + click to select a range
f33a4af
Add Context Center: Migrate Knowledge Center , Images/ PDFs document …
harshach a1c2970
Add Context Center: Migrate Knowledge Center , Images/ PDFs document …
harshach 208b781
Merge remote-tracking branch 'origin/main' into context_center
harshach 7e94bd4
Address PR #27558 review comments
harshach b8458e2
Address copilot review comments on PR #27558
harshach 4d8c434
Use one filters aggregation for page hierarchy childrenCount
harshach e628f3d
Add allowedFields entries for contextFile, folder, page
harshach bede305
Fix ui checkstyle
harshach f616f2f
Fix Java checkstyle
harshach 198411b
Address PR #27558 copilot review round 2
harshach 80dfb35
Update generated TypeScript types
github-actions[bot] 4a75852
Address PR #27558 copilot review round 3
harshach 728711e
Fix UI checkstyle
harshach bc98df4
Address PR #27558 copilot review round 4
harshach fb36c9c
Update generated TypeScript types
github-actions[bot] ade5c1d
Fix UI checkstyle
harshach 549ee75
Merge remote-tracking branch 'origin/context_center' into context_center
harshach 5523bb1
Address PR #27558 copilot review round 5
harshach 5eec54d
Remove macOS-only @rollup/rollup-darwin-arm64 dev dep
harshach d93e44d
Re-declare optional SDK test deps on integration-tests classpath
harshach 53d4e71
Fix IT failures from CI integration-tests-mysql-elasticsearch
harshach 4e171d0
Document SDK test-utility optional deps
harshach a4a2dcc
NoOpAssetService: never return null from generateDownloadUrlWithExpiry
harshach f55a4f7
AssetServiceFactory: swap to NoOp when re-initialized with storage off
harshach f047cb4
Type create-request domains arrays as fullyQualifiedEntityName
harshach 7086bd4
Update generated TypeScript types
github-actions[bot] 7cc6847
Address PR #27558 copilot review 4144965142
harshach 89d4984
Address PR #27558 copilot review 4144917449
harshach 54e89b1
AssetService.read: run inline instead of hopping through AsyncService
harshach fd5ef8e
Address PR #27558 copilot review 4151211562
harshach 848f84a
Fix Java checkstyle
harshach 4f47d1d
Fix integration test compile + S3 generateDownloadURL
harshach be507cf
Revert MySQL deleted column back to bare json -> expression
harshach 32205bf
Fix Transi18next import path in KnowledgeCenter components
harshach ad90b0c
Harden ContextFileIT.testFileAppearsInSearch against async indexing
harshach 99c8073
Make playwright editor shortcuts platform-aware
harshach d87aaca
Run prettier on DateTimeUtils.ts
harshach 31cca40
Fix Knowledge Page entity-link + DAO filter regressions from the port
harshach 2e1c815
Merge remote-tracking branch 'origin/main' into context_center
harshach 535c402
Address remaining PR #27558 review feedback
harshach 396f22a
Add java-checkstyle skill for Claude + Codex agents
harshach bdf5409
Harden AttachmentResource upload/download against three regressions
harshach fab2cb3
Add ui-checkstyle skill + fix residual import-order drift
harshach 839c6ff
Merge branch 'main' into context_center
harshach e000225
Fix UI checkstyle on EntityUtilClassBase.ts
harshach 32ab0de
Merge remote-tracking branch 'origin/context_center' into context_center
harshach 85c3ffa
Merge branch 'main' into context_center
harshach ad90d5b
Merge branch 'main' into context_center
aniketkatkar97 b5565be
Merge branch 'main' into context_center
harshach f2e6ff5
Fix ContextFileIT.testFileAppearsInSearch flaky 500 from query_string…
harshach d54735e
Merge branch 'main' into context_center
aniketkatkar97 80a9103
Merge branch 'main' into context_center
harshach 4ee94e3
Merge branch 'main' into context_center
harshach 4d5e1b9
Merge branch 'main' into context_center
aniketkatkar97 18d6060
Fix knowledge center icon
aniketkatkar97 f0cca5f
update knowledge center to context center
aniketkatkar97 c1f6abb
Revert "update knowledge center to context center"
aniketkatkar97 43ec22d
Merge branch 'main' into context_center
harshach 5eb9000
Fix UI checkstyle: sort tag*-related imports in SearchClassBase
harshach 1846d71
Fix Jest coverage failures in KnowledgeCenter Layout and right panel
harshach 8de3b38
Merge branch 'main' into context_center
aniketkatkar97 872aa13
Fix playwright tests and bugs
aniketkatkar97 37f5249
Fix checkstyle
aniketkatkar97 deb9e76
Fix /knowledgeCenter/search/hierarchy 500 by removing _id sort
harshach aa8b7da
Cascade hard-delete to descendant pages in search index
harshach f0e9bc2
Add page/folder/contextFile/securityService to SearchIndexingApp picker
harshach b272de8
Restore live index settings on per-entity distributed-promote path
harshach 68dad61
Wire jobData into per-entity reindex promotion handler
harshach 37871a3
Fix delete failure
aniketkatkar97 e0ead9d
Fix java checkstyle
harshach f491dd2
Fix article deletion issue
aniketkatkar97 20f15eb
Merge branch 'main' into context_center
aniketkatkar97 ab0f531
refactor(test): streamline Knowledge Center List setup and teardown p…
aniketkatkar97 4161b32
Fix GlossaryTags
mohityadav766 48b41a7
Add missing pieces in knowledge articles
aniketkatkar97 094b595
Fix checkstyle
aniketkatkar97 e0b5d2b
Remove reviewer workflow spec
aniketkatkar97 abbbe28
Merge branch 'main' into context_center
aniketkatkar97 c8b8a80
remove unused util
aniketkatkar97 04892a9
Fix the localization changes
aniketkatkar97 73546b9
Fix unit tests
aniketkatkar97 749d638
Merge branch 'main' into context_center
harshach 6574368
Merge branch 'main' into context_center
aniketkatkar97 d413264
deleted unused svg
Rohit0301 971a93e
added missing svg
Rohit0301 08ce336
Merge branch 'main' into context_center
aniketkatkar97 d07eb08
Merge branch 'main' into context_center
harshach dc8b546
Merge branch 'main' into context_center
Rohit0301 a55a8a5
improved ux of save button & autofocus on title
harsh-vador c435be0
lint fixes
Rohit0301 e6522c7
Update page index
mohityadav766 9836f77
Make calculateFqnDepth static
mohityadav766 6dcf5a7
fixed the kc imports
Rohit0301 c9ac276
import fixes
Rohit0301 2f98d52
Merge branch 'main' into context_center
Rohit0301 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
156 changes: 155 additions & 1 deletion
156
bootstrap/sql/migrations/native/2.0.0/mysql/schemaChanges.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,155 @@ | ||
| -- MCP tables are created in 1.13.0 migration. This file is intentionally empty. | ||
| -- MCP tables are created in 1.13.0 migration. | ||
|
|
||
| -- Knowledge Center: page entity table (Article, QuickLink). | ||
| -- Existing Collate customers already have this table from 1.2.0-collate with | ||
| -- subsequent shape changes through 1.6.0-collate (nameHash -> fqnHash VARCHAR(756), | ||
| -- pageType generated column, composite deleted index). CREATE TABLE IF NOT EXISTS | ||
| -- is a no-op for them and creates the final shape for fresh OpenMetadata installs. | ||
| CREATE TABLE IF NOT EXISTS knowledge_center ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL, | ||
| fqnHash VARCHAR(756) NOT NULL COLLATE ascii_bin, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.name') NOT NULL, | ||
| json JSON NOT NULL, | ||
| updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted'), | ||
| pageType VARCHAR(16) GENERATED ALWAYS AS (json ->> '$.pageType') NOT NULL, | ||
| PRIMARY KEY (id), | ||
| UNIQUE (fqnHash), | ||
| INDEX knowledge_center_name_index (name), | ||
| INDEX index_knowledge_center_deleted (fqnHash, deleted) | ||
| ); | ||
|
|
||
| -- Context Center Drive: Folder entity table. | ||
| CREATE TABLE IF NOT EXISTS drive_folder ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.name') STORED NOT NULL, | ||
| nameHash VARCHAR(256) NOT NULL COLLATE ascii_bin, | ||
| json JSON NOT NULL, | ||
| updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') STORED NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted') STORED, | ||
| PRIMARY KEY (id), | ||
| UNIQUE KEY unique_drive_folder_name (nameHash), | ||
| INDEX idx_drive_folder_updated_at (updatedAt) | ||
| ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
|
|
||
| -- Context Center Drive: File entity table (uploaded PDF/image/spreadsheet/office docs). | ||
| CREATE TABLE IF NOT EXISTS context_file ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.name') STORED NOT NULL, | ||
| nameHash VARCHAR(256) NOT NULL COLLATE ascii_bin, | ||
| json JSON NOT NULL, | ||
| updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') STORED NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted') STORED, | ||
| PRIMARY KEY (id), | ||
| UNIQUE KEY unique_context_file_name (nameHash), | ||
| INDEX idx_context_file_updated_at (updatedAt) | ||
| ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
|
|
||
| -- Attachments: Asset entity table for uploaded file blobs referenced by ContextFiles, Pages, etc. | ||
| -- Existing Collate customers have this from 1.7.0-collate. CREATE TABLE IF NOT EXISTS is a no-op for them. | ||
| CREATE TABLE IF NOT EXISTS asset_entity ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.fileName') NOT NULL, | ||
| url VARCHAR(1024) GENERATED ALWAYS AS (json ->> '$.url') STORED NOT NULL, | ||
| fullyQualifiedName VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.fullyQualifiedName') NOT NULL, | ||
| assetType VARCHAR(100) GENERATED ALWAYS AS (json ->> '$.assetType') NOT NULL, | ||
| json JSON NOT NULL, | ||
| updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') NOT NULL, | ||
| fqnHash VARCHAR(768) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted'), | ||
| INDEX fqnhash_index (fqnHash), | ||
| INDEX asset_type_index (assetType), | ||
| INDEX idx_asset_deleted (deleted) | ||
| ); | ||
|
harshach marked this conversation as resolved.
|
||
|
|
||
| -- Context Center Drive: File content snapshot table (revisions, extracted text). | ||
| CREATE TABLE IF NOT EXISTS context_file_content ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.name') STORED NOT NULL, | ||
| nameHash VARCHAR(256) NOT NULL COLLATE ascii_bin, | ||
| json JSON NOT NULL, | ||
| updatedAt BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.updatedAt') STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.updatedBy') STORED NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS (json -> '$.deleted') STORED, | ||
| PRIMARY KEY (id), | ||
| UNIQUE KEY unique_context_file_content_name (nameHash), | ||
| INDEX idx_context_file_content_updated_at (updatedAt) | ||
| ) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
|
|
||
| -- Add tag_usage.metadata column if missing (newer tag usage payloads carry metadata). | ||
| SET @ddl = ( | ||
| SELECT IF( | ||
| EXISTS ( | ||
| SELECT 1 | ||
| FROM information_schema.columns | ||
| WHERE table_schema = DATABASE() | ||
| AND table_name = 'tag_usage' | ||
| AND column_name = 'metadata' | ||
| ), | ||
| 'SELECT 1', | ||
| 'ALTER TABLE tag_usage ADD COLUMN metadata JSON NULL' | ||
| ) | ||
| ); | ||
| PREPARE stmt FROM @ddl; | ||
| EXECUTE stmt; | ||
| DEALLOCATE PREPARE stmt; | ||
|
|
||
| -- Add audit_log_event.search_text column if missing (searchable audit log text). | ||
| SET @ddl = ( | ||
| SELECT IF( | ||
| EXISTS ( | ||
| SELECT 1 | ||
| FROM information_schema.columns | ||
| WHERE table_schema = DATABASE() | ||
| AND table_name = 'audit_log_event' | ||
| AND column_name = 'search_text' | ||
| ), | ||
| 'SELECT 1', | ||
| 'ALTER TABLE audit_log_event ADD COLUMN search_text LONGTEXT NULL' | ||
| ) | ||
| ); | ||
| PREPARE stmt FROM @ddl; | ||
| EXECUTE stmt; | ||
| DEALLOCATE PREPARE stmt; | ||
|
|
||
| -- Distributed reindex job tracking. | ||
| CREATE TABLE IF NOT EXISTS search_index_job ( | ||
| id VARCHAR(64) NOT NULL, | ||
| status VARCHAR(64) NOT NULL, | ||
| jobConfiguration JSON NOT NULL, | ||
| targetIndexPrefix VARCHAR(256) NOT NULL, | ||
| stagedIndexMapping JSON DEFAULT NULL, | ||
| totalRecords BIGINT NOT NULL DEFAULT 0, | ||
| processedRecords BIGINT NOT NULL DEFAULT 0, | ||
| successRecords BIGINT NOT NULL DEFAULT 0, | ||
| failedRecords BIGINT NOT NULL DEFAULT 0, | ||
| stats JSON NOT NULL, | ||
| createdBy VARCHAR(256) NOT NULL, | ||
| createdAt BIGINT NOT NULL, | ||
| startedAt BIGINT DEFAULT NULL, | ||
| completedAt BIGINT DEFAULT NULL, | ||
| updatedAt BIGINT NOT NULL, | ||
| errorMessage LONGTEXT DEFAULT NULL, | ||
| registrationDeadline BIGINT DEFAULT NULL, | ||
| registeredServerCount INT DEFAULT NULL, | ||
| PRIMARY KEY (id), | ||
| KEY idx_search_index_job_status_created_at (status, createdAt DESC) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
|
|
||
| -- Retry queue for failed search-index writes. | ||
| CREATE TABLE IF NOT EXISTS search_index_retry_queue ( | ||
| entityId VARCHAR(64) NOT NULL, | ||
| entityFqn VARCHAR(700) NOT NULL, | ||
| failureReason LONGTEXT DEFAULT NULL, | ||
| status VARCHAR(64) NOT NULL, | ||
| entityType VARCHAR(128) NOT NULL, | ||
| retryCount INT NOT NULL DEFAULT 0, | ||
| claimedAt TIMESTAMP NULL DEFAULT NULL, | ||
| PRIMARY KEY (entityId, entityFqn), | ||
| KEY idx_search_index_retry_queue_status (status), | ||
| KEY idx_search_index_retry_queue_claimed_at (claimedAt) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
131 changes: 130 additions & 1 deletion
131
bootstrap/sql/migrations/native/2.0.0/postgres/schemaChanges.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,130 @@ | ||
| -- MCP tables are created in 1.13.0 migration. This file is intentionally empty. | ||
| -- MCP tables are created in 1.13.0 migration. | ||
|
|
||
| -- Knowledge Center: page entity table (Article, QuickLink). | ||
| -- Existing Collate customers already have this table from 1.2.0-collate with | ||
| -- subsequent shape changes through 1.6.0-collate (nameHash -> fqnHash VARCHAR(756), | ||
| -- pageType generated column, composite deleted index). CREATE TABLE IF NOT EXISTS | ||
| -- is a no-op for them and creates the final shape for fresh OpenMetadata installs. | ||
| CREATE TABLE IF NOT EXISTS knowledge_center ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL, | ||
| fqnHash VARCHAR(756) NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL, | ||
| json JSONB NOT NULL, | ||
| updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED, | ||
|
harshach marked this conversation as resolved.
Outdated
|
||
| pageType VARCHAR(16) GENERATED ALWAYS AS (json ->> 'pageType') STORED NOT NULL, | ||
| PRIMARY KEY (id), | ||
| UNIQUE (fqnHash) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS knowledge_center_name_index ON knowledge_center (name); | ||
| CREATE INDEX IF NOT EXISTS index_knowledge_center_deleted ON knowledge_center (fqnHash, deleted); | ||
|
|
||
| -- Context Center Drive: Folder entity table. | ||
| CREATE TABLE IF NOT EXISTS drive_folder ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL, | ||
| nameHash VARCHAR(256) NOT NULL, | ||
| json JSONB NOT NULL, | ||
| updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED, | ||
|
harshach marked this conversation as resolved.
Outdated
|
||
| PRIMARY KEY (id), | ||
| UNIQUE (nameHash) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS idx_drive_folder_updated_at ON drive_folder (updatedAt); | ||
|
|
||
| -- Context Center Drive: File entity table (uploaded PDF/image/spreadsheet/office docs). | ||
| CREATE TABLE IF NOT EXISTS context_file ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL, | ||
| nameHash VARCHAR(256) NOT NULL, | ||
| json JSONB NOT NULL, | ||
| updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED, | ||
|
harshach marked this conversation as resolved.
Outdated
|
||
| PRIMARY KEY (id), | ||
| UNIQUE (nameHash) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS idx_context_file_updated_at ON context_file (updatedAt); | ||
|
|
||
| -- Attachments: Asset entity table for uploaded file blobs referenced by ContextFiles, Pages, etc. | ||
| -- Existing Collate customers have this from 1.7.0-collate. CREATE TABLE IF NOT EXISTS is a no-op for them. | ||
| CREATE TABLE IF NOT EXISTS asset_entity ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'fileName') STORED NOT NULL, | ||
| url VARCHAR(1024) GENERATED ALWAYS AS (json ->> 'url') STORED NOT NULL, | ||
| fullyQualifiedName VARCHAR(256) GENERATED ALWAYS AS (json ->> 'fullyQualifiedName') STORED NOT NULL, | ||
| assetType VARCHAR(100) GENERATED ALWAYS AS (json ->> 'assetType') STORED NOT NULL, | ||
| json JSONB NOT NULL, | ||
| updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL, | ||
| fqnHash VARCHAR(768) NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS (CAST(json ->> 'deleted' AS BOOLEAN)) STORED, | ||
|
harshach marked this conversation as resolved.
Outdated
|
||
| PRIMARY KEY (id) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS fqnhash_index ON asset_entity (fqnHash); | ||
| CREATE INDEX IF NOT EXISTS asset_type_index ON asset_entity (assetType); | ||
| CREATE INDEX IF NOT EXISTS idx_asset_deleted ON asset_entity (deleted); | ||
|
|
||
| -- Context Center Drive: File content snapshot table (revisions, extracted text). | ||
| CREATE TABLE IF NOT EXISTS context_file_content ( | ||
| id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL, | ||
| name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL, | ||
| nameHash VARCHAR(256) NOT NULL, | ||
| json JSONB NOT NULL, | ||
| updatedAt BIGINT GENERATED ALWAYS AS ((json ->> 'updatedAt')::bigint) STORED NOT NULL, | ||
| updatedBy VARCHAR(256) GENERATED ALWAYS AS (json ->> 'updatedBy') STORED NOT NULL, | ||
| deleted BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED, | ||
|
harshach marked this conversation as resolved.
Outdated
|
||
| PRIMARY KEY (id), | ||
| UNIQUE (nameHash) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS idx_context_file_content_updated_at ON context_file_content (updatedAt); | ||
|
|
||
| -- Add tag_usage.metadata column if missing (newer tag usage payloads carry metadata). | ||
| ALTER TABLE IF EXISTS tag_usage | ||
| ADD COLUMN IF NOT EXISTS metadata JSONB; | ||
|
|
||
| -- Add audit_log_event.search_text column if missing (searchable audit log text). | ||
| ALTER TABLE IF EXISTS audit_log_event | ||
| ADD COLUMN IF NOT EXISTS search_text TEXT; | ||
|
|
||
| -- Distributed reindex job tracking. | ||
| CREATE TABLE IF NOT EXISTS search_index_job ( | ||
| id VARCHAR(64) PRIMARY KEY, | ||
| status VARCHAR(64) NOT NULL, | ||
| jobConfiguration JSONB NOT NULL, | ||
| targetIndexPrefix VARCHAR(256) NOT NULL, | ||
| stagedIndexMapping JSONB NULL, | ||
| totalRecords BIGINT NOT NULL DEFAULT 0, | ||
| processedRecords BIGINT NOT NULL DEFAULT 0, | ||
| successRecords BIGINT NOT NULL DEFAULT 0, | ||
| failedRecords BIGINT NOT NULL DEFAULT 0, | ||
| stats JSONB NOT NULL DEFAULT '{}'::jsonb, | ||
| createdBy VARCHAR(256) NOT NULL, | ||
| createdAt BIGINT NOT NULL, | ||
| startedAt BIGINT NULL, | ||
| completedAt BIGINT NULL, | ||
| updatedAt BIGINT NOT NULL, | ||
| errorMessage TEXT NULL, | ||
| registrationDeadline BIGINT NULL, | ||
| registeredServerCount INTEGER NULL | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS idx_search_index_job_status_created_at | ||
| ON search_index_job (status, createdAt DESC); | ||
|
|
||
| -- Retry queue for failed search-index writes. | ||
| CREATE TABLE IF NOT EXISTS search_index_retry_queue ( | ||
| entityId VARCHAR(64) NOT NULL, | ||
| entityFqn VARCHAR(768) NOT NULL, | ||
| failureReason TEXT NULL, | ||
| status VARCHAR(64) NOT NULL, | ||
| entityType VARCHAR(128) NOT NULL, | ||
| retryCount INTEGER NOT NULL DEFAULT 0, | ||
| claimedAt TIMESTAMP NULL, | ||
| PRIMARY KEY (entityId, entityFqn) | ||
| ); | ||
| CREATE INDEX IF NOT EXISTS idx_search_index_retry_queue_status | ||
| ON search_index_retry_queue (status); | ||
| CREATE INDEX IF NOT EXISTS idx_search_index_retry_queue_claimed_at | ||
| ON search_index_retry_queue (claimedAt); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.