Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate event #144

Merged
merged 3 commits into from
Jan 24, 2024
Merged

Duplicate event #144

merged 3 commits into from
Jan 24, 2024

Conversation

alasdairwilson
Copy link
Collaborator

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

Copy link
Contributor

@martinjrobins martinjrobins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great stuff, thanks @alasdairwilson :)

@martinjrobins martinjrobins merged commit 054b8a0 into main Jan 24, 2024
3 checks passed
@martinjrobins martinjrobins deleted the duplicate-event branch January 24, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clone existing event to new date
2 participants