You are here

function smiley_schema in Smiley 7

Same name and namespace in other branches
  1. 6 smiley.install \smiley_schema()

Implements hook_schema().

File

./smiley.install, line 93
Installs, updates, and uninstalls smiley.

Code

function smiley_schema() {
  $schema['smiley'] = array(
    'description' => 'Stores smiley',
    'fields' => array(
      'sid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Primary Key: Unique smiley ID.',
      ),
      'uri' => array(
        'description' => 'Smiley picture name.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'status' => array(
        'description' => 'Boolean indicating whether the smiley is allowed.',
        'type' => 'int',
        'default' => 0,
      ),
      'acronyms' => array(
        'description' => 'Smiley acronyms.',
        'type' => 'varchar',
        'length' => 128,
        'default' => '',
      ),
      'description' => array(
        'description' => 'Smiley description.',
        'type' => 'varchar',
        'length' => 64,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'sid',
    ),
    'unique keys' => array(
      'uri' => array(
        'uri',
      ),
    ),
  );
  return $schema;
}