CSI2532-Databases-I-Group-8/Dental-Clinic-Management-System

Fixed constraint for age restriction

Closed this issue · 2 comments

The constraint we created to verify that a patient is at least 15 years old does not work when adding to Postgres.

Current constraint: CHECK(CAST(DATEDIFF(DD, date_of_birth, GETDATE())/365.25 AS INT) >= 15)

Screenshot 2022-04-03 at 11 34 58

Fixed this in the recent commit

image
Inserting this into the table will not work. I tested it on onecompiler and pgadmin.
image