Closed
Bug 925102
Opened 12 years ago
Closed 12 years ago
Fix is_archived/is_locked data on prod SUMO
Categories
(Data & BI Services Team :: DB: MySQL, task)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: mythmon, Assigned: scabral)
References
Details
Due to a code bug, we have some incorrect data in SUMO. We could fix this by making a data migration in our deployment process, but it would be pretty lame. Instead, I think we need this SQL statement (or one like it) run on the production sumo database.
UPDATE `questions_question` SET `is_locked` = 0
WHERE `is_archived` = 1 AND `is_locked` = 1 AND `created` < DATE('2013-03-21 00:00:00');
This should update something like 200K rows.
| Assignee | ||
Comment 1•12 years ago
|
||
207617 rows, according to a SELECT with the WHERE Clause.
Backing things up:
MariaDB [support_mozilla_com]> select id, is_locked into outfile '/var/tmp/bug925102.tab' from questions_question WHERE `is_archived` = 1 AND `is_locked` = 1 AND `created` < DATE('2013-03-21 00:00:00');
Query OK, 207617 rows affected (0.32 sec)
Running the update:
MariaDB [support_mozilla_com]> UPDATE `questions_question` SET `is_locked` = 0 WHERE `is_archived` = 1 AND `is_locked` = 1 AND `created` < DATE('2013-03-21 00:00:00')
-> ;
Query OK, 207617 rows affected (1.63 sec)
Rows matched: 207617 Changed: 207617 Warnings: 0
Done! Let me know if there's a need for the file (we can change the is_locked value back if necessary).
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 2•12 years ago
|
||
Yay, that fixed our problem. I don't see why we would need the backup, so feel free to delete it. Thanks for the help!
Status: RESOLVED → VERIFIED
| Assignee | ||
Updated•12 years ago
|
Assignee: server-ops-database → scabral
Updated•11 years ago
|
Product: mozilla.org → Data & BI Services Team
You need to log in
before you can comment on or make changes to this bug.
Description
•