OpenMetadata/bootstrap/sql/org.postgresql.Driver/v005__create_db_connection_info.sql
Teddy e22036cc09
Fixes #7504 Added migration steps to delete profiler pipeline from entity relationship (#7511)
* Added migration steps to delete profiler pipeline from entity relationship

* Added migration to remove rows from entity_relationship with profiler pipelines

* Fixed sample data TestDefinition name after renaming testDefinition

* Added user_tokens table to v005

Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com>
2022-09-20 08:14:29 +02:00

15 lines
573 B
SQL

DELETE FROM entity_relationship
WHERE toEntity = 'ingestionPipeline'
AND toId NOT IN (
SELECT DISTINCT id
FROM ingestion_pipeline_entity
);
CREATE TABLE IF NOT EXISTS user_tokens (
token VARCHAR(36) GENERATED ALWAYS AS (json ->> 'token') STORED NOT NULL,
userId VARCHAR(36) GENERATED ALWAYS AS (json ->> 'userId') STORED NOT NULL,
tokenType VARCHAR(50) GENERATED ALWAYS AS (json ->> 'tokenType') STORED NOT NULL,
json JSONB NOT NULL,
expiryDate BIGINT GENERATED ALWAYS AS ((json ->> 'expiryDate')::bigint) STORED NOT NULL,
PRIMARY KEY (token)
);