You are here

function sendinblue_schema in SendinBlue 7

Same name and namespace in other branches
  1. 8.2 sendinblue.install \sendinblue_schema()
  2. 8 sendinblue.install \sendinblue_schema()
  3. 7.2 sendinblue.install \sendinblue_schema()

Implements hook_schema().

File

./sendinblue.install, line 11
Install, update and uninstall functions for the sendinblue module.

Code

function sendinblue_schema() {
  $schema['sendinblue_signup'] = array(
    'fields' => array(
      'mcsId' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique sendinblue_signup entity ID.',
      ),
      'name' => array(
        'description' => 'The machine-readable name of this sendinblue_signup.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'mcLists' => array(
        'type' => 'blob',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized array of list IDs with list-specific configuration.',
      ),
      'mode' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Signifies the display mode for this signup form.',
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 32,
        'description' => 'The {sendinblue_lists}.label of this sendinblue_list.',
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized object that stores the settings for the specific list.',
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        // Set the default to ENTITY_CUSTOM without using the constant as it is
        // not safe to use it at this point.
        'default' => 0x1,
        'size' => 'tiny',
        'description' => 'The exportable status of the entity.',
      ),
      'module' => array(
        'description' => 'The name of the providing module if the entity has been defined in code.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'mcsId',
    ),
    'unique key' => array(
      'name',
    ),
  );
  $schema['sendinblue_contact'] = array(
    'fields' => array(
      'sc_id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique sendinblue_contact entity ID.',
      ),
      'email' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => 'Unique Key: Unique the email of a subscriber.',
      ),
      'info' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => 'All information of a subscriber.',
      ),
      'code' => array(
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'description' => 'Unique identifier for a subscriber on frontend.',
      ),
      'is_active' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
        'size' => 'tiny',
      ),
    ),
    'primary key' => array(
      'sc_id',
    ),
    'unique key' => array(
      'email',
    ),
  );
  return $schema;
}