mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-27 16:55:06 +00:00
MINOR: move constraint update from schemaChanges to postDataMigration (#17801)
* fix: move constraint update from schemaChanges to postDataMigration * fix: move index after column is created
This commit is contained in:
parent
f4d0eba08f
commit
aa399dfd68
@ -4,4 +4,13 @@ INNER JOIN test_case tc ON dqdts.entityFQNHash = tc.fqnHash
|
|||||||
SET dqdts.json = JSON_SET(dqdts.json,
|
SET dqdts.json = JSON_SET(dqdts.json,
|
||||||
'$.testCaseFQN', tc.json->'$.fullyQualifiedName',
|
'$.testCaseFQN', tc.json->'$.fullyQualifiedName',
|
||||||
'$.id', (SELECT UUID())
|
'$.id', (SELECT UUID())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- Add id column to data_quality_data_time_series table
|
||||||
|
-- after we have added the id values to the records
|
||||||
|
ALTER TABLE data_quality_data_time_series
|
||||||
|
ADD COLUMN id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL,
|
||||||
|
ADD CONSTRAINT UNIQUE (id);
|
||||||
|
|
||||||
|
-- Create index on id column
|
||||||
|
CREATE INDEX data_quality_data_time_series_id_index ON data_quality_data_time_series (id);
|
||||||
@ -1,5 +0,0 @@
|
|||||||
ALTER TABLE data_quality_data_time_series
|
|
||||||
ADD COLUMN id VARCHAR(36) GENERATED ALWAYS AS (json ->> '$.id') STORED NOT NULL,
|
|
||||||
ADD CONSTRAINT UNIQUE (id);
|
|
||||||
|
|
||||||
CREATE INDEX data_quality_data_time_series_id_index ON data_quality_data_time_series (id);
|
|
||||||
@ -6,3 +6,12 @@ SET json = jsonb_set(
|
|||||||
)
|
)
|
||||||
FROM test_case tc
|
FROM test_case tc
|
||||||
WHERE dqdts.entityfqnHash = tc.fqnHash;
|
WHERE dqdts.entityfqnHash = tc.fqnHash;
|
||||||
|
|
||||||
|
-- Add id column to data_quality_data_time_series table
|
||||||
|
-- after we have added the id values to the records
|
||||||
|
ALTER TABLE data_quality_data_time_series
|
||||||
|
ADD COLUMN id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED,
|
||||||
|
ADD CONSTRAINT id_unique UNIQUE (id);
|
||||||
|
|
||||||
|
-- Create index on id column
|
||||||
|
CREATE INDEX IF NOT EXISTS data_quality_data_time_series_id_index ON data_quality_data_time_series (id);
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
ALTER TABLE data_quality_data_time_series
|
|
||||||
ADD COLUMN id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED,
|
|
||||||
ADD CONSTRAINT id_unique UNIQUE (id);
|
|
||||||
|
|
||||||
CREATE INDEX IF NOT EXISTS data_quality_data_time_series_id_index ON data_quality_data_time_series (id);
|
|
||||||
Loading…
x
Reference in New Issue
Block a user