mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-11 23:36:25 +00:00
Fix: PostgreSQL migration immutability issue with databaseSchemaHash … (#23606)
* Fix: PostgreSQL migration immutability issue with databaseSchemaHash column * Fix: PostgreSQL migration immutability issue with databaseSchemaHash column
This commit is contained in:
parent
b489112bdd
commit
92c30f2a0a
@ -50,22 +50,32 @@ CREATE INDEX IF NOT EXISTS idx_notification_template_provider ON notification_te
|
||||
|
||||
-- Optimize table listing queries by indexing the schema hash prefix
|
||||
ALTER TABLE table_entity
|
||||
ADD COLUMN databaseSchemaHash VARCHAR(768)
|
||||
ADD COLUMN IF NOT EXISTS databaseSchemaHash VARCHAR(768)
|
||||
GENERATED ALWAYS AS (
|
||||
concat_ws('.', split_part(fqnhash, '.', 1), split_part(fqnhash, '.', 2), split_part(fqnhash, '.', 3))
|
||||
rtrim(
|
||||
split_part(fqnhash, '.', 1) || '.' ||
|
||||
split_part(fqnhash, '.', 2) || '.' ||
|
||||
split_part(fqnhash, '.', 3),
|
||||
'.'
|
||||
)
|
||||
) STORED;
|
||||
|
||||
CREATE INDEX idx_table_entity_schema_listing
|
||||
CREATE INDEX IF NOT EXISTS idx_table_entity_schema_listing
|
||||
ON table_entity (deleted, databaseSchemaHash, name, id);
|
||||
|
||||
-- Optimize stored procedure listing queries by indexing the schema hash prefix
|
||||
ALTER TABLE stored_procedure_entity
|
||||
ADD COLUMN databaseSchemaHash VARCHAR(768)
|
||||
ADD COLUMN IF NOT EXISTS databaseSchemaHash VARCHAR(768)
|
||||
GENERATED ALWAYS AS (
|
||||
concat_ws('.', split_part(fqnhash, '.', 1), split_part(fqnhash, '.', 2), split_part(fqnhash, '.', 3))
|
||||
rtrim(
|
||||
split_part(fqnhash, '.', 1) || '.' ||
|
||||
split_part(fqnhash, '.', 2) || '.' ||
|
||||
split_part(fqnhash, '.', 3),
|
||||
'.'
|
||||
)
|
||||
) STORED;
|
||||
|
||||
DROP INDEX IF EXISTS idx_stored_procedure_entity_deleted_name_id;
|
||||
|
||||
CREATE INDEX idx_stored_procedure_schema_listing
|
||||
CREATE INDEX IF NOT EXISTS idx_stored_procedure_schema_listing
|
||||
ON stored_procedure_entity (deleted, databaseSchemaHash, name, id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user