You are here

protected function MediaMigrationDatabaseTraitTest::updateSourceDbWithFileTypeColumn in Media Migration 8

Updates the source DB's fiel_managed tabke with a type column.

1 call to MediaMigrationDatabaseTraitTest::updateSourceDbWithFileTypeColumn()
MediaMigrationDatabaseTraitTest::testGetFileEntityBaseQuery in tests/src/Kernel/Plugin/migrate/source/d7/MediaMigrationDatabaseTraitTest.php
@covers ::getFileEntityBaseQuery

File

tests/src/Kernel/Plugin/migrate/source/d7/MediaMigrationDatabaseTraitTest.php, line 710

Class

MediaMigrationDatabaseTraitTest
@coversDefaultClass \Drupal\media_migration\Plugin\migrate\source\d7\MediaMigrationDatabaseTrait

Namespace

Drupal\Tests\media_migration\Kernel\Plugin\migrate\source\d7

Code

protected function updateSourceDbWithFileTypeColumn() {
  $this->sourceDatabase
    ->schema()
    ->addField('file_managed', 'type', [
    'type' => 'varchar',
    'not null' => TRUE,
    'length' => '50',
    'default' => 'undefined',
    'initial' => 'image',
  ]);
  $this->sourceDatabase
    ->update('file_managed')
    ->fields([
    'type' => 'document',
  ])
    ->condition('fid', 3)
    ->execute();
}