cms icon indicating copy to clipboard operation
cms copied to clipboard

Support having 2 tasks on DB with the same Task.name

Open wil93 opened this issue 7 years ago • 5 comments

I remember that this was discussed and @giomasce told me that all cms-dev agreed that it would be a good idea to allow duplicate Task.name

This is painful in situations where you have a "practice session" (e.g. IOI day0) where you may want to put old tasks, which are already on the DB.

The current workaround I'm using is to manually rename the old tasks to "old_" and then importing the new ones.

wil93 avatar May 18 '17 13:05 wil93

(I don't remember that discussion.)

I expect that, while you want to abolish the uniqueness of Task.name, you want to keep the uniqueness of (Task.contest_id, Task.name). Is that the case? If you did this exact replacement right now in the DB would anything break? If the answer is no then this issue is a no-brainer for me.

lw avatar May 18 '17 14:05 lw

I checked old telegram messages and it appears that the discussion was actually on User.username and not on Task.name 😅 and the outcome was that you all wanted to enforce uniqueness of it, not remove it 😓

wil93 avatar May 18 '17 14:05 wil93

That sounds more like us, yes :P

lw avatar May 18 '17 15:05 lw

Anyway

you want to keep the uniqueness of (Task.contest_id, Task.name). Is that the case? If you did this exact replacement right now in the DB would anything break?

Yes, and I don't know but I don't think so

wil93 avatar May 18 '17 20:05 wil93

One thing that would break is RWS, even though it should be quite easy to fix.

lw avatar May 18 '17 21:05 lw