/[drupal]/contributions/modules/teaser_block/teaser_block.install
ViewVC logotype

Contents of /contributions/modules/teaser_block/teaser_block.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Fri Sep 12 21:39:28 2008 UTC (14 months, 2 weeks ago) by sun
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +41 -58 lines
File MIME type: text/x-php
#302527 by sun: Ported Teaser block to Drupal 6.x.
1 <?php
2 // $Id: teaser_block.install,v 1.2 2008/04/10 00:34:02 sun Exp $
3
4 /**
5 * Implementation of hook_schema().
6 */
7 function teaser_block_schema() {
8 $schema['teaser_block'] = array(
9 'description' => t('Stores user generated teaser blocks for nodes.'),
10 'fields' => array(
11 'bid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE,
12 'description' => t('The primary identifier for a teaser block.'),
13 ),
14 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0,
15 'description' => t('The linked node id of a teaser block.'),
16 ),
17 'title' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '',
18 'description' => t('The title of a teaser block.'),
19 ),
20 'body' => array('type' => 'text', 'size' => 'big',
21 'description' => t('The content of a teaser block.'),
22 ),
23 'info' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '',
24 'description' => t('The administrative description of a teaser block.'),
25 ),
26 'format' => array('type' => 'int', 'size' => 'tiny', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0,
27 'description' => t('The input format of a teaser block.'),
28 ),
29 ),
30 'primary key' => array('bid'),
31 'unique keys' => array(
32 'info' => array('info'),
33 ),
34 );
35 return $schema;
36 }
37
38 /**
39 * Implementation of hook_install().
40 */
41 function teaser_block_install() {
42 drupal_install_schema('teaser_block');
43 }
44
45 /**
46 * Implementation of hook_uninstall().
47 */
48 function teaser_block_uninstall() {
49 drupal_uninstall_schema('teaser_block');
50 db_query("DELETE FROM {variable} WHERE name LIKE 'teaser_block_%%'");
51 }
52

  ViewVC Help
Powered by ViewVC 1.1.2