generated from pricelees/issue-pr-template
feat: Region Schema / Entity 정의
This commit is contained in:
parent
cf23122e91
commit
4de21d0b63
@ -0,0 +1,18 @@
|
||||
package roomescape.region.infrastructure.persistence
|
||||
|
||||
import jakarta.persistence.Entity
|
||||
import jakarta.persistence.Id
|
||||
import jakarta.persistence.Table
|
||||
|
||||
@Entity
|
||||
@Table(name = "region")
|
||||
class RegionEntity(
|
||||
@Id
|
||||
val code: String,
|
||||
val sidoCode: String,
|
||||
val sigunguCode: String,
|
||||
val dongCode: String,
|
||||
val sidoName: String,
|
||||
val sigunguName: String,
|
||||
val dongName: String,
|
||||
)
|
||||
@ -0,0 +1,5 @@
|
||||
package roomescape.region.infrastructure.persistence
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
|
||||
interface RegionRepository : JpaRepository<RegionEntity, String>
|
||||
@ -1,3 +1,14 @@
|
||||
create table if not exists region (
|
||||
code varchar(10) primary key,
|
||||
sido_code varchar(2) not null,
|
||||
sigungu_code varchar(3) not null,
|
||||
dong_code varchar(5) not null ,
|
||||
sido_name varchar(20) not null,
|
||||
sigungu_name varchar(20) not null,
|
||||
dong_name varchar(20) not null,
|
||||
)
|
||||
create index idx_region_sido_sigungu_dong ON region(sido_code, sigungu_code)
|
||||
|
||||
create table if not exists members (
|
||||
member_id bigint primary key,
|
||||
email varchar(255) not null,
|
||||
|
||||
@ -1,3 +1,14 @@
|
||||
create table if not exists region (
|
||||
code varchar(10) primary key,
|
||||
sido_code varchar(2) not null,
|
||||
sigungu_code varchar(3) not null,
|
||||
dong_code varchar(5) not null ,
|
||||
sido_name varchar(20) not null,
|
||||
sigungu_name varchar(20) not null,
|
||||
dong_name varchar(20) not null,
|
||||
)
|
||||
create index idx_region_sido_sigungu_dong ON region(sido_code, sigungu_code)
|
||||
|
||||
create table if not exists members
|
||||
(
|
||||
member_id bigint primary key,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user