Closed jcotton42 closed 2 years ago
Postgres supports multi-column uniqueness constraints that should address this quite nicely https://www.postgresql.org/docs/current/ddl-constraints.html#DDL-CONSTRAINTS-UNIQUE-CONSTRAINTS and knex can set that up https://knexjs.org/#Schema-table-unique
addBook does not prevent adding duplicate books. As an example here I called
/addbook Book2 book
twiceNote that a corresponding
/deletebook Book2 book
does remove both from the database.