diff --git a/src/applications/config/schema/PhabricatorConfigStorageSchema.php b/src/applications/config/schema/PhabricatorConfigStorageSchema.php --- a/src/applications/config/schema/PhabricatorConfigStorageSchema.php +++ b/src/applications/config/schema/PhabricatorConfigStorageSchema.php @@ -171,10 +171,10 @@ case self::ISSUE_MISSING: case self::ISSUE_SURPLUS: case self::ISSUE_SUBFAIL: + case self::ISSUE_NULLABLE: return self::STATUS_FAIL; case self::ISSUE_SUBWARN: case self::ISSUE_COLUMNTYPE: - case self::ISSUE_NULLABLE: return self::STATUS_WARN; case self::ISSUE_SUBNOTE: case self::ISSUE_CHARSET: diff --git a/src/applications/differential/storage/DifferentialChangeset.php b/src/applications/differential/storage/DifferentialChangeset.php --- a/src/applications/differential/storage/DifferentialChangeset.php +++ b/src/applications/differential/storage/DifferentialChangeset.php @@ -36,6 +36,14 @@ 'fileType' => 'uint32', 'addLines' => 'uint32', 'delLines' => 'uint32', + + // T6203/NULLABILITY + // These should all be non-nullable, and store reasonable default + // JSON values if empty. + 'awayPaths' => 'text?', + 'metadata' => 'text?', + 'oldProperties' => 'text?', + 'newProperties' => 'text?', ), self::CONFIG_KEY_SCHEMA => array( 'diffID' => array( diff --git a/src/applications/differential/storage/DifferentialDiff.php b/src/applications/differential/storage/DifferentialDiff.php --- a/src/applications/differential/storage/DifferentialDiff.php +++ b/src/applications/differential/storage/DifferentialDiff.php @@ -57,9 +57,13 @@ 'branch' => 'text255?', 'bookmark' => 'text255?', 'arcanistProjectPHID' => 'phid?', - 'creationMethod' => 'text255', - 'description' => 'text255', 'repositoryUUID' => 'text64?', + + // T6203/NULLABILITY + // These should be non-null; all diffs should have a creation method + // and the description should just be empty. + 'creationMethod' => 'text255?', + 'description' => 'text255?', ), self::CONFIG_KEY_SCHEMA => array( 'revisionID' => array( diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php --- a/src/applications/differential/storage/DifferentialRevision.php +++ b/src/applications/differential/storage/DifferentialRevision.php @@ -84,7 +84,7 @@ 'lastReviewerPHID' => 'phid?', 'lineCount' => 'uint32?', 'mailKey' => 'bytes40', - 'branchName' => 'text255', + 'branchName' => 'text255?', 'arcanistProjectPHID' => 'phid?', 'repositoryPHID' => 'phid?', ), diff --git a/src/applications/harbormaster/storage/HarbormasterObject.php b/src/applications/harbormaster/storage/HarbormasterObject.php --- a/src/applications/harbormaster/storage/HarbormasterObject.php +++ b/src/applications/harbormaster/storage/HarbormasterObject.php @@ -8,7 +8,7 @@ return array( self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array( - 'name' => 'text255', + 'name' => 'text255?', ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php b/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php --- a/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php +++ b/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php @@ -27,7 +27,11 @@ 'id' => 'id', 'logID' => 'id', 'encoding' => 'text32', - 'size' => 'uint32', + + // T6203/NULLABILITY + // Both the type and nullability of this column are crazily wrong. + 'size' => 'uint32?', + 'chunk' => 'bytes', ), array( diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php @@ -31,9 +31,13 @@ return array( self::CONFIG_AUX_PHID => true, self::CONFIG_COLUMN_SCHEMA => array( - 'logSource' => 'text255', - 'logType' => 'text255', - 'duration' => 'uint32', + // T6203/NULLABILITY + // It seems like these should be non-nullable? All logs should have a + // source, etc. + 'logSource' => 'text255?', + 'logType' => 'text255?', + 'duration' => 'uint32?', + 'live' => 'bool', ), self::CONFIG_KEY_SCHEMA => array( diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php b/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php @@ -103,10 +103,13 @@ self::CONFIG_COLUMN_SCHEMA => array( 'className' => 'text255', 'targetStatus' => 'text64', - 'name' => 'text255', 'dateStarted' => 'epoch?', 'dateCompleted' => 'epoch?', 'buildGeneration' => 'uint32', + + // T6203/NULLABILITY + // This should not be nullable. + 'name' => 'text255?', ), self::CONFIG_KEY_SCHEMA => array( 'key_build' => array( diff --git a/src/applications/harbormaster/storage/configuration/HarbormasterBuildStep.php b/src/applications/harbormaster/storage/configuration/HarbormasterBuildStep.php --- a/src/applications/harbormaster/storage/configuration/HarbormasterBuildStep.php +++ b/src/applications/harbormaster/storage/configuration/HarbormasterBuildStep.php @@ -29,8 +29,13 @@ self::CONFIG_COLUMN_SCHEMA => array( 'className' => 'text255', 'sequence' => 'uint32', - 'name' => 'text255', 'description' => 'text', + + // T6203/NULLABILITY + // This should not be nullable. Current `null` values indicate steps + // which predated editable names. These should be backfilled with + // default names, then the code for handling `null` shoudl be removed. + 'name' => 'text255?', ), self::CONFIG_KEY_SCHEMA => array( 'key_plan' => array( diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -36,10 +36,13 @@ 'contentType' => 'text255', 'mustMatchAll' => 'bool', 'configVersion' => 'uint32', - 'repetitionPolicy' => 'uint32', 'ruleType' => 'text255', 'isDisabled' => 'uint32', 'triggerObjectPHID' => 'phid?', + + // T6203/NULLABILITY + // This should not be nullable. + 'repetitionPolicy' => 'uint32?', ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php --- a/src/applications/maniphest/storage/ManiphestTask.php +++ b/src/applications/maniphest/storage/ManiphestTask.php @@ -78,6 +78,11 @@ 'ownerOrdering' => 'text64?', 'originalEmailSource' => 'text255?', 'subpriority' => 'double', + + // T6203/NULLABILITY + // This should not be nullable. It's going away soon anyway. + 'ccPHIDs' => 'text?', + ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -34,8 +34,11 @@ ), self::CONFIG_COLUMN_SCHEMA => array( 'status' => 'text255', - 'message' => 'text', 'relatedPHID' => 'phid?', + + // T6203/NULLABILITY + // This should just be empty if there's no body. + 'message' => 'text?', ), self::CONFIG_KEY_SCHEMA => array( 'status' => array( diff --git a/src/applications/paste/storage/PhabricatorPaste.php b/src/applications/paste/storage/PhabricatorPaste.php --- a/src/applications/paste/storage/PhabricatorPaste.php +++ b/src/applications/paste/storage/PhabricatorPaste.php @@ -48,6 +48,10 @@ 'language' => 'text64', 'mailKey' => 'bytes20', 'parentPHID' => 'phid?', + + // T6203/NULLABILITY + // Pastes should always have a view policy. + 'viewPolicy' => 'policy?', ), self::CONFIG_KEY_SCHEMA => array( 'parentPHID' => array( diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -31,7 +31,12 @@ 'name' => 'text64', 'description' => 'text', 'domain' => 'text255?', - 'joinPolicy' => 'policy', + + // T6203/NULLABILITY + // These policies should always be non-null. + 'joinPolicy' => 'policy?', + 'editPolicy' => 'policy?', + 'viewPolicy' => 'policy?', ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php --- a/src/applications/phame/storage/PhamePost.php +++ b/src/applications/phame/storage/PhamePost.php @@ -91,9 +91,17 @@ self::CONFIG_COLUMN_SCHEMA => array( 'title' => 'text255', 'phameTitle' => 'text64', - 'body' => 'text', 'visibility' => 'uint32', - 'datePublished' => 'epoch?', + + // T6203/NULLABILITY + // These seem like they should always be non-null? + 'blogPHID' => 'phid?', + 'body' => 'text?', + 'configData' => 'text?', + + // T6203/NULLABILITY + // This one probably should be nullable? + 'datePublished' => 'epoch', ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/phriction/storage/PhrictionContent.php b/src/applications/phriction/storage/PhrictionContent.php --- a/src/applications/phriction/storage/PhrictionContent.php +++ b/src/applications/phriction/storage/PhrictionContent.php @@ -35,9 +35,12 @@ 'title' => 'text', 'slug' => 'text128', 'content' => 'text', - 'description' => 'text', 'changeType' => 'uint32', 'changeRef' => 'uint32?', + + // T6203/NULLABILITY + // This should just be empty if not provided? + 'description' => 'text?', ), self::CONFIG_KEY_SCHEMA => array( 'documentID' => array( diff --git a/src/applications/ponder/storage/PonderAnswer.php b/src/applications/ponder/storage/PonderAnswer.php --- a/src/applications/ponder/storage/PonderAnswer.php +++ b/src/applications/ponder/storage/PonderAnswer.php @@ -70,7 +70,10 @@ self::CONFIG_COLUMN_SCHEMA => array( 'voteCount' => 'sint32', 'content' => 'text', - 'contentSource' => 'text', + + // T6203/NULLABILITY + // This should always exist. + 'contentSource' => 'text?', ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php --- a/src/applications/ponder/storage/PonderQuestion.php +++ b/src/applications/ponder/storage/PonderQuestion.php @@ -38,10 +38,13 @@ 'voteCount' => 'sint32', 'status' => 'uint32', 'content' => 'text', - 'contentSource' => 'text', 'heat' => 'double', 'answerCount' => 'uint32', 'mailKey' => 'bytes20', + + // T6203/NULLABILITY + // This should always exist. + 'contentSource' => 'text?', ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -125,11 +125,16 @@ 'name' => 'text255', 'status' => 'text32', 'phrictionSlug' => 'text128?', - 'joinPolicy' => 'policy', 'isMembershipLocked' => 'bool', 'profileImagePHID' => 'phid?', 'icon' => 'text32', 'color' => 'text32', + + // T6203/NULLABILITY + // These are definitely wrong and should always exist. + 'editPolicy' => 'policy?', + 'viewPolicy' => 'policy?', + 'joinPolicy' => 'policy?', ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php --- a/src/applications/releeph/storage/ReleephRequest.php +++ b/src/applications/releeph/storage/ReleephRequest.php @@ -155,10 +155,12 @@ ), self::CONFIG_COLUMN_SCHEMA => array( 'requestCommitPHID' => 'phid?', - 'commitIdentifier' => 'text40', - 'pickStatus' => 'uint32', + 'commitIdentifier' => 'text40?', + 'commitPHID' => 'phid?', + 'pickStatus' => 'uint32?', 'inBranch' => 'bool', 'mailKey' => 'bytes20', + 'userIntents' => 'text?', ), self::CONFIG_KEY_SCHEMA => array( 'key_phid' => null, diff --git a/src/applications/repository/storage/PhabricatorRepositoryRefCursor.php b/src/applications/repository/storage/PhabricatorRepositoryRefCursor.php --- a/src/applications/repository/storage/PhabricatorRepositoryRefCursor.php +++ b/src/applications/repository/storage/PhabricatorRepositoryRefCursor.php @@ -30,8 +30,11 @@ self::CONFIG_COLUMN_SCHEMA => array( 'refType' => 'text32', 'refNameHash' => 'bytes12', - 'refNameEncoding' => 'text16', 'commitIdentifier' => 'text40', + + // T6203/NULLABILITY + // This probably should not be nullable; refNameRaw is not nullable. + 'refNameEncoding' => 'text16?', ), self::CONFIG_KEY_SCHEMA => array( 'key_cursor' => array( diff --git a/src/applications/settings/storage/PhabricatorUserSSHKey.php b/src/applications/settings/storage/PhabricatorUserSSHKey.php --- a/src/applications/settings/storage/PhabricatorUserSSHKey.php +++ b/src/applications/settings/storage/PhabricatorUserSSHKey.php @@ -12,11 +12,14 @@ public function getConfiguration() { return array( self::CONFIG_COLUMN_SCHEMA => array( - 'name' => 'text255', - 'keyType' => 'text255', - 'keyBody' => 'text', 'keyHash' => 'bytes32', 'keyComment' => 'text255?', + + // T6203/NULLABILITY + // These seem like they should not be nullable. + 'name' => 'text255?', + 'keyType' => 'text255?', + 'keyBody' => 'text?', ), self::CONFIG_KEY_SCHEMA => array( 'userPHID' => array( diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php @@ -36,6 +36,13 @@ ), ); + $config[self::CONFIG_COLUMN_SCHEMA] = array( + // T6203/NULLABILITY + // This isn't nullable in the archive table, so at a minimum these + // should be the same. + 'dataID' => 'uint32?', + ) + $parent[self::CONFIG_COLUMN_SCHEMA]; + return $config + $parent; }