CodeExplorer createModifyPrimaryKeyQuery example
public function getRelationData(string
$tableName, string
$keyColumn): array
{ $data =
$this->
fetchRelationData($tableName);
return $this->
hydrateForeignKeyData($data,
$keyColumn);
} public function createSql(array
$keyStructures, string
$tableName, string
$newColumnName, string
$defaultValue): array
{ return array_filter(array_merge( $this->
createDropKeysPlaybookEntries($keyStructures),
[$this->
createModifyPrimaryKeyQuery($tableName,
$newColumnName,
$defaultValue)],
$this->
createAddKeysPlaybookEntries($keyStructures,
$newColumnName,
$tableName),
$this->
createAddColumnsAndKeysPlaybookEntries($newColumnName,
$keyStructures,
$defaultValue) ));
} private function createDropKeysPlaybookEntries(array
$keyStructures): array
{ $playbook =
[];
foreach ($keyStructures as $constraintName =>
$keyStructure) { \
assert(\
is_string($keyStructure['TABLE_NAME'
]));