diff --git a/bootstrap/sql/migrations/native/1.7.0/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.7.0/postgres/schemaChanges.sql index 4df49a4f632..18e3d84aa98 100644 --- a/bootstrap/sql/migrations/native/1.7.0/postgres/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.7.0/postgres/schemaChanges.sql @@ -5,13 +5,13 @@ WHERE json->>'type' IS NOT NULL; -- Query Cost History Time Series CREATE TABLE query_cost_time_series ( id varchar(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL, - cost real GENERATED ALWAYS AS (json ->> 'cost') STORED NOT NULL, - count int GENERATED ALWAYS AS (json ->> 'count') STORED NOT NULL, + cost real GENERATED ALWAYS AS ((json ->> 'cost')::real) STORED NOT NULL, + count float GENERATED ALWAYS AS ((json ->> 'count')::float) STORED NOT NULL, timestamp bigint GENERATED ALWAYS AS ((json ->> 'timestamp')::bigint) STORED NOT NULL, jsonSchema varchar(256) NOT NULL, json jsonb NOT NULL, entityFQNHash varchar(768) COLLATE "C" DEFAULT NULL, - CONSTRAINT query_cost_unique_constraint UNIQUE (id, timestamp, entityFQNHash) + CONSTRAINT query_cost_unique_constraint UNIQUE (timestamp, entityFQNHash) ); CREATE INDEX IF NOT EXISTS query_cost_time_series_id on query_cost_time_series (id); CREATE INDEX IF NOT EXISTS query_cost_time_series_id_timestamp on test_case_resolution_status_time_series (id, timestamp); \ No newline at end of file diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java index 5a01ded0abe..07a559a31c7 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java @@ -5186,8 +5186,8 @@ public interface CollectionDAO { value = "INSERT INTO (entityFQNHash, jsonSchema, json) " + "VALUES (:entityFQNHash, :jsonSchema, (:json :: jsonb)) " - + "ON CONFLICT (entityFQNHash, timestamp)" - + "DO UPDATE SET" + + "ON CONFLICT (entityFQNHash, timestamp) " + + "DO UPDATE SET " + "json = EXCLUDED.json", connectionType = POSTGRES) void insertWithoutExtension( diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v170/Migration.java b/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v170/Migration.java index a0663349a94..b1bd7e9b6c6 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v170/Migration.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/migration/postgres/v170/Migration.java @@ -16,6 +16,7 @@ public class Migration extends MigrationProcessImpl { @Override @SneakyThrows public void runDataMigration() { + initializeWorkflowHandler(); updateGovernanceWorkflowDefinitions(); updateDataInsightsApplication(); }