Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/schema/PhabricatorConfigColumnSchema.php
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | public function getKeyByteLength($prefix = null) { | ||||
return 0; | return 0; | ||||
} | } | ||||
public function compareToSimilarSchema( | public function compareToSimilarSchema( | ||||
PhabricatorConfigStorageSchema $expect) { | PhabricatorConfigStorageSchema $expect) { | ||||
$issues = array(); | $issues = array(); | ||||
$type_unknown = PhabricatorConfigSchemaSpec::DATATYPE_UNKNOWN; | |||||
if ($expect->getColumnType() == $type_unknown) { | |||||
$issues[] = self::ISSUE_UNKNOWN; | |||||
} else { | |||||
if ($this->getCharacterSet() != $expect->getCharacterSet()) { | if ($this->getCharacterSet() != $expect->getCharacterSet()) { | ||||
$issues[] = self::ISSUE_CHARSET; | $issues[] = self::ISSUE_CHARSET; | ||||
} | } | ||||
if ($this->getCollation() != $expect->getCollation()) { | if ($this->getCollation() != $expect->getCollation()) { | ||||
$issues[] = self::ISSUE_COLLATION; | $issues[] = self::ISSUE_COLLATION; | ||||
} | } | ||||
if ($this->getColumnType() != $expect->getColumnType()) { | if ($this->getColumnType() != $expect->getColumnType()) { | ||||
$issues[] = self::ISSUE_COLUMNTYPE; | $issues[] = self::ISSUE_COLUMNTYPE; | ||||
} | } | ||||
if ($this->getNullable() !== $expect->getNullable()) { | if ($this->getNullable() !== $expect->getNullable()) { | ||||
$issues[] = self::ISSUE_NULLABLE; | $issues[] = self::ISSUE_NULLABLE; | ||||
} | } | ||||
if ($this->getAutoIncrement() !== $expect->getAutoIncrement()) { | if ($this->getAutoIncrement() !== $expect->getAutoIncrement()) { | ||||
$issues[] = self::ISSUE_AUTOINCREMENT; | $issues[] = self::ISSUE_AUTOINCREMENT; | ||||
} | } | ||||
} | |||||
return $issues; | return $issues; | ||||
} | } | ||||
public function newEmptyClone() { | public function newEmptyClone() { | ||||
$clone = clone $this; | $clone = clone $this; | ||||
return $clone; | return $clone; | ||||
} | } | ||||
} | } |