Skip to content

Commit

Permalink
Test : first deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
U-Geon committed Aug 1, 2024
1 parent 0c1b500 commit b244308
Showing 2 changed files with 30 additions and 30 deletions.
58 changes: 29 additions & 29 deletions src/main/java/bootcamp/wssrs/domain/Member/repository/DBInit.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
//package bootcamp.wssrs.domain.Member.repository;
//
//import bootcamp.wssrs.domain.Member.entity.Member;
//import jakarta.annotation.PostConstruct;
//import lombok.RequiredArgsConstructor;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.stereotype.Component;
//
//@Component
//@RequiredArgsConstructor
//public class DBInit {
//
// private final AuthRepository authRepository;
// private final PasswordEncoder encoder;
//
// @Value("${admin.email}")
// private String email;
//
// @Value("${admin.password}")
// private String password;
//
//
// @PostConstruct
// private void postConstruct() {
// Member admin = Member.createAdmin(email, password, encoder);
// authRepository.save(admin);
// }
//}
package bootcamp.wssrs.domain.Member.repository;

import bootcamp.wssrs.domain.Member.entity.Member;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

@Component
@RequiredArgsConstructor
public class DBInit {

private final AuthRepository authRepository;
private final PasswordEncoder encoder;

@Value("${admin.email}")
private String email;

@Value("${admin.password}")
private String password;


@PostConstruct
private void postConstruct() {
Member admin = Member.createAdmin(email, password, encoder);
authRepository.save(admin);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ spring:
jpa:
database: postgresql
hibernate:
ddl-auto: update
ddl-auto: create
properties:
hibernate:
format_sql: true

0 comments on commit b244308

Please sign in to comment.