From ca21c5b6596bfd581ebae5f82c626d2c3f6d59e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20M=C3=B6rling?= Date: Wed, 13 May 2026 19:18:19 +0200 Subject: [PATCH] feat: add seed test user migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Flyway migration V2 that inserts a pre-seeded test user for manual testing. This avoids having to register a new account every time the environment is reset. - Email: test@bilhalsning.se - Password: test1234 - Password hash: bcrypt ($2b$12$) The migration uses a plain INSERT (no ON CONFLICT) since it runs on fresh databases only. H2-compatible — no PostgreSQL-specific syntax. To re-seed after deletion: docker compose down -v && docker compose up -d --- .../src/main/resources/db/migration/V2__seed_test_user.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 backend/src/main/resources/db/migration/V2__seed_test_user.sql diff --git a/backend/src/main/resources/db/migration/V2__seed_test_user.sql b/backend/src/main/resources/db/migration/V2__seed_test_user.sql new file mode 100644 index 0000000..4ee9ce3 --- /dev/null +++ b/backend/src/main/resources/db/migration/V2__seed_test_user.sql @@ -0,0 +1,7 @@ +INSERT INTO users (id, email, password_hash, subscription) +VALUES ( + 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11', + 'test@bilhalsning.se', + '$2b$12$18UFRDPgHWuw5FYeu6X1ReisFjjuxs5XxDafi6.wZbsywoU7vUaLG', + 'none' +);