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>
This commit is contained in:
Teddy 2022-09-20 08:14:29 +02:00 committed by GitHub
parent 1128d4847d
commit e22036cc09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 22 deletions

View File

@ -116,12 +116,3 @@ 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;
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 JSON NOT NULL,
expiryDate BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.expiryDate') NOT NULL,
PRIMARY KEY (token)
);

View File

@ -0,0 +1,15 @@
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 JSON NOT NULL,
expiryDate BIGINT UNSIGNED GENERATED ALWAYS AS (json ->> '$.expiryDate') NOT NULL,
PRIMARY KEY (token)
);

View File

@ -110,13 +110,4 @@ 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;
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)
);
ALTER TABLE role_entity DROP COLUMN defaultRole;

View File

@ -0,0 +1,15 @@
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)
);

View File

@ -74,7 +74,7 @@
]
},
{
"result": "columnCount should not be None for TableColumnCountToEqual",
"result": "columnCount should not be None for tableColumnCountToEqual",
"testCaseStatus": "Aborted",
"testResultValues": [
{

View File

@ -9,7 +9,7 @@
"name": "table_column_count_equals",
"description": "test the number of column in table",
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address>",
"testDefinitionName": "TableColumnCountToEqual",
"testDefinitionName": "tableColumnCountToEqual",
"parameterValues": [
{
"name": "columnCount",
@ -21,7 +21,7 @@
"name": "table_column_count_between",
"description": "test the number of column in table is between x and y",
"entityLink": "<#E::table::sample_data.ecommerce_db.shopify.dim_address>",
"testDefinitionName": "TableColumnCountToBeBetween",
"testDefinitionName": "tableColumnCountToBeBetween",
"parameterValues": [
{
"name": "minColValue",