Skip to content

Commit 5a35d20

Browse files
committed
Fix osm_places table on plugin install #104
1 parent 4de7599 commit 5a35d20

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

maintain.inc.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,22 @@ function plugin_install()
120120
if (file_exists($gpx_dir) and is_dir($gpx_dir))
121121
osm_deltree($gpx_dir);
122122

123+
// Easy access
124+
if (!defined('osm_place_table'))
125+
define('osm_place_table', $prefixeTable.'osm_places');
126+
127+
/* Table to hold osm places details */
128+
$q = 'CREATE TABLE IF NOT EXISTS `'.osm_place_table.'` (
129+
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
130+
`latitude` double(8,6) NOT NULL,
131+
`longitude` double(8,6) NOT NULL,
132+
`name` varchar(255) DEFAULT NULL,
133+
`parentId` mediumint(8),
134+
PRIMARY KEY (id)
135+
) ENGINE=MyISAM DEFAULT CHARSET=utf8
136+
;';
137+
pwg_query($q);
138+
123139
// Create world map link
124140
$dir_name = basename( dirname(__FILE__) );
125141
$c = <<<EOF

0 commit comments

Comments
 (0)