You are here

function party_activity_schema in Party 7

Same name and namespace in other branches
  1. 8.2 modules/party_activity/party_activity.install \party_activity_schema()

Implements hook_schema()

File

modules/party_activity/party_activity.install, line 9
Install scripts and other things for the party activity module

Code

function party_activity_schema() {
  $schema['party_activity_type'] = array(
    'description' => 'Stores information about Party Activity Types',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique Activity type identifier',
      ),
      'type' => array(
        'description' => 'The machine-readable name of this activity type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'label' => array(
        'description' => 'The human-readable name of this activity type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'data' => array(
        'description' => 'A serialized array of extra settings',
        'type' => 'text',
        'size' => 'big',
        'serialize' => TRUE,
        'not null' => FALSE,
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
        'description' => 'The weight of this model type in relation to others.',
      ),
    ) + entity_exportable_schema_fields(),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'type' => array(
        'type',
      ),
    ),
  );
  $schema['party_activity'] = array(
    'description' => 'Stores information about Party Activities',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique Party Activity Identifier',
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'The title of this party activity',
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => 255,
        'description' => 'Bundle Key: The type of aqctivity this is',
        'not null' => TRUE,
        'default' => '',
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'When this activity was created',
      ),
      'modified' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'When this activity was last modified',
      ),
      'user' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The User ID of the the creator of this activity',
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'type' => array(
        'type',
      ),
    ),
    'foreign keys' => array(
      'user' => array(
        'table' => 'users',
        'columns' => array(
          'user' => 'uid',
        ),
      ),
    ),
  );
  return $schema;
}