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

Contents of /contributions/modules/geonames/geonames.install

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


Revision 1.1 - (show annotations) (download) (as text)
Sat May 10 17:53:59 2008 UTC (18 months, 2 weeks ago) by serosero
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--2
File MIME type: text/x-php
Initial Drupal 6 release
1 <?php
2 // $Id
3
4 /**
5 * Implementation of hook_schema()
6 */
7 function geonames_schema() {
8 $schema['geonames_countryinfo'] = array(
9 'fields' => array(
10 'iso_alpha2' => array(
11 'type' => 'varchar',
12 'not null' => true,
13 'length' => 2,
14 ),
15 'iso_alpha3' => array(
16 'type' => 'varchar',
17 'not null' => true,
18 'length' => 3,
19 ),
20 'iso_numeric' => array(
21 'type' => 'int',
22 'not null' => true,
23 'size' => 'tiny',
24 'unsigned' => true,
25 ),
26 'fips_code' => array(
27 'type' => 'varchar',
28 'not null' => true,
29 'length' => 3,
30 ),
31 'name' => array(
32 'type' => 'varchar',
33 'not null' => true,
34 'length' => 60,
35 ),
36 'capital' => array(
37 'type' => 'varchar',
38 'not null' => true,
39 'length' => 60,
40 ),
41 'areainsqkm' => array(
42 'type' => 'varchar',
43 'not null' => true,
44 'length' => 11,
45 ),
46 'population' => array(
47 'type' => 'varchar',
48 'not null' => true,
49 'length' => 11,
50 ),
51 'continent' => array(
52 'type' => 'varchar',
53 'not null' => true,
54 'length' => 2,
55 ),
56 'languages' => array(
57 'type' => 'varchar',
58 'not null' => true,
59 'length' => 100,
60 ),
61 'currency' => array(
62 'type' => 'varchar',
63 'not null' => true,
64 'length' => 3,
65 ),
66 'geonameid' => array(
67 'type' => 'int',
68 'not null' => true,
69 'unsigned' => true,
70 ),
71 ),
72 'indexes' => array(
73 'iso_alpha3' => array('iso_alpha3'),
74 'iso_numeric' => array('iso_numeric'),
75 'fips_code' => array('fips_code'),
76 'continent' => array('continent'),
77 'currency' => array('currency'),
78 'iso_alpha2' => array('iso_alpha2'),
79 ),
80 'primary key' => array('geonameid'),
81 );
82
83 $schema['geonames_featurecodes'] = array(
84 'fields' => array(
85 'class' => array(
86 'type' => 'varchar',
87 'length' => 1,
88 'not null' => true,
89 ),
90 'code' => array(
91 'type' => 'varchar',
92 'length' => 4,
93 'not null' => true,
94 ),
95 'name' => array(
96 'type' => 'varchar',
97 'not null' => true,
98 'length' => 40,
99 ),
100 'description' => array(
101 'type' => 'varchar',
102 'not null' => true,
103 'length' => 255,
104 ),
105 ),
106 'primary key' => array('class,code'),
107 );
108
109 return $schema;
110 }
111
112 /**
113 * Implementation of hook_install()
114 */
115 function geonames_install() {
116 drupal_install_schema('geonames');
117 }
118
119 /**
120 * Implementation of hook_uninstall()
121 */
122 function geonames_uninstall() {
123 drupal_uninstall_schema('geonames');
124 }

  ViewVC Help
Powered by ViewVC 1.1.2