You are here

function skinr_schema in Skinr 6.2

Same name and namespace in other branches
  1. 7.2 skinr.install \skinr_schema()

Implementation of hook_schema.

File

./skinr.install, line 11
skinr.install Contains install, update, and uninstall functions for Skinr.

Code

function skinr_schema() {
  $schema['skinr'] = array(
    'description' => 'Stores skinr data.',
    'fields' => array(
      'theme' => array(
        'description' => 'The system name of the theme.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'module' => array(
        'description' => 'The module this skinr settings is for.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'sid' => array(
        'description' => 'A unique identifier for this skinr datum.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'skins' => array(
        'description' => 'The skins set for this datum.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
      'settings' => array(
        'description' => 'Custom settings for this id.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'theme',
      'module',
      'sid',
    ),
    'indexes' => array(
      'theme' => array(
        'theme',
      ),
      'module' => array(
        'module',
      ),
      'sid' => array(
        'sid',
      ),
    ),
  );
  $schema['skinr_rules'] = array(
    'description' => 'Stores skinr page rule data.',
    'fields' => array(
      'rid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique skinr page rule ID.',
      ),
      'title' => array(
        'description' => 'The administrative title for this rule.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'roles' => array(
        'type' => 'text',
        'size' => 'normal',
        'not null' => FALSE,
        'serialize' => TRUE,
        'description' => 'A serialized array of roles for this record.',
      ),
      'visibility' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'Flag to indicate how to show on pages. (0 = Show on all pages except listed pages, 1 = Show only on listed pages, 2 = Use custom PHP code to determine visibility.)',
      ),
      'pages' => array(
        'type' => 'text',
        'not null' => TRUE,
        'description' => 'Contents of the "Pages" block; contains either a list of paths on which to include/exclude the region or PHP code, depending on the visibility setting.',
      ),
    ),
    'primary key' => array(
      'rid',
    ),
  );
  $schema['skinr_skinsets'] = array(
    'description' => "A list of all non-theme skinsets that are or have been installed in Drupal's file system.",
    'fields' => array(
      'filename' => array(
        'description' => 'The path of the primary file for this item, relative to the Drupal root; e.g. skins/skinset/skinset.info.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'name' => array(
        'description' => 'The name of the item; e.g. skinset.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        'description' => 'Boolean indicating whether or not this item is enabled.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'info' => array(
        'description' => "A serialized array containing information from the skinset's .info file; keys can include name, description, package, version, core, and skinr.",
        'type' => 'text',
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'filename',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['skinr_skins'] = array(
    'description' => 'Keeps track of the whether a skin is enabled for a specific skinset and theme.',
    'fields' => array(
      'name' => array(
        'description' => 'The name of the skinset or theme that this skin belongs to.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'description' => 'The type of this item; skinset or theme.',
        'type' => 'varchar',
        'length' => 16,
        'not null' => TRUE,
        'default' => '',
      ),
      'skin' => array(
        'description' => 'The name of the skin which you are saving settings for.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'status' => array(
        'description' => 'A serialized array of values for each theme indicating whether or not the skin is enabled.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'name',
      'skin',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
      'skin' => array(
        'skin',
      ),
    ),
  );
  return $schema;
}