Today’s blog post is about exclusion constraints in Postgres and how to prevent double-bookings of appointments with them. It’s a nice dive into how to execute custom SQL code in your migrations and how timestamp ranges work in Posgres.
You can use this if you want to prevent any double-bookings of e.g. appointments, schedules, meetings, etc.