Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: replace migration rollback with drop schema

Scott Wilson9dc8ddaa88c2
diff --git a/backend/e2e-test/vitest-environment-knex.ts b/backend/e2e-test/vitest-environment-knex.ts
index 45121400b9..4cb18b3076 100644
--- a/backend/e2e-test/vitest-environment-knex.ts
+++ b/backend/e2e-test/vitest-environment-knex.ts
@@ -56,14 +56,9 @@ export default {
await redis.flushdb("SYNC");
try {
- await db.migrate.rollback(
- {
- directory: path.join(__dirname, "../src/db/migrations"),
- extension: "ts",
- tableName: "infisical_migrations"
- },
- true
- );
+ // called after all tests with this env have been run
+ await db.raw("DROP SCHEMA IF EXISTS public CASCADE");
+ await db.schema.createSchemaIfNotExists("public");
await db.migrate.latest({
directory: path.join(__dirname, "../src/db/migrations"),