add admin user

This commit is contained in:
Anika Raemer 2025-09-24 21:00:58 +02:00
parent 3cc66f4e97
commit 8fb48f7243
2 changed files with 8 additions and 1 deletions

View file

@ -66,6 +66,13 @@ export class CreateUserTable1661234567890 implements MigrationInterface {
name: "UQ_user_userName",
})
);
// Insert a default admin user - password is stored in shared/recipe-backend
await queryRunner.query(
`INSERT INTO "user" ("id", "userName", "email", "password", "role")
VALUES (uuid_generate_v4(), $1, $2, $3, $4)`,
["admin", "anika@raemer.net", "$2b$12$zySMBXDcPF4VWpyvXluYwOS4pWJlED.peAvK9NEMewht6UQGw/8WK", "admin"]
);
}
public async down(queryRunner: QueryRunner): Promise<void> {