* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* oauth fix

* rename migration

* migrations-extract

* translations

* unit test

* lint

---------

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.fritz.box>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.fritz.box>
Этот коммит содержится в:
Ben Cooke
2023-03-15 09:14:37 -04:00
коммит произвёл GitHub
родитель a14958096d
Коммит eb0bfd6f6d
14 изменённых файлов: 154 добавлений и 0 удалений

Просмотреть файл

@@ -208,6 +208,8 @@ db/migrations/mysql/000103_add_sentat_to_notifyadmin.down.sql
db/migrations/mysql/000103_add_sentat_to_notifyadmin.up.sql
db/migrations/mysql/000104_upgrade_notifyadmin.down.sql
db/migrations/mysql/000104_upgrade_notifyadmin.up.sql
db/migrations/mysql/000105_remove_tokens.down.sql
db/migrations/mysql/000105_remove_tokens.up.sql
db/migrations/postgres/000001_create_teams.down.sql
db/migrations/postgres/000001_create_teams.up.sql
db/migrations/postgres/000002_create_team_members.down.sql
@@ -416,3 +418,5 @@ db/migrations/postgres/000103_add_sentat_to_notifyadmin.down.sql
db/migrations/postgres/000103_add_sentat_to_notifyadmin.up.sql
db/migrations/postgres/000104_upgrade_notifyadmin.down.sql
db/migrations/postgres/000104_upgrade_notifyadmin.up.sql
db/migrations/postgres/000105_remove_tokens.down.sql
db/migrations/postgres/000105_remove_tokens.up.sql

Просмотреть файл

@@ -0,0 +1 @@
-- Skipping it because the forward migrations are destructive

Просмотреть файл

@@ -0,0 +1,4 @@
DELETE o, s from OAuthAccessData o
LEFT JOIN Preferences p ON o.clientid = p.name AND o.userid = p.userid AND p.category = 'oauth_app'
INNER JOIN Sessions s ON o.token = s.token
WHERE p.name IS NULL;

Просмотреть файл

@@ -0,0 +1 @@
-- Skipping it because the forward migrations are destructive

Просмотреть файл

@@ -0,0 +1,13 @@
DO $$
BEGIN
WITH oauthDelete AS (
DELETE FROM oauthaccessdata o
WHERE NOT EXISTS (
SELECT p.* FROM preferences p
WHERE o.clientid = p.name AND o.userid = p.userid AND p.category = 'oauth_app'
and p.name IS NULL
)
RETURNING o.token
)
DELETE FROM sessions s WHERE s.token in (select oauthDelete.token from oauthDelete);
END $$;