protected function loadTableForeignKeys($tableName)
    {
        $foreignKeys = $this->db->createCommand('PRAGMA FOREIGN_KEY_LIST (' . $this->quoteValue($tableName) . ')')->queryAll();
        $foreignKeys = $this->normalizePdoRowKeyCase($foreignKeys, true);
        $foreignKeys = ArrayHelper::index($foreignKeys, null, 'table');
        ArrayHelper::multisort($foreignKeys, 'seq', SORT_ASC, SORT_NUMERIC);
        $result = [];
        foreach ($foreignKeys as $table => $foreignKey) {
            $result[] = new ForeignKeyConstraint([
                'columnNames' => ArrayHelper::getColumn($foreignKey, 'from'),
                'foreignTableName' => $table,
                'foreignColumnNames' => ArrayHelper::getColumn($foreignKey, 'to'),
                'onDelete' => isset($foreignKey[0]['on_delete']) ? $foreignKey[0]['on_delete'] : null,
                'onUpdate' => isset($foreignKey[0]['on_update']) ? $foreignKey[0]['on_update'] : null,
            ]);
        }

        return $result;
    }
protected function loadTableForeignKeys($tableName)
    {
        $foreignKeys = $this->db->createCommand('PRAGMA FOREIGN_KEY_LIST (' . $this->quoteValue($tableName) . ')')->queryAll();
        $foreignKeys = $this->normalizePdoRowKeyCase($foreignKeys, true);
        $foreignKeys = ArrayHelper::index($foreignKeys, null, 'table');
        ArrayHelper::multisort($foreignKeys, 'seq', SORT_ASC, SORT_NUMERIC);
        $result = [];
        foreach ($foreignKeys as $table => $foreignKey) {
            $result[] = new ForeignKeyConstraint([
                'columnNames' => ArrayHelper::getColumn($foreignKey, 'from'),
                'foreignTableName' => $table,
                'foreignColumnNames' => ArrayHelper::getColumn($foreignKey, 'to'),
                'onDelete' => isset($foreignKey[0]['on_delete']) ? $foreignKey[0]['on_delete'] : null,
                'onUpdate' => isset($foreignKey[0]['on_update']) ? $foreignKey[0]['on_update'] : null,
            ]);
        }

        return $result;
    }
protected function loadTableForeignKeys ( $ tableName ) { $ foreignKeys = $ this -> db -> createCommand ( 'PRAGMA FOREIGN_KEY_LIST (' . $ this -> quoteValue ( $ tableName ) . ')' ) -> queryAll ( ) ; $ foreignKeys = $ this -> normalizePdoRowKeyCase ( $ foreignKeys , true ) ; $ foreignKeys = ArrayHelper :: index ( $ foreignKeys , null , 'table' ) ; ArrayHelper :: multisort ( $ foreignKeys , 'seq' , SORT_ASC , SORT_NUMERIC ) ; $ result = [ ] ; foreach ( $ foreignKeys as $ table => $ foreignKey ) { $ result [ ] = new ForeignKeyConstraint ( [ 'columnNames' => ArrayHelper :: getColumn ( $ foreignKey , 'from' ) , 'foreignTableName' => $ table , 'foreignColumnNames' => ArrayHelper :: getColumn ( $ foreignKey , 'to' ) , 'onDelete' => isset ( $ foreignKey [ 0 ] [ 'on_delete' ] ) ? $ foreignKey [ 0 ] [ 'on_delete' ] : null , 'onUpdate' => isset ( $ foreignKey [ 0 ] [ 'on_update' ] ) ? $ foreignKey [ 0 ] [ 'on_update' ] : null , ] ) ; } return $ result ; }
{@inheritdoc}
{