add column for publisher
This commit is contained in:
parent
d42dc014b6
commit
4b4b9ae277
@ -6,6 +6,8 @@ import java.util.UUID;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
@ -13,8 +15,11 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.CascadeType;
|
||||
|
||||
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
import com.covas.Enum.Type;
|
||||
|
||||
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
|
||||
|
||||
|
||||
@ -30,8 +35,17 @@ public class PublisherEntity extends PanacheEntityBase implements Serializable {
|
||||
@Column(columnDefinition="TEXT")
|
||||
public String description;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
public Type type;
|
||||
|
||||
public String url;
|
||||
|
||||
@Column(nullable = false)
|
||||
public LocalDateTime created_at;
|
||||
@Column(nullable = false)
|
||||
public LocalDateTime updated_at;
|
||||
@ColumnDefault("null")
|
||||
public LocalDateTime deleted_at;
|
||||
|
||||
@ManyToOne(cascade = CascadeType.ALL)
|
||||
@JoinColumn(name = "users_id", referencedColumnName = "id")
|
||||
|
6
src/main/java/com/covas/Enum/Type.java
Normal file
6
src/main/java/com/covas/Enum/Type.java
Normal file
@ -0,0 +1,6 @@
|
||||
package com.covas.Enum;
|
||||
|
||||
public enum Type {
|
||||
VIDEO, PHOTO, TEXT, URL
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user