OpenMetadata/bootstrap/sql/org.postgresql.Driver/v004__create_db_connection_info.sql

113 lines
4.8 KiB
MySQL
Raw Normal View History

Fixes #6133 - Add support for Team Hiearchy (#6134) * Adding different team types for supporting organization team hierarchy * Add support for team hierarchy * Create organization during initalization * Team hierachy test for POST methods * Add PUT and PATCH support for changing team hiearchy * Added tests for the team hiearchy feature * Restored v003 sql files and added v004 * Merge conflicts with main and adopt new JSON based configuration * Remove configuration Organization name to simplify user MUST do configurations * Snowflake Make Query tag Optional (#6114) * Snowflake make query tag optional * Modified Description * [Backend][UsageResource] Add PUT to enable updating Usage #6117 :::::: and allow adding space to tagCAtegory and Tags (#6119) * [Backend][UsageResource] Add PUT to enable updating Usage #6117 * [Backend][UsageResource] Allow space in tags category and primary tags #6121 * [Backend][UsageResource] Update in more genric way to make use of space in resourcePath * ui changes for allowing space in tag and tag category name * [Backend][Improvement]add test for put and post Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> * Adding different team types for supporting organization team hierarchy * Add support for team hierarchy * Create organization during initalization * Team hierachy test for POST methods * Add PUT and PATCH support for changing team hiearchy * Added tests for the team hiearchy feature * Restored v003 sql files and added v004 * Merge conflicts with main and adopt new JSON based configuration * Remove configuration Organization name to simplify user MUST do configurations * Python jsonSchema code generation not respecting defaults * fixed failing cypress Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: mohitdeuex <105265192+mohitdeuex@users.noreply.github.com> Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> Co-authored-by: Sriharsha Chintalapani <harsha@getcollate.io>
2022-07-19 11:10:52 -07:00
UPDATE team_entity
SET json = JSONB_SET(json, '{teamType}', '"Group"', true);
Fixes #6133 - Add support for Team Hiearchy (#6134) * Adding different team types for supporting organization team hierarchy * Add support for team hierarchy * Create organization during initalization * Team hierachy test for POST methods * Add PUT and PATCH support for changing team hiearchy * Added tests for the team hiearchy feature * Restored v003 sql files and added v004 * Merge conflicts with main and adopt new JSON based configuration * Remove configuration Organization name to simplify user MUST do configurations * Snowflake Make Query tag Optional (#6114) * Snowflake make query tag optional * Modified Description * [Backend][UsageResource] Add PUT to enable updating Usage #6117 :::::: and allow adding space to tagCAtegory and Tags (#6119) * [Backend][UsageResource] Add PUT to enable updating Usage #6117 * [Backend][UsageResource] Allow space in tags category and primary tags #6121 * [Backend][UsageResource] Update in more genric way to make use of space in resourcePath * ui changes for allowing space in tag and tag category name * [Backend][Improvement]add test for put and post Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> * Adding different team types for supporting organization team hierarchy * Add support for team hierarchy * Create organization during initalization * Team hierachy test for POST methods * Add PUT and PATCH support for changing team hiearchy * Added tests for the team hiearchy feature * Restored v003 sql files and added v004 * Merge conflicts with main and adopt new JSON based configuration * Remove configuration Organization name to simplify user MUST do configurations * Python jsonSchema code generation not respecting defaults * fixed failing cypress Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: mohitdeuex <105265192+mohitdeuex@users.noreply.github.com> Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> Co-authored-by: Sriharsha Chintalapani <harsha@getcollate.io>
2022-07-19 11:10:52 -07:00
ALTER TABLE team_entity
ADD teamType VARCHAR(64) GENERATED ALWAYS AS (json ->> 'teamType') STORED NOT NULL;
UPDATE dbservice_entity
SET json = json::jsonb #- '{connection,config,database}'
where serviceType = 'DynamoDB';
UPDATE dbservice_entity
SET json = json::jsonb #- '{connection,config,connectionOptions}'
where serviceType = 'DeltaLake';
UPDATE dbservice_entity
SET json = json::jsonb #- '{connection,config,supportsProfiler}'
where serviceType = 'DeltaLake';
UPDATE dashboard_service_entity
SET json = jsonb_set(json, '{connection,config,clientId}', json#>'{connection,config,username}')
WHERE serviceType = 'Looker'
and json#>'{connection,config,username}' is not null;
UPDATE dashboard_service_entity
SET json = jsonb_set(json, '{connection,config,clientSecret}', json#>'{connection,config,password}')
WHERE serviceType = 'Looker'
and json#>'{connection,config,password}' is not null;
UPDATE dashboard_service_entity
SET json = json::jsonb #- '{connection,config,username}' #- '{connection,config,password}' #- '{connection,config,env}'
WHERE serviceType = 'Looker';
CREATE TABLE IF NOT EXISTS test_definition (
id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL,
name VARCHAR(256) GENERATED ALWAYS AS (json ->> 'name') STORED NOT NULL,
json JSONB NOT NULL,
entityType VARCHAR(36) GENERATED ALWAYS AS (json ->> 'entityType') STORED 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,
UNIQUE (name)
);
CREATE TABLE IF NOT EXISTS test_suite (
id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED 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,
UNIQUE (name)
);
CREATE TABLE IF NOT EXISTS test_case (
id VARCHAR(36) GENERATED ALWAYS AS (json ->> 'id') STORED NOT NULL,
fullyQualifiedName VARCHAR(512) GENERATED ALWAYS AS (json ->> 'fullyQualifiedName') STORED NOT NULL,
entityFQN VARCHAR (712) GENERATED ALWAYS AS (json ->> 'entityFQN') 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,
UNIQUE (fullyQualifiedName)
);
UPDATE webhook_entity
SET json = JSONB_SET(json::jsonb, '{webhookType}', '"generic"', true);
ALTER TABLE webhook_entity
ADD webhookType VARCHAR(36) GENERATED ALWAYS AS (json ->> 'webhookType') STORED NOT NULL;
CREATE TABLE IF NOT EXISTS entity_extension_time_series (
entityFQN VARCHAR(1024) NOT NULL, -- Entity FQN, we can refer to tables and columns
extension VARCHAR(256) NOT NULL, -- Extension name same as entity.fieldName
jsonSchema VARCHAR(256) NOT NULL, -- Schema used for generating JSON
json JSONB NOT NULL,
timestamp BIGINT GENERATED ALWAYS AS ((json ->> 'timestamp')::bigint) STORED NOT NULL
);
ALTER TABLE thread_entity
ADD announcementStart BIGINT GENERATED ALWAYS AS ((json#>'{announcement,startTime}')::bigint) STORED,
ADD announcementEnd BIGINT GENERATED ALWAYS AS ((json#>'{announcement,endTime}')::bigint) STORED;
UPDATE dbservice_entity
SET json = json::jsonb #- '{connection,config,databaseSchema}' #- '{connection,config,oracleServiceName}'
2022-08-19 14:11:53 +02:00
WHERE serviceType = 'Oracle';
UPDATE dbservice_entity
SET json = json::jsonb #- '{connection,config,hostPort}'
WHERE serviceType = 'Athena';
UPDATE dbservice_entity
SET json = json::jsonb #- '{connection,config,username}' #- '{connection,config,password}'
WHERE serviceType in ('Databricks');
CREATE TABLE IF NOT EXISTS openmetadata_settings (
id SERIAL NOT NULL ,
configType VARCHAR(36) NOT NULL,
json JSONB NOT NULL,
PRIMARY KEY (id, configType),
UNIQUE(configType)
);
DELETE FROM entity_extension
WHERE jsonSchema IN ('tableProfile', 'columnTest', 'tableTest');
DELETE FROM ingestion_pipeline_entity
WHERE json_extract_path_text("json", 'pipelineType') = 'profiler';
DELETE FROM role_entity;
DELETE FROM policy_entity;
DELETE FROM field_relationship WHERE fromType IN ('role', 'policy') OR toType IN ('role', 'policy');
DELETE FROM entity_relationship WHERE fromEntity IN ('role', 'policy') OR toEntity IN ('role', 'policy');
ALTER TABLE role_entity DROP COLUMN defaultRole;