diff --git a/src/main/java/com/codesdream/ase/model/activity/Activity.java b/src/main/java/com/codesdream/ase/model/activity/Activity.java index a000984..85e2173 100644 --- a/src/main/java/com/codesdream/ase/model/activity/Activity.java +++ b/src/main/java/com/codesdream/ase/model/activity/Activity.java @@ -2,10 +2,6 @@ package com.codesdream.ase.model.activity; import com.codesdream.ase.model.permission.User; import lombok.Data; -import org.dom4j.QName; -import org.hibernate.annotations.CollectionId; -import org.hibernate.annotations.WhereJoinTable; -import org.springframework.context.annotation.EnableMBeanExport; import javax.persistence.*; import java.util.Date; @@ -14,23 +10,18 @@ import java.util.Set; @Data @Entity -@Table(name = "activity", - indexes = { - @Index(name = "act_index1", columnList = "title", unique = true), - @Index(name = "act_index2", columnList = "creator") - } -) +@Table(name = "activity") public class Activity { @Id @GeneratedValue(strategy = GenerationType.AUTO) private int id; //活动标题 - @Column(nullable = false, unique = true) + @Column(name = "title", nullable = false, unique = true) private String title; //创建人 - @Column(nullable = false) + @Column(name = "creator", nullable = false) private String creator; //活动类型 diff --git a/src/main/java/com/codesdream/ase/model/activity/Report.java b/src/main/java/com/codesdream/ase/model/activity/Report.java index dbeaf37..12f0e56 100644 --- a/src/main/java/com/codesdream/ase/model/activity/Report.java +++ b/src/main/java/com/codesdream/ase/model/activity/Report.java @@ -11,12 +11,7 @@ import java.util.Set; @Data @Entity -@Table(name = "report", - indexes = { - @Index(name = "report_index1", columnList = "title"), - @Index(name = "report_index2", columnList = "creator") - } -) +@Table(name = "report") public class Report { @Id diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e33dd03..f04afda 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -7,7 +7,7 @@ spring.thymeleaf.encoding=UTF-8 spring.jpa.generate-ddl=false spring.jpa.show-sql=true -spring.jpa.hibernate.ddl-auto=update +spring.jpa.hibernate.ddl-auto=create spring.jooq.sql-dialect=org.hibernate.dialect.MySQL5InnoDBDialect spring.jpa.open-in-view=true spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true