-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/main' into forbid-t…
…rigger-system-app # Conflicts: # bootstrap/sql/migrations/native/1.5.0/mysql/postDataMigrationSQLScript.sql # bootstrap/sql/migrations/native/1.5.0/postgres/postDataMigrationSQLScript.sql
- Loading branch information
Showing
134 changed files
with
3,017 additions
and
1,590 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
bootstrap/sql/migrations/native/1.4.6/mysql/postDataMigrationSQLScript.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
-- Remove Duplicate Usernames and Lowercase Them | ||
WITH cte AS ( | ||
SELECT | ||
id, | ||
ROW_NUMBER() OVER (PARTITION BY LOWER(JSON_UNQUOTE(JSON_EXTRACT(json, '$.name'))) ORDER BY id) as rn | ||
FROM | ||
user_entity | ||
) | ||
DELETE FROM user_entity | ||
WHERE id IN ( | ||
SELECT id | ||
FROM cte | ||
WHERE rn > 1 | ||
); | ||
|
||
UPDATE user_entity | ||
SET json = JSON_SET( | ||
json, | ||
'$.name', | ||
LOWER(JSON_UNQUOTE(JSON_EXTRACT(json, '$.name'))) | ||
); | ||
|
||
-- Remove Duplicate Emails and Lowercase Them | ||
WITH cte AS ( | ||
SELECT | ||
id, | ||
ROW_NUMBER() OVER (PARTITION BY LOWER(JSON_UNQUOTE(JSON_EXTRACT(json, '$.email'))) ORDER BY id) as rn | ||
FROM | ||
user_entity | ||
) | ||
DELETE FROM user_entity | ||
WHERE id IN ( | ||
SELECT id | ||
FROM cte | ||
WHERE rn > 1 | ||
); | ||
|
||
UPDATE user_entity | ||
SET json = JSON_SET( | ||
json, | ||
'$.email', | ||
LOWER(JSON_UNQUOTE(JSON_EXTRACT(json, '$.email'))) | ||
); |
Empty file.
43 changes: 43 additions & 0 deletions
43
bootstrap/sql/migrations/native/1.4.6/postgres/postDataMigrationSQLScript.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
-- Remove Duplicate UserNames and lowercase them | ||
WITH cte AS ( | ||
SELECT | ||
id, | ||
ROW_NUMBER() OVER (PARTITION BY to_jsonb(LOWER(json->>'name')) ORDER BY id) as rn | ||
FROM | ||
user_entity | ||
) | ||
DELETE from user_entity | ||
WHERE id IN ( | ||
SELECT id | ||
FROM cte | ||
WHERE rn > 1 | ||
); | ||
|
||
UPDATE user_entity | ||
SET json = jsonb_set( | ||
json, | ||
'{name}', | ||
to_jsonb(LOWER(json->>'name')) | ||
); | ||
|
||
-- Remove Duplicate Emails and lowercase them | ||
WITH cte AS ( | ||
SELECT | ||
id, | ||
ROW_NUMBER() OVER (PARTITION BY to_jsonb(LOWER(json->>'email')) ORDER BY id) as rn | ||
FROM | ||
user_entity | ||
) | ||
DELETE from user_entity | ||
WHERE id IN ( | ||
SELECT id | ||
FROM cte | ||
WHERE rn > 1 | ||
); | ||
|
||
UPDATE user_entity | ||
SET json = jsonb_set( | ||
json, | ||
'{email}', | ||
to_jsonb(LOWER(json->>'email')) | ||
); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.