pierre@0: . pierre@0: */ pierre@0: pierre@0: /** pierre@0: * Implementation of hook_schema(). pierre@0: */ pierre@0: function ad_text_schema() { pierre@0: $schema['ad_text'] = array( pierre@0: 'description' => 'The ad_text table stores sources of text ads.', pierre@0: 'fields' => array( pierre@0: 'aid' => array( pierre@0: 'type' => 'int', pierre@0: 'unsigned' => TRUE, pierre@0: 'not null' => TRUE, pierre@0: 'default' => 0, pierre@0: ), pierre@0: 'url' => array( pierre@0: 'type' => 'varchar', pierre@0: 'length' => '255', pierre@0: 'not null' => TRUE, pierre@0: 'default' => '', pierre@0: ), pierre@0: 'adheader' => array( pierre@0: 'type' => 'varchar', pierre@0: 'length' => '255', pierre@0: 'not null' => TRUE, pierre@0: 'default' => '', pierre@0: ), pierre@0: 'adbody' => array( pierre@0: 'type' => 'text', pierre@0: 'not null' => FALSE, pierre@0: ), pierre@0: ), pierre@0: 'primary key' => array('aid'), pierre@0: ); pierre@0: pierre@0: return $schema; pierre@0: } pierre@0: pierre@0: /** pierre@0: * ad_text module installation. pierre@0: */ pierre@0: function ad_text_install() { pierre@0: drupal_install_schema('ad_text'); pierre@0: } pierre@0: pierre@0: /** pierre@0: * Allow complete uninstallation of the ad_text module. pierre@0: */ pierre@0: function ad_text_uninstall() { pierre@0: // Delete all ad_text content. pierre@0: $result = db_query("SELECT aid FROM {ad_text}"); pierre@0: while ($aid = db_result($result)) { pierre@0: node_delete($aid); pierre@0: } pierre@0: pierre@0: // Remove tables. pierre@0: drupal_uninstall_schema('ad_text'); pierre@0: }