Skip to content

Commit

Permalink
imp: 관계 정보에 custom 여부 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Sep 2, 2024
1 parent f2703f7 commit 4ceb194
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ data class RelationshipModel(
val relation: String,
/** 설명 */
val description: String?,
/** 커스텀 여부 */
val isCustom: Boolean,
) {
companion object {
fun from(relationship: Relationship): RelationshipModel {
return RelationshipModel(
id = relationship.id,
relation = relationship.relation,
description = relationship.description
description = relationship.description,
isCustom = relationship.isCustom
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
package com.oksusu.susu.domain.friend.domain

import com.oksusu.susu.domain.common.BaseEntity
import jakarta.persistence.Column
import jakarta.persistence.Entity
import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.Table
import jakarta.persistence.*

/** 관계 */
@Entity
Expand All @@ -25,4 +20,8 @@ class Relationship(
/** 활성화 : 1, 비활성화 : 0 */
@Column(name = "is_active")
val isActive: Boolean,

/** 커스텀 여부 */
@Column(name = "is_custom")
val isCustom: Boolean = false,
) : BaseEntity()
7 changes: 4 additions & 3 deletions sql/ddl/friend/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ CREATE UNIQUE INDEX uidx__friend_id__relationship_id ON friend_relationship (fri
-- 관계
CREATE TABLE `relationship`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '관계 정보 id',
`relation` varchar(512) NOT NULL COMMENT '관계',
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '관계 정보 id',
`relation` varchar(512) NOT NULL COMMENT '관계',
`description` varchar(512) DEFAULT NULL COMMENT '상세 설명',
`is_active` tinyint NOT NULL COMMENT '활성화 : 1, 비활성화 : 0',
`is_active` tinyint NOT NULL COMMENT '활성화 : 1, 비활성화 : 0',
`is_custom` tinyint DEFAULT 0 NOT NULL COMMENT '커스텀 여부',
`created_at` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '생성일',
`modified_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정일',
PRIMARY KEY (`id`)
Expand Down

0 comments on commit 4ceb194

Please sign in to comment.