From cb7942f4b697fdc50904d4928b0e421f6410c54b Mon Sep 17 00:00:00 2001 From: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Date: Tue, 28 Jan 2025 19:22:33 +0530 Subject: [PATCH] Cleanup App data (#19571) --- bootstrap/sql/migrations/native/1.6.3/mysql/schemaChanges.sql | 3 ++- .../sql/migrations/native/1.6.3/postgres/schemaChanges.sql | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap/sql/migrations/native/1.6.3/mysql/schemaChanges.sql b/bootstrap/sql/migrations/native/1.6.3/mysql/schemaChanges.sql index 1bd78fc4dc8..0c3231f17da 100644 --- a/bootstrap/sql/migrations/native/1.6.3/mysql/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.6.3/mysql/schemaChanges.sql @@ -2,4 +2,5 @@ ALTER TABLE apps_data_store ADD CONSTRAINT entity_relationship_pky PRIMARY KEY (identifier, type); UPDATE user_entity SET json = JSON_SET(json, '$.isBot', false) WHERE JSON_EXTRACT(json, '$.isBot') IS NULL; ALTER TABLE user_entity ADD COLUMN isBot BOOLEAN GENERATED ALWAYS AS (json -> '$.isBot') NOT NULL; -CREATE INDEX idx_isBot ON user_entity (isBot); \ No newline at end of file +CREATE INDEX idx_isBot ON user_entity (isBot); +DELETE from apps_data_store; \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.6.3/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.6.3/postgres/schemaChanges.sql index af2c924354d..cb734e7b0c6 100644 --- a/bootstrap/sql/migrations/native/1.6.3/postgres/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.6.3/postgres/schemaChanges.sql @@ -2,4 +2,5 @@ ALTER TABLE apps_data_store ADD CONSTRAINT entity_relationship_pky PRIMARY KEY (identifier, type); UPDATE user_entity SET json = jsonb_set(json::jsonb, '{isBot}', 'false'::jsonb, true) WHERE NOT (json ?? 'isBot'); ALTER TABLE user_entity ADD COLUMN isBot BOOLEAN GENERATED ALWAYS AS ((json ->> 'deleted')::boolean) STORED NOT NULL; -CREATE INDEX idx_isBot ON user_entity (isBot); \ No newline at end of file +CREATE INDEX idx_isBot ON user_entity (isBot); +DELETE from apps_data_store; \ No newline at end of file