crop-1.0-alpha2-installed.php in Crop API 8
Same filename and directory in other branches
A database agnostic dump for testing purposes.
This file was generated by the Drupal 8.0 db-tools.php script.
File
tests/fixtures/crop-1.0-alpha2-installed.phpView source
<?php
// @codingStandardsIgnoreFile
/**
* @file
* A database agnostic dump for testing purposes.
*
* This file was generated by the Drupal 8.0 db-tools.php script.
*/
use Drupal\Core\Database\Database;
$connection = Database::getConnection();
// Update core.extension.
$extensions = $connection
->select('config')
->fields('config', [
'data',
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute()
->fetchField();
$extensions = unserialize($extensions);
$extensions['module']['crop'] = 8000;
$connection
->update('config')
->fields([
'data' => serialize($extensions),
'collection' => '',
'name' => 'core.extension',
])
->condition('collection', '')
->condition('name', 'core.extension')
->execute();
$connection
->schema()
->createTable('crop', array(
'fields' => array(
'cid' => array(
'type' => 'serial',
'not null' => TRUE,
'size' => 'normal',
'unsigned' => TRUE,
),
'vid' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'type' => array(
'type' => 'varchar_ascii',
'not null' => TRUE,
'length' => '32',
),
'uuid' => array(
'type' => 'varchar_ascii',
'not null' => TRUE,
'length' => '128',
),
'langcode' => array(
'type' => 'varchar_ascii',
'not null' => TRUE,
'length' => '12',
),
),
'primary key' => array(
'cid',
),
'unique keys' => array(
'crop_field__uuid__value' => array(
'uuid',
),
'crop__vid' => array(
'vid',
),
),
'indexes' => array(
'crop_field__type__target_id' => array(
'type',
),
),
'mysql_character_set' => 'utf8mb4',
));
$connection
->schema()
->createTable('crop_field_data', array(
'fields' => array(
'cid' => array(
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
'unsigned' => TRUE,
),
'vid' => array(
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
'unsigned' => TRUE,
),
'type' => array(
'type' => 'varchar_ascii',
'not null' => TRUE,
'length' => '32',
),
'langcode' => array(
'type' => 'varchar_ascii',
'not null' => TRUE,
'length' => '12',
),
'entity_id' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'entity_type' => array(
'type' => 'varchar',
'not null' => FALSE,
'length' => '255',
),
'uri' => array(
'type' => 'varchar',
'not null' => FALSE,
'length' => '255',
),
// 'image_style' => array(
// 'type' => 'varchar_ascii',
// 'not null' => FALSE,
// 'length' => '255',
// ),
'height' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'width' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'x' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'y' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'default_langcode' => array(
'type' => 'int',
'not null' => TRUE,
'size' => 'tiny',
),
'revision_translation_affected' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'tiny',
),
),
'primary key' => array(
'cid',
'langcode',
),
'indexes' => array(
'crop__id__default_langcode__langcode' => array(
'cid',
'default_langcode',
'langcode',
),
'crop__vid' => array(
'vid',
),
'crop_field__type__target_id' => array(
'type',
),
),
'mysql_character_set' => 'utf8mb4',
));
$connection
->schema()
->createTable('crop_field_revision', array(
'fields' => array(
'cid' => array(
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
'unsigned' => TRUE,
),
'vid' => array(
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
'unsigned' => TRUE,
),
'langcode' => array(
'type' => 'varchar_ascii',
'not null' => TRUE,
'length' => '12',
),
'entity_id' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'entity_type' => array(
'type' => 'varchar',
'not null' => FALSE,
'length' => '255',
),
'uri' => array(
'type' => 'varchar',
'not null' => FALSE,
'length' => '255',
),
// 'image_style' => array(
// 'type' => 'varchar_ascii',
// 'not null' => FALSE,
// 'length' => '255',
// ),
'height' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'width' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'x' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'y' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'default_langcode' => array(
'type' => 'int',
'not null' => TRUE,
'size' => 'tiny',
),
'revision_translation_affected' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'tiny',
),
),
'primary key' => array(
'vid',
'langcode',
),
'indexes' => array(
'crop__id__default_langcode__langcode' => array(
'cid',
'default_langcode',
'langcode',
),
),
'mysql_character_set' => 'utf8mb4',
));
$connection
->schema()
->createTable('crop_revision', array(
'fields' => array(
'cid' => array(
'type' => 'int',
'not null' => TRUE,
'size' => 'normal',
'unsigned' => TRUE,
),
'vid' => array(
'type' => 'serial',
'not null' => TRUE,
'size' => 'normal',
'unsigned' => TRUE,
),
'langcode' => array(
'type' => 'varchar_ascii',
'not null' => TRUE,
'length' => '12',
),
'revision_default' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'tiny',
),
'revision_uid' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
'unsigned' => TRUE,
),
'revision_timestamp' => array(
'type' => 'int',
'not null' => FALSE,
'size' => 'normal',
),
'revision_log' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
),
),
'primary key' => array(
'vid',
),
'indexes' => array(
'crop__cid' => array(
'cid',
),
'crop_field__revision_uid__target_id' => array(
'revision_uid',
),
),
'mysql_character_set' => 'utf8mb4',
));
$connection
->insert('key_value')
->fields(array(
'collection',
'name',
'value',
))
->values(array(
'collection' => 'entity.definitions.installed',
'name' => 'crop.entity_type',
'value' => 'O:36:"Drupal\\Core\\Entity\\ContentEntityType":42:{s:25:"