Skip to content

Commit

Permalink
Feat: 전공 데이터 초기화 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
TGoddessana committed Dec 29, 2024
1 parent e979302 commit 55890ca
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
26 changes: 26 additions & 0 deletions src/main/java/promiseofblood/umpabackend/user/Major.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package promiseofblood.umpabackend.user;


import jakarta.persistence.*;

import lombok.*;
import lombok.NoArgsConstructor;


@Entity
@Getter
@Table(name = "majors")
@NoArgsConstructor(access = AccessLevel.PROTECTED)
public class Major {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String name;

@Override
public String toString() {
return "Major(id=" + this.getId() + ", name=" + this.getName() + ")";
}
}
22 changes: 20 additions & 2 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Spring Boot
spring:
application:
name: umpa-backend
Expand All @@ -11,6 +12,23 @@ spring:
password: ${DB_PASSWORD}

jpa:
show-sql: true
hibernate:
ddl-auto: create-drop
ddl-auto: create
defer-datasource-initialization: true

sql:
init:
mode: always
schema-locations: classpath:db/initial-data.sql


# OpenAPI
springdoc:
api-docs:
path: /openapi-json

swagger-ui:
path: /swagger-ui
layout: BaseLayout
tags-sorter: alpha
operations-sorter: alpha
10 changes: 10 additions & 0 deletions src/main/resources/db/initial-data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
INSERT INTO majors (name)
VALUES ('피아노'),
('작곡'),
('드럼'),
('베이스'),
('기타'),
('보컬'),
('전자음악'),
('관악');

0 comments on commit 55890ca

Please sign in to comment.