You are here

function _migrate_message_table_schema in Migrate 6

Generate a message table schema record, given the source PK definition

Parameters

$sourcefield: Schema definition for the content set source's PK

Return value

Schema structure for a message table

3 calls to _migrate_message_table_schema()
MigrateUnitTest::testCRUD in tests/migrate_api.test
Test API for managing content sets
migrate_save_content_set in ./migrate.module
Save a new or updated content set
migrate_schema_alter in ./migrate.module
Implementation of hook_schema_alter().

File

./migrate.module, line 1401
This module provides tools at "administer >> content >> migrate" for analyzing data from various sources and importing them into Drupal tables.

Code

function _migrate_message_table_schema($sourcefield) {
  $schema = array(
    'description' => t('Import errors'),
    'fields' => array(
      'mceid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'sourceid' => $sourcefield,
      'level' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 1,
      ),
      'message' => array(
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'mceid',
    ),
    'indexes' => array(
      'sourceid' => array(
        'sourceid',
      ),
    ),
  );
  return $schema;
}