Fix #5415 - Add migrations (#5767)

* Add migrations

* Migration Extension

* removed repeated code

Co-authored-by: ulixius9 <mayursingal9@gmail.com>
This commit is contained in:
Sriharsha Chintalapani 2022-06-30 06:10:26 -07:00 committed by GitHub
parent 9a1647c255
commit d42783fbe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,3 +43,35 @@ ADD INDEX updated_at_index (updatedAt);
CREATE TABLE task_sequence (id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)); CREATE TABLE task_sequence (id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (id));
INSERT INTO task_sequence VALUES (0); INSERT INTO task_sequence VALUES (0);
DELETE from ingestion_pipeline_entity where 1=1;
UPDATE dbservice_entity
SET json = JSON_INSERT(
JSON_REMOVE(json, '$.connection.config.database'),
'$.connection.config.databaseSchema',
JSON_EXTRACT(json, '$.connection.config.database')
) where serviceType in ('Mysql','Hive','Presto','Trino','Clickhouse','SingleStore','MariaDB','Db2','Oracle');
UPDATE dbservice_entity
SET json = JSON_REMOVE(json, '$.connection.config.database'
,'$.connection.config.username'
,'$.connection.config.projectId'
,'$.connection.config.database'
,'$.connection.config.enablePolicyTagImport')
WHERE serviceType = 'BigQuery';
UPDATE dbservice_entity
SET json = JSON_REMOVE(json, '$.connection.config.database')
WHERE serviceType in ('Athena','Databricks');
UPDATE dbservice_entity
SET json = JSON_REMOVE(json, '$.connection.config.supportsProfiler', '$.connection.config.pipelineServiceName')
WHERE serviceType = 'Glue';
UPDATE dashboard_service_entity
SET json = JSON_REMOVE(json, '$.connection.config.dbServiceName')
WHERE serviceType in ('Metabase','Superset','Tableau');
DELETE FROM pipeline_service_entity WHERE 1=1;