2023-02-15 21:04:23 -08:00
|
|
|
-- Unique constraint for user email address
|
|
|
|
ALTER TABLE user_entity
|
2023-02-21 00:43:45 +05:30
|
|
|
ADD UNIQUE (email);
|
|
|
|
|
|
|
|
|
|
|
|
-- Remove classificationName in BigQuery
|
|
|
|
UPDATE dbservice_entity
|
2023-02-23 15:42:40 +05:30
|
|
|
SET json = JSON_REMOVE(json, '$.connection.config.classificationName') where serviceType in ('BigQuery');
|
|
|
|
|
|
|
|
-- migrate ingestAllDatabases in postgres
|
|
|
|
UPDATE dbservice_entity de2
|
|
|
|
SET json = JSON_REPLACE(
|
|
|
|
JSON_INSERT(json,
|
|
|
|
'$.connection.config.database',
|
|
|
|
(select JSON_EXTRACT(json, '$.name')
|
|
|
|
from database_entity de
|
|
|
|
where id = (select er.toId
|
|
|
|
from entity_relationship er
|
|
|
|
where er.fromId = de2.id
|
|
|
|
and er.toEntity = 'database'
|
|
|
|
LIMIT 1
|
|
|
|
))
|
|
|
|
), '$.connection.config.ingestAllDatabases',
|
|
|
|
true
|
|
|
|
)
|
|
|
|
where de2.serviceType = 'Postgres'
|
|
|
|
and JSON_EXTRACT(json, '$.connection.config.database') is NULL
|