createAddColumnsAndKeysPlaybookEntries example

$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']));

            $indexes = $this->schemaManager->listTableIndexes($keyStructure['TABLE_NAME']);

            
Home | Imprint | This part of the site doesn't use cookies.