-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from gunsight1/DB_add_insert_common_code_and_…
…create_withraw_table DB :: 회원탈퇴 테이블 추가, 공통코드 레코드 수정 SQL
- Loading branch information
Showing
4 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...i/src/main/resources/db/migration/V1.0.8__insert_common_code_and_create_withraw_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
CREATE TABLE if not exists withdraw_member | ||
( | ||
member_no bigserial NOT NULL, | ||
id varchar NOT NULL, | ||
email varchar NOT NULL, | ||
ip varchar, | ||
created_at date NOT NULL, | ||
created_by varchar(10485760) NULL, | ||
modified_at date NULL, | ||
modified_by varchar(10485760) NULL | ||
); | ||
|
||
|
||
INSERT INTO public.common_code (code_no, code_name, upper_no, upper_name, sort_order, is_used, description, | ||
sub_description, created_at, created_by, modified_at, modified_by) | ||
VALUES (67, 'OTHERS', 48, NULL, 3, true, '변경필요', NULL, '2024-01-10', 'admin', NULL, NULL) | ||
ON CONFLICT DO NOTHING; | ||
INSERT INTO public.common_code (code_no, code_name, upper_no, upper_name, sort_order, is_used, description, | ||
sub_description, created_at, created_by, modified_at, modified_by) | ||
VALUES (68, 'AGE_99', 51, NULL, 6, true, '변경필요', NULL, '2024-01-10', 'admin', NULL, NULL) | ||
ON CONFLICT DO NOTHING; | ||
|
||
UPDATE public.common_code | ||
SET code_name='MALE', | ||
modified_at = CURRENT_TIMESTAMP, | ||
modified_by = 'admin' | ||
WHERE code_no = 49 | ||
; | ||
|
||
UPDATE public.common_code | ||
SET code_name='FEMALE', | ||
modified_at = CURRENT_TIMESTAMP, | ||
modified_by = 'admin' | ||
WHERE code_no = 50 | ||
; |
49 changes: 49 additions & 0 deletions
49
module-domain/src/main/java/com/kernel360/member/entity/WithdrawMember.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.kernel360.member.entity; | ||
|
||
import com.kernel360.base.BaseEntity; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Entity | ||
@Table(name = "withdraw_member") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class WithdrawMember extends BaseEntity { | ||
|
||
@Id | ||
@Column(name = "member_no", nullable = false) | ||
private Long memberNo; | ||
|
||
@Column(name = "id", nullable = false, updatable = false) | ||
private String id; | ||
|
||
@Column(name = "email", nullable = false) | ||
private String email; | ||
|
||
@Column(name="ip") | ||
private String ip; | ||
|
||
|
||
public static WithdrawMember of(Long memberNo, String id, String email, String ip) { | ||
|
||
return new WithdrawMember(memberNo, id, email, ip); | ||
} | ||
|
||
private WithdrawMember( | ||
Long memberNo, | ||
String id, | ||
String email, | ||
String ip | ||
) { | ||
this.memberNo = memberNo; | ||
this.id = id; | ||
this.email = email; | ||
this.ip = ip; | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
module-domain/src/main/java/com/kernel360/member/repository/WithdrawMemberRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.kernel360.member.repository; | ||
|
||
import com.kernel360.member.entity.WithdrawMember; | ||
import jakarta.persistence.Id; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface WithdrawMemberRepository extends JpaRepository<WithdrawMember, Id> { | ||
} |