You are here

function gdpr_fields_schema in General Data Protection Regulation 7

Implements hook_schema().

File

modules/gdpr_fields/gdpr_fields.install, line 11
Install file for the GDPR Fields module.

Code

function gdpr_fields_schema() {
  $schema['gdpr_fields_field_data'] = array(
    'description' => 'Stores GDPR field data.',
    'export' => array(
      'key' => 'name',
      'key name' => 'Name',
      'primary key' => 'name',
      'identifier' => 'field',
      'default hook' => 'gdpr_fields_default_field_data',
      'object' => 'GDPRFieldData',
    ),
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'Machine name for field.',
        'not null' => TRUE,
      ),
      'entity_type' => array(
        'type' => 'varchar',
        'length' => 128,
        'description' => 'Entity type of field.',
      ),
      'entity_bundle' => array(
        'type' => 'varchar',
        'length' => 128,
        'description' => 'Entity bundle of field.',
      ),
      'property_name' => array(
        'type' => 'varchar',
        'length' => 128,
        'description' => 'Name of the property.',
      ),
      'settings' => array(
        'type' => 'text',
        'size' => 'big',
        'description' => 'Additional settings.',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'name',
    ),
    'keys' => array(
      'enabled' => array(
        'enabled',
      ),
    ),
  );
  return $schema;
}