thewca / worldcubeassociation.org

All of the code that runs on worldcubeassociation.org
https://www.worldcubeassociation.org/
GNU General Public License v3.0
320 stars 175 forks source link

Remove Events that were never official #96

Closed jfly closed 7 years ago

jfly commented 9 years ago

Our current list of events:

mysql> select * from Events;
+--------+----------------------------------------+------+--------+------------------------------+
| id     | name                                   | rank | format | cellName                     |
+--------+----------------------------------------+------+--------+------------------------------+
| 333    | Rubik's Cube                           |   10 | time   | Rubik's Cube                 |
| 444    | 4x4 Cube                               |   20 | time   | 4x4 Cube                     |
| 555    | 5x5 Cube                               |   30 | time   | 5x5 Cube                     |
| 222    | 2x2 Cube                               |   40 | time   | 2x2 Cube                     |
| 333bf  | Rubik's Cube: Blindfolded              |   50 | time   | 3x3 blindfolded              |
| 333oh  | Rubik's Cube: One-handed               |   60 | time   | 3x3 one-handed               |
| 333fm  | Rubik's Cube: Fewest moves             |   70 | number | 3x3 fewest moves             |
| 333ft  | Rubik's Cube: With feet                |   80 | time   | 3x3 with feet                |
| minx   | Megaminx                               |  110 | time   | Megaminx                     |
| pyram  | Pyraminx                               |  120 | time   | Pyraminx                     |
| sq1    | Square-1                               |  130 | time   | Square-1                     |
| clock  | Rubik's Clock                          |  140 | time   | Rubik's Clock                |
| skewb  | Skewb                                  |  150 | time   | Skewb                        |
| 666    | 6x6 Cube                               |  200 | time   | 6x6 Cube                     |
| 777    | 7x7 Cube                               |  210 | time   | 7x7 Cube                     |
| 444bf  | 4x4 Cube: Blindfolded                  |  500 | time   | 4x4 blindfolded              |
| 555bf  | 5x5 Cube: Blindfolded                  |  510 | time   | 5x5 blindfolded              |
| 333mbf | Rubik's Cube: Multiple Blindfolded     |  520 | multi  | 3x3 multi blind              |
| magic  | Rubik's Magic                          |  997 | time   | Rubik's Magic                |
| mmagic | Master Magic                           |  998 | time   | Master Magic                 |
| 333mbo | Rubik's Cube: Multi blind old style    |  999 | multi  | 3x3 multi blind old          |
| 333ni  | Rubik's Cube: No inspection            | 1010 | time   | 3x3 no inspection            |
| 333sbf | Rubik's Cube: Speed Blindfolded        | 1020 | time   | 3x3 speed blindfolded        |
| 333r3  | Rubik's Cube: 3 in a row               | 1030 | time   | 3x3 3 in a row               |
| 333ts  | Rubik's Cube: Team solving             | 1035 | time   | 3x3 team solving             |
| 333bts | Rubik's Cube: Blindfolded team solving | 1040 | time   | 3x3 blindfolded team solving |
| 222bf  | 2x2 Cube: Blindfolded                  | 1050 | time   | 2x2 blindfolded              |
| clkbf  | Rubik's Clock: Blindfolded             | 1060 | time   | Clock blindfolded            |
| 333si  | Siamese Rubik's Cube                   | 1100 | time   | Siamese Cube                 |
| rainb  | Rainbow Cube                           | 1110 | time   | Rainbow Cube                 |
| snake  | Rubik's Snake                          | 1120 | time   | Rubik's Snake                |
| mirbl  | Mirror Blocks                          | 1140 | time   | Mirror Blocks                |
| 360    | Rubik's 360                            | 1150 | time   | Rubik's 360                  |
| 222oh  | 2x2 Cube: One-handed                   | 1200 | time   | 2x2 one-handed               |
| magico | Rubik's Magic: One-handed              | 1210 | time   | Magic one-handed             |
+--------+----------------------------------------+------+--------+------------------------------+
35 rows in set (0.00 sec)

rank < 990 means "this event is official". 990 <= rank < 1000 means "this event was once official". rank >= 1000 means "this event was never official". See:

~/gitting/worldcubeassociation.org/webroot/results @kaladin> git grep -i "from *events"
admin/_helpers.php:      'SELECT * FROM Events WHERE rank<990 ORDER BY rank',
admin/check_results.php:  $eventIdSet       = array_flip( getAllIDs( dbQuery( "SELECT id FROM Events" )));
competition_registration.php:    if( count( dbQuery( "SELECT * FROM Events WHERE id='$eventId' AND rank<990" )))
includes/WCAClasses/WCADBConn.class.php:  return getAllIDs(dbQuery("SELECT id FROM Events WHERE rank<1000 ORDER BY rank"));
includes/_database.php:  return getAllIDs(dbQuery("SELECT id FROM Events WHERE rank<1000 ORDER BY rank"));
includes/_framework.php:  $event = dbQuery( "SELECT * FROM Events WHERE id='$eventId'" );
~/gitting/worldcubeassociation.org/webroot/results @kaladin> 

Fortunately, it looks like we don't actually have any results for events that were never official:

mysql> SELECT * FROM Results LEFT JOIN Events ON Results.eventId=Events.id WHERE rank>=1000;
Empty set (0.11 sec)

Removing these is a simple migration. Further improvement would be to remove the Events table entirely =).

lgarron commented 9 years ago

Noooooo! #speedBLD4life

But actually, good idea. I didn't even know we had these. Presumably to support http://speedcubing.com/results/ ?

jfly commented 9 years ago

Oh my speedcubing.com =)

When speedbld is an official event, we can add it back =).

jfly commented 8 years ago

I did this as part of my changes for #294.

SAuroux commented 7 years ago

I was just asked by someone why we have these events in the database which were never official and remembered this issue.

TLDR: These events are still in the database!

jfly commented 7 years ago

Ahh, I see. I removed these from the virtual models we used to have, but we've gone back to our (messy) database for this.

J-Rohault-dF commented 5 years ago

Actually, these events were never official, but their results were at some time in history

jfly commented 5 years ago

What do you mean, Julio? These events were never official, and any results associated with them were also never official.

J-Rohault-dF commented 5 years ago

When there was no real official list of events (before 2007), the WCA recognized many results that are considered as unofficial now. Removed events haven’t seen their results archived, so the only way to access them currently is via speedcubing.com