summaryrefslogtreecommitdiff
path: root/modules/profile/profile.schema
blob: 64bf356207df32a37581058b2a98926b0f0cbfa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
// $Id$

function profile_schema() {
  $schema['profile_fields'] = array(
    'fields' => array(
      'fid'          => array('type' => 'serial', 'not null' => TRUE),
      'title'        => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
      'name'         => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE),
      'explanation'  => array('type' => 'text', 'not null' => FALSE),
      'category'     => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
      'page'         => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
      'type'         => array('type' => 'varchar', 'length' => 128, 'not null' => FALSE),
      'weight'       => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
      'required'     => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
      'register'     => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
      'visibility'   => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
      'autocomplete' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'),
      'options'      => array('type' => 'text', 'not null' => FALSE)
    ),
    'indexes' => array('category' => array('category')),
    'unique keys' => array('name' => array('name')),
    'primary key' => array('fid'),
  );

  $schema['profile_values'] = array(
    'fields' => array(
      'fid'   => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
      'uid'   => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0),
      'value' => array('type' => 'text', 'not null' => FALSE)
    ),
    'indexes' => array(
      'fid' => array('fid'),
      'uid' => array('uid')
    ),
  );

  return $schema;
}