style(quick-260613-ndv): prettier-format global-setup.ts
CI / changes (pull_request) Successful in 2s
CI / fast-checks (pull_request) Successful in 1m21s
CI / api (pull_request) Successful in 59s
CI / harness (pull_request) Successful in 3m55s
CI / security (pull_request) Successful in 41s
CI / gate (pull_request) Successful in 2s

This commit is contained in:
Lucas Berger
2026-06-13 17:12:52 -04:00
parent 861d828f7d
commit 1d5d23a1e0
+3 -9
View File
@@ -64,14 +64,10 @@ export default async function setup(): Promise<void> {
// Try @'%' first (Docker/network access); fall back to @'localhost' if the user was
// created with a localhost host qualifier.
try {
await rootConn.query(
`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'%'`,
);
await rootConn.query(`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'%'`);
} catch {
// If @'%' fails (user only exists as @'localhost'), try that form.
await rootConn.query(
`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'localhost'`,
);
await rootConn.query(`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'localhost'`);
}
await rootConn.query('FLUSH PRIVILEGES');
@@ -101,9 +97,7 @@ export default async function setup(): Promise<void> {
// construct({ client, mode }, undefined) and the session client becomes
// the plain config object (no .query()). The two-arg form is safe.
const db = drizzle(appPool, { mode: 'default' });
const migrationsFolder = fileURLToPath(
new URL('../src/db/migrations', import.meta.url),
);
const migrationsFolder = fileURLToPath(new URL('../src/db/migrations', import.meta.url));
await migrate(db, { migrationsFolder });
// Clean slate each run: truncate every table (except drizzle's migration