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)

x86_64
Linux
task
Not set
normal

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.
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
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: server-ops-database → scabral
Product: mozilla.org → Data & BI Services Team
You need to log in before you can comment on or make changes to this bug.