OpenMetadata/bootstrap/sql/org.postgresql.Driver/v008__create_db_connection_info.sql
Suresh Srinivas ac157a8f0b
Fixes #9618 Allow apostrophe in entity names (#9642)
* Fixes #9618 Allow apostrophe in entity names

* Add support for space in entity names (with exception) and column names

* Add regex checks to entity names, table column names to allow only required characters

* fix: allowed characters in entityName

* Add all the allowed special characters in the entity name in tests

* Allow '&', '/', ':' only for the table

* Override basic entityName by defining entity specific entityName for Python code gen

* fix: dagster migration + json schema path

* fix: python style check

* Fix test failure

Co-authored-by: Teddy Crepineau <teddy.crepineau@gmail.com>
2023-01-17 11:34:29 -08:00

50 lines
1.6 KiB
SQL

ALTER TABLE tag_category
RENAME TO classification;
-- Rename tagCategoryName in BigQuery for classificationName
UPDATE dbservice_entity
SET json = jsonb_set(json, '{connection,config,classificationName}', json#>'{connection,config,tagCategoryName}')
where serviceType in ('BigQuery')
and json#>'{connection,config,tagCategoryName}' is not null;
-- Deprecate SampleData db service type
DELETE FROM entity_relationship er
USING dbservice_entity db
WHERE (db.id = er.fromId OR db.id = er.toId)
AND db.serviceType = 'SampleData';
DELETE FROM dbservice_entity WHERE serviceType = 'SampleData';
-- Delete supportsUsageExtraction from vertica
UPDATE dbservice_entity
SET json = json::jsonb #- '{connection,config,supportsUsageExtraction}'
WHERE serviceType = 'Vertica';
UPDATE ingestion_pipeline_entity
SET json = json::jsonb #- '{sourceConfig,config,dbtConfigSource,dbtUpdateDescriptions}'
WHERE json#>>'{sourceConfig,config,type}' = 'DBT';
UPDATE test_definition
SET json = jsonb_set(
json,
'{supportedDataTypes}',
'["NUMBER", "INT", "FLOAT", "DOUBLE", "DECIMAL", "TINYINT", "SMALLINT", "BIGINT", "BYTEINT", "TIMESTAMP", "TIMESTAMPZ","DATETIME", "DATE"]',
false
)
WHERE json->>'name' = 'columnValuesToBeBetween';
UPDATE pipeline_entity
SET json = jsonb_set(
json,
'{name}',
to_jsonb(replace(json ->> 'name',':',''))
)
WHERE json ->> 'serviceType' = 'Dagster';
UPDATE pipeline_entity
SET json = jsonb_set(
json,
'{fullyQualifiedName}',
to_jsonb(replace(json ->> 'fullyQualifiedName',':',''))
)
WHERE json ->> 'serviceType' = 'Dagster';