Browse Source

make it work

master
Markus Bergholz 1 year ago
parent
commit
012804d90d
  1. 34
      README.md
  2. 324
      mariadb-osm.sql

34
README.md

@ -1,31 +1,17 @@
# README #
# README
This project enables the use of [Osmosis](http://wiki.openstreetmap.org/wiki/Osmosis) ([Github](https://github.com/openstreetmap/osmosis)) to import (an extract of) the [planet.osm](http://wiki.openstreetmap.org/wiki/Planet.osm) using OSM 0.6 API into a MySQL database.
The support officially has been dropped for MySQL/Mariadb.
However, it is still possible using OSM 0.6 API.
The support officially has been dropped, but I needed a MySQL compatible representation of the data.
Tested with MariaDB 10.3.22 and 10.4.12 using Osmosis Version 0.47.4
I found an (the?) old mysql schema on [Brett Henderson](https://github.com/brettch)'s Homepage and started from there. If you are interested in the changes I made, take a look into the [problems](PROBLEMS.md) and the history of git repository.
# History
## Import planet.osm.bz2 into a MySQL Database ##
> https://github.com/oschrenk/osmosis-mysql
> I found an (the?) old mysql schema on [Brett Henderson](https://github.com/brettch)'s Homepage and started from there. If you are interested in the changes I made, take a look into the [problems](PROBLEMS.md) and the history of git repository.
Install Omosis
$ brew install osmosis
Install MySQL
$ brew install mysql
$ unset TMPDIR
$ mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
$ mysql.server start
$ /usr/local/opt/mysql/bin/mysql_secure_installation
We follow the naming scheme in the script and create database and user accordingly
$ mysql -u root -p
mysql> CREATE DATABASE api06_test;
mysql> GRANT ALL PRIVILEGES ON api06_test.* TO osm@localhost IDENTIFIED BY 'osm';
mysql > exit;
# Import osm.bz2 into mariadb
Get the latest version of my mysql schema script based on Brett Henderson's work
@ -33,11 +19,11 @@ Get the latest version of my mysql schema script based on Brett Henderson's work
Create the schema using the sql script
mysql -u osm -p -h localhost api06_test < mysql-apidb06.sql
mysql -u osm -posm -h localhost < mariadb-osm.sql
Read data and populate database
osmosis --read-xml file="bremen.osm.bz2" --write-apidb-0.6 host="127.0.0.1" dbType="mysql" database="api06_test" user="osm" password="osm" validateSchemaVersion=no
./bin/osmosis --read-xml file="andorra-latest.osm.bz2" --write-apidb-0.6 host="127.0.0.1" dbType="mysql" database="osm" user="osm" password="osm" validateSchemaVersion=no
## Usage ##

324
mysql-apidb06.sql → mariadb-osm.sql

@ -1,9 +1,3 @@
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.0.77
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
@ -15,20 +9,20 @@
--
-- Create schema api06_test
-- Create schema osm
--
CREATE DATABASE IF NOT EXISTS api06_test
CREATE DATABASE IF NOT EXISTS osm
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_bin;
USE api06_test;
USE osm;
--
-- Definition of table `api06_test`.`acls`
-- Definition of table `osm`.`acls`
--
DROP TABLE IF EXISTS `api06_test`.`acls`;
CREATE TABLE `api06_test`.`acls` (
DROP TABLE IF EXISTS `osm`.`acls`;
CREATE TABLE `osm`.`acls` (
`id` int(11) NOT NULL auto_increment,
`address` int(10) unsigned NOT NULL,
`netmask` int(10) unsigned NOT NULL,
@ -36,10 +30,10 @@ CREATE TABLE `api06_test`.`acls` (
`v` varchar(255) default NULL,
PRIMARY KEY (`id`),
KEY `acls_k_idx` (`k`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`acls`
-- Dumping data for table `osm`.`acls`
--
/*!40000 ALTER TABLE `acls` DISABLE KEYS */;
@ -49,19 +43,19 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`changeset_tags`
-- Definition of table `osm`.`changeset_tags`
--
DROP TABLE IF EXISTS `api06_test`.`changeset_tags`;
CREATE TABLE `api06_test`.`changeset_tags` (
DROP TABLE IF EXISTS `osm`.`changeset_tags`;
CREATE TABLE `osm`.`changeset_tags` (
`changeset_id` bigint(64) NOT NULL,
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
`v` varchar(255) NOT NULL default '',
KEY `changeset_tags_id_idx` (`changeset_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`changeset_tags`
-- Dumping data for table `osm`.`changeset_tags`
--
/*!40000 ALTER TABLE `changeset_tags` DISABLE KEYS */;
@ -71,11 +65,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`changesets`
-- Definition of table `osm`.`changesets`
--
DROP TABLE IF EXISTS `api06_test`.`changesets`;
CREATE TABLE `api06_test`.`changesets` (
DROP TABLE IF EXISTS `osm`.`changesets`;
CREATE TABLE `osm`.`changesets` (
`id` bigint(20) NOT NULL auto_increment,
`user_id` bigint(20) NOT NULL,
`created_at` datetime NOT NULL,
@ -86,10 +80,10 @@ CREATE TABLE `api06_test`.`changesets` (
`closed_at` datetime NOT NULL,
`num_changes` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`changesets`
-- Dumping data for table `osm`.`changesets`
--
/*!40000 ALTER TABLE `changesets` DISABLE KEYS */;
@ -99,20 +93,20 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_node_tags`
-- Definition of table `osm`.`current_node_tags`
--
DROP TABLE IF EXISTS `api06_test`.`current_node_tags`;
CREATE TABLE `api06_test`.`current_node_tags` (
DROP TABLE IF EXISTS `osm`.`current_node_tags`;
CREATE TABLE `osm`.`current_node_tags` (
`node_id` bigint(64) NOT NULL,
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
`v` varchar(255) NOT NULL default '',
PRIMARY KEY (`node_id`,`k`),
CONSTRAINT `current_node_tags_ibfk_1` FOREIGN KEY (`node_id`) REFERENCES `current_nodes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_node_tags`
-- Dumping data for table `osm`.`current_node_tags`
--
/*!40000 ALTER TABLE `current_node_tags` DISABLE KEYS */;
@ -122,11 +116,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_nodes`
-- Definition of table `osm`.`current_nodes`
--
DROP TABLE IF EXISTS `api06_test`.`current_nodes`;
CREATE TABLE `api06_test`.`current_nodes` (
DROP TABLE IF EXISTS `osm`.`current_nodes`;
CREATE TABLE `osm`.`current_nodes` (
`id` bigint(64) NOT NULL auto_increment,
`latitude` int(11) NOT NULL,
`longitude` int(11) NOT NULL,
@ -140,10 +134,10 @@ CREATE TABLE `api06_test`.`current_nodes` (
KEY `current_nodes_tile_idx` (`tile`),
KEY `changeset_id` (`changeset_id`),
CONSTRAINT `current_nodes_ibfk_1` FOREIGN KEY (`changeset_id`) REFERENCES `changesets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_nodes`
-- Dumping data for table `osm`.`current_nodes`
--
/*!40000 ALTER TABLE `current_nodes` DISABLE KEYS */;
@ -153,11 +147,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_relation_members`
-- Definition of table `osm`.`current_relation_members`
--
DROP TABLE IF EXISTS `api06_test`.`current_relation_members`;
CREATE TABLE `api06_test`.`current_relation_members` (
DROP TABLE IF EXISTS `osm`.`current_relation_members`;
CREATE TABLE `osm`.`current_relation_members` (
`relation_id` bigint(64) NOT NULL,
`member_type` enum('Node','Way','Relation') NOT NULL default 'Node',
`member_id` bigint(11) NOT NULL,
@ -166,10 +160,10 @@ CREATE TABLE `api06_test`.`current_relation_members` (
PRIMARY KEY (`relation_id`,`member_type`,`member_id`,`member_role`,`sequence_id`),
KEY `current_relation_members_member_idx` (`member_type`,`member_id`),
CONSTRAINT `current_relation_members_ibfk_1` FOREIGN KEY (`relation_id`) REFERENCES `current_relations` (`relation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_relation_members`
-- Dumping data for table `osm`.`current_relation_members`
--
/*!40000 ALTER TABLE `current_relation_members` DISABLE KEYS */;
@ -179,20 +173,20 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_relation_tags`
-- Definition of table `osm`.`current_relation_tags`
--
DROP TABLE IF EXISTS `api06_test`.`current_relation_tags`;
CREATE TABLE `api06_test`.`current_relation_tags` (
DROP TABLE IF EXISTS `osm`.`current_relation_tags`;
CREATE TABLE `osm`.`current_relation_tags` (
`id` bigint(64) NOT NULL,
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
`v` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`,`k`),
CONSTRAINT `current_relation_tags_ibfk_1` FOREIGN KEY (`id`) REFERENCES `current_relations` (`relation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_relation_tags`
-- Dumping data for table `osm`.`current_relation_tags`
--
/*!40000 ALTER TABLE `current_relation_tags` DISABLE KEYS */;
@ -202,11 +196,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_relations`
-- Definition of table `osm`.`current_relations`
--
DROP TABLE IF EXISTS `api06_test`.`current_relations`;
CREATE TABLE `api06_test`.`current_relations` (
DROP TABLE IF EXISTS `osm`.`current_relations`;
CREATE TABLE `osm`.`current_relations` (
`relation_id` bigint(64) NOT NULL auto_increment,
`changeset_id` bigint(20) NOT NULL,
`timestamp` datetime NOT NULL,
@ -216,10 +210,10 @@ CREATE TABLE `api06_test`.`current_relations` (
KEY `current_relations_timestamp_idx` (`timestamp`),
KEY `changeset_id` (`changeset_id`),
CONSTRAINT `current_relations_ibfk_1` FOREIGN KEY (`changeset_id`) REFERENCES `changesets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_relations`
-- Dumping data for table `osm`.`current_relations`
--
/*!40000 ALTER TABLE `current_relations` DISABLE KEYS */;
@ -229,11 +223,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_way_nodes`
-- Definition of table `osm`.`current_way_nodes`
--
DROP TABLE IF EXISTS `api06_test`.`current_way_nodes`;
CREATE TABLE `api06_test`.`current_way_nodes` (
DROP TABLE IF EXISTS `osm`.`current_way_nodes`;
CREATE TABLE `osm`.`current_way_nodes` (
`id` bigint(64) NOT NULL,
`node_id` bigint(64) NOT NULL,
`sequence_id` bigint(11) NOT NULL,
@ -241,10 +235,10 @@ CREATE TABLE `api06_test`.`current_way_nodes` (
KEY `current_way_nodes_node_idx` (`node_id`),
CONSTRAINT `current_way_nodes_ibfk_2` FOREIGN KEY (`node_id`) REFERENCES `current_nodes` (`id`),
CONSTRAINT `current_way_nodes_ibfk_1` FOREIGN KEY (`id`) REFERENCES `current_ways` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_way_nodes`
-- Dumping data for table `osm`.`current_way_nodes`
--
/*!40000 ALTER TABLE `current_way_nodes` DISABLE KEYS */;
@ -254,20 +248,20 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_way_tags`
-- Definition of table `osm`.`current_way_tags`
--
DROP TABLE IF EXISTS `api06_test`.`current_way_tags`;
CREATE TABLE `api06_test`.`current_way_tags` (
DROP TABLE IF EXISTS `osm`.`current_way_tags`;
CREATE TABLE `osm`.`current_way_tags` (
`way_id` bigint(64) NOT NULL,
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
`v` varchar(255) NOT NULL default '',
PRIMARY KEY (`way_id`,`k`),
CONSTRAINT `current_way_tags_ibfk_1` FOREIGN KEY (`way_id`) REFERENCES `current_ways` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_way_tags`
-- Dumping data for table `osm`.`current_way_tags`
--
/*!40000 ALTER TABLE `current_way_tags` DISABLE KEYS */;
@ -277,11 +271,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`current_ways`
-- Definition of table `osm`.`current_ways`
--
DROP TABLE IF EXISTS `api06_test`.`current_ways`;
CREATE TABLE `api06_test`.`current_ways` (
DROP TABLE IF EXISTS `osm`.`current_ways`;
CREATE TABLE `osm`.`current_ways` (
`id` bigint(64) NOT NULL auto_increment,
`changeset_id` bigint(20) NOT NULL,
`timestamp` datetime NOT NULL,
@ -291,10 +285,10 @@ CREATE TABLE `api06_test`.`current_ways` (
KEY `current_ways_timestamp_idx` (`timestamp`),
KEY `changeset_id` (`changeset_id`),
CONSTRAINT `current_ways_ibfk_1` FOREIGN KEY (`changeset_id`) REFERENCES `changesets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`current_ways`
-- Dumping data for table `osm`.`current_ways`
--
/*!40000 ALTER TABLE `current_ways` DISABLE KEYS */;
@ -304,11 +298,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`diary_comments`
-- Definition of table `osm`.`diary_comments`
--
DROP TABLE IF EXISTS `api06_test`.`diary_comments`;
CREATE TABLE `api06_test`.`diary_comments` (
DROP TABLE IF EXISTS `osm`.`diary_comments`;
CREATE TABLE `osm`.`diary_comments` (
`id` bigint(20) NOT NULL auto_increment,
`diary_entry_id` bigint(20) NOT NULL,
`user_id` bigint(20) NOT NULL,
@ -317,10 +311,10 @@ CREATE TABLE `api06_test`.`diary_comments` (
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `diary_comments_entry_id_idx` (`diary_entry_id`,`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`diary_comments`
-- Dumping data for table `osm`.`diary_comments`
--
/*!40000 ALTER TABLE `diary_comments` DISABLE KEYS */;
@ -330,11 +324,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`diary_entries`
-- Definition of table `osm`.`diary_entries`
--
DROP TABLE IF EXISTS `api06_test`.`diary_entries`;
CREATE TABLE `api06_test`.`diary_entries` (
DROP TABLE IF EXISTS `osm`.`diary_entries`;
CREATE TABLE `osm`.`diary_entries` (
`id` bigint(20) NOT NULL auto_increment,
`user_id` bigint(20) NOT NULL,
`title` varchar(255) NOT NULL,
@ -345,10 +339,10 @@ CREATE TABLE `api06_test`.`diary_entries` (
`longitude` double default NULL,
`language` varchar(3) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`diary_entries`
-- Dumping data for table `osm`.`diary_entries`
--
/*!40000 ALTER TABLE `diary_entries` DISABLE KEYS */;
@ -358,21 +352,21 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`friends`
-- Definition of table `osm`.`friends`
--
DROP TABLE IF EXISTS `api06_test`.`friends`;
CREATE TABLE `api06_test`.`friends` (
DROP TABLE IF EXISTS `osm`.`friends`;
CREATE TABLE `osm`.`friends` (
`id` bigint(20) NOT NULL auto_increment,
`user_id` bigint(20) NOT NULL,
`friend_user_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id_idx` (`friend_user_id`),
KEY `friends_user_id_idx` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`friends`
-- Dumping data for table `osm`.`friends`
--
/*!40000 ALTER TABLE `friends` DISABLE KEYS */;
@ -382,11 +376,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`gps_points`
-- Definition of table `osm`.`gps_points`
--
DROP TABLE IF EXISTS `api06_test`.`gps_points`;
CREATE TABLE `api06_test`.`gps_points` (
DROP TABLE IF EXISTS `osm`.`gps_points`;
CREATE TABLE `osm`.`gps_points` (
`altitude` float default NULL,
`trackid` int(11) NOT NULL,
`latitude` int(11) NOT NULL,
@ -396,10 +390,10 @@ CREATE TABLE `api06_test`.`gps_points` (
`tile` int(10) unsigned default NULL,
KEY `points_gpxid_idx` (`gpx_id`),
KEY `points_tile_idx` (`tile`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`gps_points`
-- Dumping data for table `osm`.`gps_points`
--
/*!40000 ALTER TABLE `gps_points` DISABLE KEYS */;
@ -409,21 +403,21 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`gpx_file_tags`
-- Definition of table `osm`.`gpx_file_tags`
--
DROP TABLE IF EXISTS `api06_test`.`gpx_file_tags`;
CREATE TABLE `api06_test`.`gpx_file_tags` (
DROP TABLE IF EXISTS `osm`.`gpx_file_tags`;
CREATE TABLE `osm`.`gpx_file_tags` (
`gpx_id` bigint(64) NOT NULL default '0',
`tag` varchar(255) NOT NULL,
`id` bigint(20) NOT NULL auto_increment,
PRIMARY KEY (`id`),
KEY `gpx_file_tags_gpxid_idx` (`gpx_id`),
KEY `gpx_file_tags_tag_idx` (`tag`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`gpx_file_tags`
-- Dumping data for table `osm`.`gpx_file_tags`
--
/*!40000 ALTER TABLE `gpx_file_tags` DISABLE KEYS */;
@ -433,11 +427,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`gpx_files`
-- Definition of table `osm`.`gpx_files`
--
DROP TABLE IF EXISTS `api06_test`.`gpx_files`;
CREATE TABLE `api06_test`.`gpx_files` (
DROP TABLE IF EXISTS `osm`.`gpx_files`;
CREATE TABLE `osm`.`gpx_files` (
`id` bigint(64) NOT NULL auto_increment,
`user_id` bigint(20) NOT NULL,
`visible` tinyint(1) NOT NULL default '1',
@ -453,10 +447,10 @@ CREATE TABLE `api06_test`.`gpx_files` (
KEY `gpx_files_timestamp_idx` (`timestamp`),
KEY `gpx_files_visible_public_idx` (`visible`,`public`),
KEY `gpx_files_user_id_idx` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`gpx_files`
-- Dumping data for table `osm`.`gpx_files`
--
/*!40000 ALTER TABLE `gpx_files` DISABLE KEYS */;
@ -466,11 +460,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`messages`
-- Definition of table `osm`.`messages`
--
DROP TABLE IF EXISTS `api06_test`.`messages`;
CREATE TABLE `api06_test`.`messages` (
DROP TABLE IF EXISTS `osm`.`messages`;
CREATE TABLE `osm`.`messages` (
`id` bigint(20) NOT NULL auto_increment,
`from_user_id` bigint(20) NOT NULL,
`title` varchar(255) NOT NULL,
@ -480,10 +474,10 @@ CREATE TABLE `api06_test`.`messages` (
`to_user_id` bigint(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `messages_to_user_id_idx` (`to_user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`messages`
-- Dumping data for table `osm`.`messages`
--
/*!40000 ALTER TABLE `messages` DISABLE KEYS */;
@ -493,21 +487,21 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`node_tags`
-- Definition of table `osm`.`node_tags`
--
DROP TABLE IF EXISTS `api06_test`.`node_tags`;
CREATE TABLE `api06_test`.`node_tags` (
DROP TABLE IF EXISTS `osm`.`node_tags`;
CREATE TABLE `osm`.`node_tags` (
`node_id` bigint(64) NOT NULL,
`version` bigint(20) NOT NULL,
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
`v` varchar(255) NOT NULL default '',
PRIMARY KEY (`node_id`,`version`,`k`),
CONSTRAINT `node_tags_ibfk_1` FOREIGN KEY (`node_id`, `version`) REFERENCES `nodes` (`node_id`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`node_tags`
-- Dumping data for table `osm`.`node_tags`
--
/*!40000 ALTER TABLE `node_tags` DISABLE KEYS */;
@ -517,11 +511,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`nodes`
-- Definition of table `osm`.`nodes`
--
DROP TABLE IF EXISTS `api06_test`.`nodes`;
CREATE TABLE `api06_test`.`nodes` (
DROP TABLE IF EXISTS `osm`.`nodes`;
CREATE TABLE `osm`.`nodes` (
`node_id` bigint(64) NOT NULL,
`latitude` int(11) NOT NULL,
`longitude` int(11) NOT NULL,
@ -535,10 +529,10 @@ CREATE TABLE `api06_test`.`nodes` (
KEY `nodes_tile_idx` (`tile`),
KEY `changeset_id` (`changeset_id`),
CONSTRAINT `nodes_ibfk_1` FOREIGN KEY (`changeset_id`) REFERENCES `changesets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`nodes`
-- Dumping data for table `osm`.`nodes`
--
/*!40000 ALTER TABLE `nodes` DISABLE KEYS */;
@ -548,11 +542,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`relation_members`
-- Definition of table `osm`.`relation_members`
--
DROP TABLE IF EXISTS `api06_test`.`relation_members`;
CREATE TABLE `api06_test`.`relation_members` (
DROP TABLE IF EXISTS `osm`.`relation_members`;
CREATE TABLE `osm`.`relation_members` (
`relation_id` bigint(64) NOT NULL default '0',
`member_type` enum('Node','Way','Relation') NOT NULL default 'Node',
`member_id` bigint(11) NOT NULL,
@ -562,10 +556,10 @@ CREATE TABLE `api06_test`.`relation_members` (
PRIMARY KEY (`relation_id`,`version`,`member_type`,`member_id`,`member_role`,`sequence_id`),
KEY `relation_members_member_idx` (`member_type`,`member_id`),
CONSTRAINT `relation_members_ibfk_1` FOREIGN KEY (`relation_id`, `version`) REFERENCES `relations` (`relation_id`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`relation_members`
-- Dumping data for table `osm`.`relation_members`
--
/*!40000 ALTER TABLE `relation_members` DISABLE KEYS */;
@ -575,21 +569,21 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`relation_tags`
-- Definition of table `osm`.`relation_tags`
--
DROP TABLE IF EXISTS `api06_test`.`relation_tags`;
CREATE TABLE `api06_test`.`relation_tags` (
DROP TABLE IF EXISTS `osm`.`relation_tags`;
CREATE TABLE `osm`.`relation_tags` (
`relation_id` bigint(64) NOT NULL default '0',
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
`v` varchar(255) NOT NULL default '',
`version` bigint(20) NOT NULL,
PRIMARY KEY (`relation_id`,`version`,`k`),
CONSTRAINT `relation_tags_ibfk_1` FOREIGN KEY (`relation_id`, `version`) REFERENCES `relations` (`relation_id`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`relation_tags`
-- Dumping data for table `osm`.`relation_tags`
--
/*!40000 ALTER TABLE `relation_tags` DISABLE KEYS */;
@ -599,11 +593,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`relations`
-- Definition of table `osm`.`relations`
--
DROP TABLE IF EXISTS `api06_test`.`relations`;
CREATE TABLE `api06_test`.`relations` (
DROP TABLE IF EXISTS `osm`.`relations`;
CREATE TABLE `osm`.`relations` (
`relation_id` bigint(64) NOT NULL default '0',
`changeset_id` bigint(20) NOT NULL,
`timestamp` datetime NOT NULL,
@ -613,10 +607,10 @@ CREATE TABLE `api06_test`.`relations` (
KEY `relations_timestamp_idx` (`timestamp`),
KEY `changeset_id` (`changeset_id`),
CONSTRAINT `relations_ibfk_1` FOREIGN KEY (`changeset_id`) REFERENCES `changesets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`relations`
-- Dumping data for table `osm`.`relations`
--
/*!40000 ALTER TABLE `relations` DISABLE KEYS */;
@ -626,22 +620,22 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`schema_migrations`
-- Definition of table `osm`.`schema_migrations`
--
DROP TABLE IF EXISTS `api06_test`.`schema_migrations`;
CREATE TABLE `api06_test`.`schema_migrations` (
DROP TABLE IF EXISTS `osm`.`schema_migrations`;
CREATE TABLE `osm`.`schema_migrations` (
`version` varchar(255) NOT NULL,
UNIQUE KEY `unique_schema_migrations` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`schema_migrations`
-- Dumping data for table `osm`.`schema_migrations`
--
/*!40000 ALTER TABLE `schema_migrations` DISABLE KEYS */;
LOCK TABLES `schema_migrations` WRITE;
INSERT INTO `api06_test`.`schema_migrations` VALUES ('1'),
INSERT INTO `osm`.`schema_migrations` VALUES ('1'),
('10'),
('11'),
('12'),
@ -671,11 +665,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`sessions`
-- Definition of table `osm`.`sessions`
--
DROP TABLE IF EXISTS `api06_test`.`sessions`;
CREATE TABLE `api06_test`.`sessions` (
DROP TABLE IF EXISTS `osm`.`sessions`;
CREATE TABLE `osm`.`sessions` (
`id` int(11) NOT NULL auto_increment,
`session_id` varchar(255) default NULL,
`data` text,
@ -683,10 +677,10 @@ CREATE TABLE `api06_test`.`sessions` (
`updated_at` datetime default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sessions_session_id_idx` (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`sessions`
-- Dumping data for table `osm`.`sessions`
--
/*!40000 ALTER TABLE `sessions` DISABLE KEYS */;
@ -696,19 +690,19 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`user_preferences`
-- Definition of table `osm`.`user_preferences`
--
DROP TABLE IF EXISTS `api06_test`.`user_preferences`;
CREATE TABLE `api06_test`.`user_preferences` (
DROP TABLE IF EXISTS `osm`.`user_preferences`;
CREATE TABLE `osm`.`user_preferences` (
`user_id` bigint(20) NOT NULL,
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`v` varchar(255) NOT NULL,
PRIMARY KEY (`user_id`,`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`user_preferences`
-- Dumping data for table `osm`.`user_preferences`
--
/*!40000 ALTER TABLE `user_preferences` DISABLE KEYS */;
@ -718,11 +712,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`user_tokens`
-- Definition of table `osm`.`user_tokens`
--
DROP TABLE IF EXISTS `api06_test`.`user_tokens`;
CREATE TABLE `api06_test`.`user_tokens` (
DROP TABLE IF EXISTS `osm`.`user_tokens`;
CREATE TABLE `osm`.`user_tokens` (
`id` bigint(20) NOT NULL auto_increment,
`user_id` bigint(20) NOT NULL,
`token` varchar(255) NOT NULL,
@ -730,10 +724,10 @@ CREATE TABLE `api06_test`.`user_tokens` (
PRIMARY KEY (`id`),
UNIQUE KEY `user_tokens_token_idx` (`token`),
KEY `user_tokens_user_id_idx` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`user_tokens`
-- Dumping data for table `osm`.`user_tokens`
--
/*!40000 ALTER TABLE `user_tokens` DISABLE KEYS */;
@ -743,11 +737,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`users`
-- Definition of table `osm`.`users`
--
DROP TABLE IF EXISTS `api06_test`.`users`;
CREATE TABLE `api06_test`.`users` (
DROP TABLE IF EXISTS `osm`.`users`;
CREATE TABLE `osm`.`users` (
`email` varchar(255) NOT NULL,
`id` bigint(20) NOT NULL auto_increment,
`active` int(11) NOT NULL default '0',
@ -770,10 +764,10 @@ CREATE TABLE `api06_test`.`users` (
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_idx` (`email`),
UNIQUE KEY `users_display_name_idx` (`display_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`users`
-- Dumping data for table `osm`.`users`
--
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
@ -783,11 +777,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`way_nodes`
-- Definition of table `osm`.`way_nodes`
--
DROP TABLE IF EXISTS `api06_test`.`way_nodes`;
CREATE TABLE `api06_test`.`way_nodes` (
DROP TABLE IF EXISTS `osm`.`way_nodes`;
CREATE TABLE `osm`.`way_nodes` (
`way_id` bigint(64) NOT NULL,
`node_id` bigint(64) NOT NULL,
`version` bigint(20) NOT NULL,
@ -795,10 +789,10 @@ CREATE TABLE `api06_test`.`way_nodes` (
PRIMARY KEY (`way_id`,`version`,`sequence_id`),
KEY `way_nodes_node_idx` (`node_id`),
CONSTRAINT `way_nodes_ibfk_1` FOREIGN KEY (`way_id`, `version`) REFERENCES `ways` (`way_id`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`way_nodes`
-- Dumping data for table `osm`.`way_nodes`
--
/*!40000 ALTER TABLE `way_nodes` DISABLE KEYS */;
@ -808,21 +802,21 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`way_tags`
-- Definition of table `osm`.`way_tags`
--
DROP TABLE IF EXISTS `api06_test`.`way_tags`;
CREATE TABLE `api06_test`.`way_tags` (
DROP TABLE IF EXISTS `osm`.`way_tags`;
CREATE TABLE `osm`.`way_tags` (
`way_id` bigint(64) NOT NULL default '0',
`k` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`v` varchar(255) NOT NULL,
`version` bigint(20) NOT NULL,
PRIMARY KEY (`way_id`,`version`,`k`),
CONSTRAINT `way_tags_ibfk_1` FOREIGN KEY (`way_id`, `version`) REFERENCES `ways` (`way_id`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`way_tags`
-- Dumping data for table `osm`.`way_tags`
--
/*!40000 ALTER TABLE `way_tags` DISABLE KEYS */;
@ -832,11 +826,11 @@ UNLOCK TABLES;
--
-- Definition of table `api06_test`.`ways`
-- Definition of table `osm`.`ways`
--
DROP TABLE IF EXISTS `api06_test`.`ways`;
CREATE TABLE `api06_test`.`ways` (
DROP TABLE IF EXISTS `osm`.`ways`;
CREATE TABLE `osm`.`ways` (
`way_id` bigint(64) NOT NULL default '0',
`changeset_id` bigint(20) NOT NULL,
`timestamp` datetime NOT NULL,
@ -846,10 +840,10 @@ CREATE TABLE `api06_test`.`ways` (
KEY `ways_timestamp_idx` (`timestamp`),
KEY `changeset_id` (`changeset_id`),
CONSTRAINT `ways_ibfk_1` FOREIGN KEY (`changeset_id`) REFERENCES `changesets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
) ENGINE=Aria DEFAULT CHARSET=utf8;
--
-- Dumping data for table `api06_test`.`ways`
-- Dumping data for table `osm`.`ways`
--
/*!40000 ALTER TABLE `ways` DISABLE KEYS */;
Loading…
Cancel
Save