function fontyourface_6200_schema in @font-your-face 6.2
Same name and namespace in other branches
- 7 fontyourface.install \fontyourface_6200_schema()
Re-usable function for the 6.2 schema.
2 calls to fontyourface_6200_schema()
- fontyourface_schema in ./
fontyourface.install - Implements hook_schema.
- fontyourface_update_6200 in ./
fontyourface.install - Implements hook_update_N().
File
- ./
fontyourface.install, line 29 - Adds fontyourface tables for tracking fonts.
Code
function fontyourface_6200_schema() {
$schema = array();
$schema['fontyourface_font'] = array(
'description' => 'Font information.',
'fields' => array(
'fid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary Key: Unique font ID.',
),
'name' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'The font name.',
),
'enabled' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Whether or not the font is enabled. (0 = disabled, 1 = enabled)',
),
'url' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'A URL for the font.',
),
'provider' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'The module providing the font.',
),
'css_selector' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => 'CSS selector for applying the font.',
),
'css_family' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'CSS family for the font.',
),
'css_style' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'CSS style for the font.',
),
'css_weight' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'CSS weight for the font.',
),
'foundry' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'Foundry for the font.',
),
'foundry_url' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'URL for foundry for the font.',
),
'license' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'License for the font.',
),
'license_url' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => 'URL for license for the font.',
),
'metadata' => array(
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
'description' => 'Additional serialized metadata about the font.',
),
),
'indexes' => array(
'enabled' => array(
'enabled',
),
),
'unique keys' => array(
'url' => array(
'url',
),
),
'primary key' => array(
'fid',
),
);
$schema['fontyourface_tag'] = array(
'description' => 'Font tag information.',
'fields' => array(
'tid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'Primary Key: Unique tag ID.',
),
'name' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'The font name.',
),
),
'primary key' => array(
'tid',
),
);
$schema['fontyourface_tag_font'] = array(
'description' => 'Relationship information between fonts and tags.',
'fields' => array(
'fid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Foreign Key: the unique ID of the font.',
),
'tid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Foreign Key: the unique ID of the tag.',
),
),
'indexes' => array(
'fid' => array(
'fid',
),
'tid' => array(
'tid',
),
),
'primary key' => array(
'fid',
'tid',
),
);
return $schema;
}