src/Db/SqliteDb.php
protected function mergeTableDefs(array $tableDef, array $alterDef) {
        $result = $tableDef;

        $result['columns'] = array_merge($result['columns'], $alterDef['def']['columns']);
        $result['indexes'] = array_merge($result['indexes'], $alterDef['add']['indexes']);

        return $result;
    }
protected function mergeTableDefs(array $tableDef, array $alterDef) {
        $result = $tableDef;

        $result['columns'] = array_merge($result['columns'], $alterDef['def']['columns']);
        $result['indexes'] = array_merge($result['indexes'], $alterDef['add']['indexes']);

        return $result;
    }
Merge a table def with its alter def so that no columns/indexes are lost in an alter.

@param array $tableDef The table def.
@param array $alterDef The alter def.
@return array The new table def.