pierre@0: . pierre@0: */ pierre@0: pierre@0: /** pierre@0: * Implementation of hook_schema(). pierre@0: */ pierre@0: function ad_html_schema() { pierre@0: $schema['ad_html'] = array( pierre@0: 'description' => 'The ad_html table stores HTML code of html 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: 'html' => array( pierre@0: 'type' => 'text', pierre@0: 'not null' => FALSE, pierre@0: ), pierre@0: ), pierre@0: 'primary key' => array('aid'), pierre@0: ); pierre@0: return $schema; pierre@0: } pierre@0: pierre@0: /** pierre@0: * ad_html module installation. pierre@0: */ pierre@0: function ad_html_install() { pierre@0: drupal_install_schema('ad_html'); pierre@0: } pierre@0: pierre@0: /** pierre@0: * Allow complete uninstallation of the ad_html module. pierre@0: */ pierre@0: function ad_html_uninstall() { pierre@0: // Delete all ad_html content. pierre@0: $result = db_query("SELECT aid FROM {ad_html}"); 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_html'); pierre@0: }