/[drupal]/contributions/modules/countries_api/contrib/continents_api/continents_api.install
ViewVC logotype

Diff of /contributions/modules/countries_api/contrib/continents_api/continents_api.install

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

revision 1.1.4.1, Sat Jul 18 09:26:52 2009 UTC revision 1.1.4.2, Sat Jul 18 09:29:19 2009 UTC
# Line 0  Line 1 
1    <?php
2    // $Id$
3    
4    /**
5     * @file
6     * Install file for Continents API.
7     */
8    
9    /**
10     * Implementation of hook_schema().
11     */
12    function continents_api_schema() {
13      $schema['continents_api_continents'] = array(
14        'description' => 'Mapping of continent codes to country codes.',
15        'fields' => array(
16          'continent' => array(
17            'description' => 'Continent code.',
18            'type'        => 'char',
19            'length'      => 2,
20            'not null'    => TRUE,
21          ),
22          'country' => array(
23            'description' => 'ISO 3166 alpha-2 country code.',
24            'type'        => 'char',
25            'length'      => 2,
26            'not null'    => TRUE,
27          ),
28        ),
29        'primary key' => array('continent', 'country'),
30      );
31    
32      return $schema;
33    }
34    
35    /**
36     * Implementation of hook_install().
37     */
38    function continents_api_install() {
39      // Create tables.
40      drupal_install_schema('continents_api');
41    
42      // Include continents_api module include for initial data import.
43      require_once(dirname(__FILE__) .'/continents_api.module');
44      continents_api_csv_import_continents();
45    }
46    
47    /**
48     * Implementation of hook_uninstall().
49     */
50    function continents_api_uninstall() {
51      // Remove tables.
52      drupal_uninstall_schema('continents_api');
53    }

Legend:
Removed from v.1.1.4.1  
changed lines
  Added in v.1.1.4.2

  ViewVC Help
Powered by ViewVC 1.1.2