add column for publisher

This commit is contained in:
Valentin CZERYBA 2023-01-05 21:16:52 +01:00
parent d42dc014b6
commit 4b4b9ae277
2 changed files with 21 additions and 1 deletions

View File

@ -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")

View File

@ -0,0 +1,6 @@
package com.covas.Enum;
public enum Type {
VIDEO, PHOTO, TEXT, URL
}