Skip to content

Commit

Permalink
Merge pull request #43 from nastiausenko/refactor/db-migrations
Browse files Browse the repository at this point in the history
Encrypted passwords in sql script with test data
  • Loading branch information
IvanShalaev1990 authored Apr 17, 2024
2 parents 8980db8 + 169a3b8 commit b5dd793
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/main/resources/db/migration/V2__populate_test_data.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
INSERT INTO users (id, email, password, role)
VALUES ('84991c79-f6a9-4b7b-b1b4-0d66c0b92c81', '[email protected]', 'password1', 'USER'),
('f6ff4ee4-92c4-49f3-97eb-d6c69a715325', '[email protected]', 'password2', 'USER'),
('b95cb1b3-1a7e-4e8b-a7ef-f3e20aef5f0a', '[email protected]', 'password3', 'ADMIN');
VALUES ('84991c79-f6a9-4b7b-b1b4-0d66c0b92c81', '[email protected]',
'$2a$12$7Cp4On1DBNyCkz4TaZYc3O.A.CBKi4WXgXnlI4SD0yn7CgBX5Gd6O', 'USER'),
('f6ff4ee4-92c4-49f3-97eb-d6c69a715325', '[email protected]',
'$2a$12$7Cp4On1DBNyCkz4TaZYc3O.A.CBKi4WXgXnlI4SD0yn7CgBX5Gd6O', 'USER'),
('b95cb1b3-1a7e-4e8b-a7ef-f3e20aef5f0a', '[email protected]',
'$2a$12$7Cp4On1DBNyCkz4TaZYc3O.A.CBKi4WXgXnlI4SD0yn7CgBX5Gd6O', 'ADMIN');

INSERT INTO links (id, long_link, short_link, user_id, created_time, expiration_time, statistics, status)
VALUES ('3053e49b-6da3-4389-9d06-23b2d57b6f25', 'https://www.youtube.com', 'short-link-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void setUp() {
.user(User.builder()
.id(UUID.fromString("84991c79-f6a9-4b7b-b1b4-0d66c0b92c81"))
.email("[email protected]")
.password("password1")
.password("$2a$12$7Cp4On1DBNyCkz4TaZYc3O.A.CBKi4WXgXnlI4SD0yn7CgBX5Gd6O")
.role(UserRole.USER)
.build())
.createdTime(LocalDateTime.of(2024, 4, 13, 10, 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void setUp() {
user = User.builder()
.id(UUID.fromString("84991c79-f6a9-4b7b-b1b4-0d66c0b92c81"))
.email("[email protected]")
.password("password1")
.password("$2a$12$7Cp4On1DBNyCkz4TaZYc3O.A.CBKi4WXgXnlI4SD0yn7CgBX5Gd6O")
.role(UserRole.USER)
.build();
}
Expand Down

0 comments on commit b5dd793

Please sign in to comment.