You are here

function photos_access_schema in Album Photos 8.5

Same name and namespace in other branches
  1. 8.4 photos_access/photos_access.install \photos_access_schema()
  2. 7.3 photos_access/photos_access.install \photos_access_schema()
  3. 6.0.x photos_access/photos_access.install \photos_access_schema()

Implements hook_schema().

File

photos_access/photos_access.install, line 13
Install, update, and uninstall functions for the Photos Access module.

Code

function photos_access_schema() {
  $schema['photos_access_album'] = [
    'fields' => [
      'id' => [
        'type' => 'serial',
        'not null' => TRUE,
      ],
      'nid' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'viewid' => [
        'type' => 'int',
        'size' => 'tiny',
        'length' => 1,
        'default' => 0,
        'description' => '0: Open, 1: Locked, 2: User list, 3: Password',
      ],
      'pass' => [
        'type' => 'varchar',
        'length' => 128,
        'default' => '',
      ],
    ],
    'indexes' => [
      'nid' => [
        'nid',
      ],
    ],
    'primary key' => [
      'id',
    ],
  ];
  $schema['photos_access_user'] = [
    'fields' => [
      'id' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'uid' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'collaborate' => [
        'type' => 'int',
        'size' => 'tiny',
        'length' => 1,
        'default' => 0,
      ],
    ],
    'indexes' => [
      'uid' => [
        'uid',
      ],
    ],
  ];
  return $schema;
}