fix(db): remove the seeded test user from all environments

V1 inserted test@example.com / password123 everywhere, including prod. V5 deletes that row only when email and seed hash both match.
This commit is contained in:
lobo committed 2026-09-24 10:14:58 +02:00
1 parent 0f8c724556
commit 3b6acb2b34
2 files changed
+11

No files matched your search

@@ -0,0 +1,5 @@
-- V1 seeded test@example.com with the password 'password123' into every environment.
-- The hash check makes sure only that seed row goes; user_settings follows via ON DELETE CASCADE.
DELETE FROM users
WHERE email = 'test@example.com'
AND password = '$2a$10$3FApyf15qVEvFLEvl/d7aecSMZlslQdXiYlDgbOa4DfGWu4l0VCY.';
@@ -145,4 +145,10 @@ class UserRepositoryTest extends AbstractPersistenceTest {
assertThrows(UserNotFoundException.class, () -> userRepository.updateSettings(-1L, null, settings)); assertThrows(UserNotFoundException.class, () -> userRepository.updateSettings(-1L, null, settings));
} }
@Test
void migrations_LeaveNoSeededTestUser() {
// V1 seeded test@example.com with a known password; it must not exist after all migrations.
assertTrue(userRepository.findByEmail("test@example.com").isEmpty());
}
} }