original_string: private function ensureOrderColumnExists()
      {
          $attributes = $this
              ->connection
              ->createQueryBuilder()
              ->select('metamodel.tableName', 'attribute.colname')
              ->from('tl_metamodel_attribute', 'attribute')
              ->leftJoin('attribute', 'tl_metamodel', 'metamodel', 'metamodel.id=attribute.pid')
              ->where('attribute.type=:type')
              ->setParameter('type', 'file')
              ->andWhere('attribute.file_multiple=:multiple')
              ->setParameter('multiple', '1')
              ->execute();
  
          while ($row = $attributes->fetch(\PDO::FETCH_OBJ)) {
              if ($this->fieldExists($row->colname . '__sort', $row->tableName)) {
                  continue;
              }
              $this
                  ->connection
                  ->exec(
                      \sprintf(
                          'ALTER TABLE %1$s ADD COLUMN %2$s__sort %3$s',
                          $row->tableName,
                          $row->colname,
                          'blob NULL'
                      )
                  );
          }
      }
code: private function ensureOrderColumnExists()
      {
          $attributes = $this
              ->connection
              ->createQueryBuilder()
              ->select('metamodel.tableName', 'attribute.colname')
              ->from('tl_metamodel_attribute', 'attribute')
              ->leftJoin('attribute', 'tl_metamodel', 'metamodel', 'metamodel.id=attribute.pid')
              ->where('attribute.type=:type')
              ->setParameter('type', 'file')
              ->andWhere('attribute.file_multiple=:multiple')
              ->setParameter('multiple', '1')
              ->execute();
  
          while ($row = $attributes->fetch(\PDO::FETCH_OBJ)) {
              if ($this->fieldExists($row->colname . '__sort', $row->tableName)) {
                  continue;
              }
              $this
                  ->connection
                  ->exec(
                      \sprintf(
                          'ALTER TABLE %1$s ADD COLUMN %2$s__sort %3$s',
                          $row->tableName,
                          $row->colname,
                          'blob NULL'
                      )
                  );
          }
      }
code_tokens: private function ensureOrderColumnExists ( ) { $ attributes = $ this -> connection -> createQueryBuilder ( ) -> select ( 'metamodel.tableName' , 'attribute.colname' ) -> from ( 'tl_metamodel_attribute' , 'attribute' ) -> leftJoin ( 'attribute' , 'tl_metamodel' , 'metamodel' , 'metamodel.id=attribute.pid' ) -> where ( 'attribute.type=:type' ) -> setParameter ( 'type' , 'file' ) -> andWhere ( 'attribute.file_multiple=:multiple' ) -> setParameter ( 'multiple' , '1' ) -> execute ( ) ; while ( $ row = $ attributes -> fetch ( \ PDO :: FETCH_OBJ ) ) { if ( $ this -> fieldExists ( $ row -> colname . '__sort' , $ row -> tableName ) ) { continue ; } $ this -> connection -> exec ( \ sprintf ( 'ALTER TABLE %1$s ADD COLUMN %2$s__sort %3$s' , $ row -> tableName , $ row -> colname , 'blob NULL' ) ) ; } }
docstring: Ensure that the order column exists.
  
  @return void
docstring_tokens: Ensure that the order column exists .