bug fix - Fixed error in cleanDatabase that would cause drift

Added an extra line to ensure the query does not include the migration table. This kept on getting cleared.

Reintroduced shadow db to detect drift.
This commit is contained in:
Aaron William Po
2023-05-07 23:32:34 -04:00
parent 301a2bb247
commit 8cda68503d
3 changed files with 16 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ const envSchema = z.object({
POSTGRES_PASSWORD: z.string(),
POSTGRES_DATABASE: z.string(),
POSTGRES_HOST: z.string(),
SHADOW_DATABASE_URL: z.string().url(),
NODE_ENV: z.enum(['development', 'production', 'test']),
SPARKPOST_API_KEY: z.string(),
@@ -187,6 +188,14 @@ export const POSTGRES_DATABASE = parsed.data.POSTGRES_DATABASE;
*/
export const POSTGRES_HOST = parsed.data.POSTGRES_HOST;
/**
* The URL of another PostgreSQL database to shadow.
*
* @example
* 'postgresql://user:password@host:5432/database';
*/
export const SHADOW_DATABASE_URL = parsed.data.SHADOW_DATABASE_URL;
/**
* Node environment.
*