mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-15 12:10:21 +00:00
added columns for tracking created/updated
This commit is contained in:
@@ -87,6 +87,22 @@ public class Mute {
|
||||
*/
|
||||
private String triggerKey;
|
||||
|
||||
@Column(name = "created")
|
||||
private Instant created;
|
||||
|
||||
@PrePersist
|
||||
private void onInsert() {
|
||||
this.created = Instant.now();
|
||||
}
|
||||
|
||||
@Column(name = "updated")
|
||||
private Instant updated;
|
||||
|
||||
@PreUpdate
|
||||
private void onUpdate() {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@@ -5,6 +5,7 @@ import dev.sheldan.abstracto.core.models.database.AServer;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
@@ -42,6 +43,22 @@ public class MuteRole {
|
||||
@JoinColumn(name = "role_id", nullable = false)
|
||||
private ARole role;
|
||||
|
||||
@Column(name = "created")
|
||||
private Instant created;
|
||||
|
||||
@PrePersist
|
||||
private void onInsert() {
|
||||
this.created = Instant.now();
|
||||
}
|
||||
|
||||
@Column(name = "updated")
|
||||
private Instant updated;
|
||||
|
||||
@PreUpdate
|
||||
private void onUpdate() {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
@@ -67,6 +67,23 @@ public class Warning {
|
||||
@Setter
|
||||
private Instant decayDate;
|
||||
|
||||
@Column(name = "created")
|
||||
private Instant created;
|
||||
|
||||
@PrePersist
|
||||
private void onInsert() {
|
||||
this.created = Instant.now();
|
||||
}
|
||||
|
||||
@Column(name = "updated")
|
||||
private Instant updated;
|
||||
|
||||
@PreUpdate
|
||||
private void onUpdate() {
|
||||
this.updated = Instant.now();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
|
||||
Reference in New Issue
Block a user