Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #140 So this took me way longer than it should, it is really tricky to work with the unique id fields on all the linked tables.
I do wonder if primary keys on eventgroup and eventitem should be event.id + id and event.id + eventgroup.id + id respectively such that the first eventgroup of any event will have an id of 1 and the first eventitem of an evengroup will have id 1. I would have done this here but while the schema change is fine, the database migration in prisma is something I struggled with last time so best left for a separate issue.
Anyway, this works. As a convenience I decided to add a start date to the modal so you can choose a new day to start the event on. This will offset from the EXACT time that the old event did so if you want to shift the start 1h later then all eventgroups/items will shift too. It is almost impossible that you will be able to straight clone an event with no manual adjustments to the timing but this should help get them a bit easier.