style(quick-260613-ndv): prettier-format global-setup.ts
CI / changes (pull_request) Successful in 2s
CI / fast-checks (pull_request) Successful in 1m24s
CI / api (pull_request) Successful in 1m3s
CI / harness (pull_request) Successful in 4m9s
CI / security (pull_request) Successful in 39s
CI / gate (pull_request) Successful in 1s
CI / changes (pull_request) Successful in 2s
CI / fast-checks (pull_request) Successful in 1m24s
CI / api (pull_request) Successful in 1m3s
CI / harness (pull_request) Successful in 4m9s
CI / security (pull_request) Successful in 39s
CI / gate (pull_request) Successful in 1s
This commit is contained in:
@@ -64,14 +64,10 @@ export default async function setup(): Promise<void> {
|
|||||||
// Try @'%' first (Docker/network access); fall back to @'localhost' if the user was
|
// Try @'%' first (Docker/network access); fall back to @'localhost' if the user was
|
||||||
// created with a localhost host qualifier.
|
// created with a localhost host qualifier.
|
||||||
try {
|
try {
|
||||||
await rootConn.query(
|
await rootConn.query(`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'%'`);
|
||||||
`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'%'`,
|
|
||||||
);
|
|
||||||
} catch {
|
} catch {
|
||||||
// If @'%' fails (user only exists as @'localhost'), try that form.
|
// If @'%' fails (user only exists as @'localhost'), try that form.
|
||||||
await rootConn.query(
|
await rootConn.query(`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'localhost'`);
|
||||||
`GRANT ALL PRIVILEGES ON \`${TEST_DB}\`.* TO '${appUser}'@'localhost'`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await rootConn.query('FLUSH PRIVILEGES');
|
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
|
// construct({ client, mode }, undefined) and the session client becomes
|
||||||
// the plain config object (no .query()). The two-arg form is safe.
|
// the plain config object (no .query()). The two-arg form is safe.
|
||||||
const db = drizzle(appPool, { mode: 'default' });
|
const db = drizzle(appPool, { mode: 'default' });
|
||||||
const migrationsFolder = fileURLToPath(
|
const migrationsFolder = fileURLToPath(new URL('../src/db/migrations', import.meta.url));
|
||||||
new URL('../src/db/migrations', import.meta.url),
|
|
||||||
);
|
|
||||||
await migrate(db, { migrationsFolder });
|
await migrate(db, { migrationsFolder });
|
||||||
|
|
||||||
// Clean slate each run: truncate every table (except drizzle's migration
|
// Clean slate each run: truncate every table (except drizzle's migration
|
||||||
|
|||||||
Reference in New Issue
Block a user