You are here

function simple_popup_blocks_schema in Simple Popup Blocks 8

Same name and namespace in other branches
  1. 8.2 simple_popup_blocks.install \simple_popup_blocks_schema()

Implements hook_schema().

Defines the database tables used by this module.

See also

hook_schema()

File

./simple_popup_blocks.install, line 17
Install, update and uninstall functions for the dbtng_example module.

Code

function simple_popup_blocks_schema() {
  $schema['simple_popup_blocks'] = [
    'description' => 'Stores simple_popup_blocks entries.',
    'fields' => [
      'pid' => [
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique simple_popup_blocks ID.',
      ],
      'identifier' => [
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => "Popup identifier",
      ],
      'type' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => "Popup types i.e drupal block or custom",
      ],
      'css_selector' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => "Css selector for div",
      ],
      'layout' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 4,
        'description' => "Popup layout",
      ],
      'visit_counts' => [
        'type' => 'blob',
        'size' => 'big',
        'not null' => FALSE,
        'description' => 'Visit counts value',
      ],
      'overlay' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
        'description' => "Popup overlay. 1 is true",
      ],
      'escape' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
        'description' => "ESC button to close popup",
      ],
      'trigger_method' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => "Popup trigger method",
      ],
      'trigger_selector' => [
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => "Popup trigger selector",
      ],
      'delay' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => "Popup delay in seconds",
      ],
      'minimize' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
        'description' => "Enable Popup minimize button",
      ],
      'close' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
        'description' => "Enable Popup close button",
      ],
      'width' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 400,
        'description' => "Popup width in px",
      ],
      'status' => [
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
        'description' => "Popup status",
      ],
    ],
    'primary key' => [
      'pid',
    ],
    'unique keys' => [
      'identifier' => [
        'identifier',
      ],
    ],
  ];
  return $schema;
}