From f67f65b47bad17eb2b47bd9aa3234ceb491ba066 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 28 Jun 2025 19:33:16 +0200 Subject: [PATCH] rollback mysql8 changes --- .github/workflows/test_e2e.yml | 23 ++++--------------- backend/.env.test_e2e | 7 ------ database/.env.test_e2e | 7 ------ .../migrations/0003-login_server_tables.ts | 2 +- .../0010-login_users_state_users_sync.ts | 22 +++++++----------- .../migrations/0017-combine_user_tables.ts | 2 +- 6 files changed, 15 insertions(+), 48 deletions(-) delete mode 100644 database/.env.test_e2e diff --git a/.github/workflows/test_e2e.yml b/.github/workflows/test_e2e.yml index 1300aeda2..9691241cf 100644 --- a/.github/workflows/test_e2e.yml +++ b/.github/workflows/test_e2e.yml @@ -40,9 +40,8 @@ jobs: cd backend cp .env.test_e2e .env cd .. - bun turbo backend#build - bun turbo frontend#build - bun turbo backend#start frontend#start --env-mode=loose + bun turbo backend#build frontend#build --env-mode=loose + bun turbo backend#start frontend#start --env-mode=loose & - name: End-to-end tests | prepare run: | @@ -123,17 +122,8 @@ jobs: uses: oven-sh/setup-bun@v2 - name: Boot up test system | docker-compose mariadb mailserver - run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach mailserver + run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach mariadb mailserver - - name: Start mysql - run: | - sudo systemctl start mysql.service - sudo mysql -u root -proot < Promis \`first_name\` varchar(150) NOT NULL, \`last_name\` varchar(255) DEFAULT '', \`username\` varchar(255) DEFAULT '', - \`description\` text DEFAULT NULL, + \`description\` text DEFAULT '', \`password\` bigint unsigned DEFAULT '0', \`pubkey\` binary(32) DEFAULT NULL, \`privkey\` binary(80) DEFAULT NULL, diff --git a/database/migration/migrations/0010-login_users_state_users_sync.ts b/database/migration/migrations/0010-login_users_state_users_sync.ts index b5a0579a4..1c326db54 100644 --- a/database/migration/migrations/0010-login_users_state_users_sync.ts +++ b/database/migration/migrations/0010-login_users_state_users_sync.ts @@ -29,20 +29,14 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis // 18 entries await queryFn( `DELETE FROM state_users - WHERE id IN ( - SELECT id FROM ( - SELECT id FROM state_users - WHERE public_key NOT IN ( - SELECT pubkey FROM login_users - WHERE pubkey IS NOT NULL - ) - AND email IN ( - SELECT email FROM state_users - GROUP BY email - HAVING COUNT(*) > 1 - ) - ) AS subquery - )`, + WHERE id IN + (SELECT state_users.id FROM state_users + WHERE public_key NOT IN + (SELECT pubkey FROM login_users + WHERE pubkey IS NOT NULL) + AND email IN (SELECT email FROM state_users GROUP BY email HAVING COUNT(*) > 1 + ) + )`, ) } diff --git a/database/migration/migrations/0017-combine_user_tables.ts b/database/migration/migrations/0017-combine_user_tables.ts index 31e1ea2ee..351208b38 100644 --- a/database/migration/migrations/0017-combine_user_tables.ts +++ b/database/migration/migrations/0017-combine_user_tables.ts @@ -93,7 +93,7 @@ export async function downgrade(queryFn: (query: string, values?: any[]) => Prom \`first_name\` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, \`last_name\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', \`username\` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT '', - \`description\` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, + \`description\` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT '', \`password\` bigint(20) unsigned DEFAULT 0, \`pubkey\` binary(32) DEFAULT NULL, \`privkey\` binary(80) DEFAULT NULL,