Closed Bug 395088 Opened 17 years ago Closed 17 years ago

AMO production SQL changes

Categories

(Infrastructure & Operations Graveyard :: WebOps: Other, task)

All
Other
task
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wenzel, Assigned: oremj)

References

Details

Please apply the SQL needed for developers' replies to user reviews on AMO (from bug 376766) to AMO's production DB:

https://bugzilla.mozilla.org/attachment.cgi?id=275790

Thanks.
Blocks: 376766
Assignee: server-ops → oremj
mysql> ALTER TABLE `reviews` ADD `reply_to` INT( 11 ) UNSIGNED NULL DEFAULT NULL AFTER `user_id` ;
` `rating` TINYINT UNSIGNED NULL DEFAULT NULL;

ALTER TABLE `reviews` ADD UNIQUE (`reply_to`);

ALTER TABLE `reviews` ADD CONSTRAINT `reviews_reply` FOREIGN KEY (`reply_to`) REFERENCES `reviews` (`id`) ON DELETE CASCADE;

ALTER TABLE `reviews` DROP INDEX `one_review_per_user` , ADD UNIQUE `one_review_per_user` ( `version_id` , `user_id` , `reply_to` );Query OK, 6055 rows affected (0.38 sec)
Records: 6055  Duplicates: 0  Warnings: 0

mysql> ALTER TABLE `reviews` CHANGE `rating` `rating` TINYINT UNSIGNED NULL DEFAULT NULL;
Query OK, 6055 rows affected (0.25 sec)
Records: 6055  Duplicates: 0  Warnings: 0

mysql> 
mysql> ALTER TABLE `reviews` ADD UNIQUE (`reply_to`);
Query OK, 6055 rows affected (0.27 sec)
Records: 6055  Duplicates: 0  Warnings: 0

mysql> 
mysql> ALTER TABLE `reviews` ADD CONSTRAINT `reviews_reply` FOREIGN KEY (`reply_to`) REFERENCES `reviews` (`id`) ON DELETE CASCADE;
Query OK, 6055 rows affected (0.23 sec)
Records: 6055  Duplicates: 0  Warnings: 0

mysql> 
mysql> ALTER TABLE `reviews` DROP INDEX `one_review_per_user` , ADD UNIQUE `one_review_per_user` ( `version_id` , `user_id` , `reply_to` ); 
Query OK, 6055 rows affected (0.30 sec)
Records: 6055  Duplicates: 0  Warnings: 0
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Component: Server Operations: Web Operations → WebOps: Other
Product: mozilla.org → Infrastructure & Operations
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.