Page MenuHomePhabricator

Correct the schema to make revision id columns of cx_translations nullable
Closed, ResolvedPublic

Description

This is followup of T119752: Review schema changes for T119495 in which the sql script executed was from an older patchset and made the added columns not-nullable.

Please correct it by making it nullable as follows

ALTER TABLE /*_*/cx_translations
MODIFY translation_source_revision_id INT UNSIGNED NULL,
MODIFY translation_target_revision_id INT UNSIGNED NULL;

There is no gerrit patch related to this since the patchset https://gerrit.wikimedia.org/r/#/c/255662 has correct script.

Event Timeline

santhosh assigned this task to jcrespo.
santhosh raised the priority of this task from to Medium.
santhosh updated the task description. (Show Details)
santhosh renamed this task from Correct the schema to make revision id columns nullable to Correct the schema to make revision id columns of cx_translations nullable.Dec 15 2015, 11:17 AM
santhosh set Security to None.
Amire80 raised the priority of this task from Medium to High.Dec 16 2015, 12:59 PM
Amire80 added a project: OKR-Work.

Current state, check that it is right:

mysql -h x1-master wikishared -e "SHOW CREATE TABLE cx_translations\G"
*************************** 1. row ***************************
       Table: cx_translations
Create Table: CREATE TABLE `cx_translations` (
  `translation_id` int(11) NOT NULL AUTO_INCREMENT,
  `translation_source_title` varbinary(512) NOT NULL,
  `translation_target_title` varbinary(512) NOT NULL,
  `translation_source_language` varbinary(36) NOT NULL,
  `translation_target_language` varbinary(36) NOT NULL,
  `translation_source_url` blob NOT NULL,
  `translation_target_url` blob,
  `translation_status` enum('draft','published','deleted') DEFAULT NULL,
  `translation_start_timestamp` varbinary(14) NOT NULL,
  `translation_last_updated_timestamp` varbinary(14) NOT NULL,
  `translation_progress` tinyblob NOT NULL,
  `translation_started_by` int(11) DEFAULT NULL,
  `translation_last_update_by` int(11) DEFAULT NULL,
  `translation_source_revision_id` int(10) unsigned DEFAULT NULL,
  `translation_target_revision_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`translation_id`),
  UNIQUE KEY `cx_translation_pair` (`translation_source_title`,`translation_source_language`,`translation_target_language`),
  KEY `cx_translation_languages` (`translation_source_language`,`translation_target_language`)
) ENGINE=InnoDB AUTO_INCREMENT=95914 DEFAULT CHARSET=binary
jcrespo moved this task from Backlog to Done on the Schema-change-in-production board.