Hi Guys, In my Medical Lab project I wanted to use SQL CONSTRAINTS to prevent the same patient of having two appointments in the same day however the appointment_date field is a datetime field which means the validation of SQL constraints works only if the patient would have more than one appointment in the same exact date and the same exact time along with seconds.
but I want the validation to be based on the day month year only.
_sql_constraints = [
('name_code_unique', 'unique (patient_id, appointment_date)', 'An Appointment For the Same Patient Has Already Been Booked On The Same Date'),
]
any one would help please