I have an Application type in my app.
public class Application {
private String id;
private String creator;
private boolean active;
}
active field marks is current application actual for certain user. Every user is able to have only one application in active(active == true) state and any number of inactive applications(active == false).
Is it possible to deny storing second application record with same creator value and active == true, but let save any number of applications with same creator value and active == false on DB level(Postgres)?
Thanks.