Skip to content

Commit

Permalink
NO-JIRA--chore : 애플리케이션 실행시 data.sql실행하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
BeommoKoo-dev committed Nov 14, 2023
1 parent f7d099e commit 7d65bbe
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package org.prgrms.nabimarketbe.domain.category.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Getter;
import lombok.NoArgsConstructor;
import org.prgrms.nabimarketbe.global.BaseEntity;

import javax.persistence.*;

@Entity
@Table(name = "categories")
@Getter
@NoArgsConstructor
public class Category extends BaseEntity {
public class Category {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "category_id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public SuggestionResponseDTO updateSuggestionStatus(
.orElseThrow(() -> new BaseException(ErrorCode.SUGGESTION_NOT_FOUND));

suggestion.decideSuggestion(isAccepted);

//TODO : 채팅방 생성

return SuggestionResponseDTO.from(suggestion);
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ spring:
profiles:
active: local

## .sql문을 실행하기 위함
sql:
init:
mode: always

## hibernate ddl 이후 datasource intialize
jpa:
defer-datasource-initialization: true


springdoc:
version: '@springdoc.version@'
swagger-ui:
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
insert into categories(category_name) values ('MALE_CLOTHES');
insert into categories(category_name) values ('FEMALE_CLOTHES');
insert into categories(category_name) values ('GOODS_ACCESSORY');
insert into categories(category_name) values ('SHOES');
insert into categories(category_name) values ('SPORTS');
insert into categories(category_name) values ('BOOKS');
insert into categories(category_name) values ('ELECTRONICS');
insert into categories(category_name) values ('FURNITURE_INTERIOR');
insert into categories(category_name) values ('HOME_ELECTRONICS');

0 comments on commit 7d65bbe

Please sign in to comment.