OxfordRSE / gutenberg

https://oxfordrse.github.io/gutenberg
BSD 3-Clause "New" or "Revised" License
5 stars 7 forks source link

Duplicate event #144

Closed alasdairwilson closed 10 months ago

alasdairwilson commented 10 months ago

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.

duplicate_event