Today we have a single DB-function, updateOvulationDate, this checks if the date exists in the database it deletes it, if not it inserts it. We need to handle this differently because now we have a unique constraint so dates are never duplicated. This means that we can allow the user to import data from other apps without having to worry about if the user have current data in the app (the db function for add period handles this, so no error is thrown).
Create two new db-functions;
addDateToOvulation
removeDataFromOvulation
Make sure calendarscreen uses these functions instead.
Today we have a single DB-function, updateOvulationDate, this checks if the date exists in the database it deletes it, if not it inserts it. We need to handle this differently because now we have a unique constraint so dates are never duplicated. This means that we can allow the user to import data from other apps without having to worry about if the user have current data in the app (the db function for add period handles this, so no error is thrown).
Create two new db-functions;
addDateToOvulation
removeDataFromOvulation
Make sure calendarscreen uses these functions instead.