Skip to content

Commit

Permalink
Create vagrant packaging sample config
Browse files Browse the repository at this point in the history
Changed ixed columns to text type
  • Loading branch information
dkastl committed Jun 24, 2013
1 parent 44b462e commit 0dc0681
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ bin/*
Sample/*
.vagrant
osm2pgrouting
tools/vagrant/packaging.sh
*.o
*~
.project
Expand Down
8 changes: 4 additions & 4 deletions src/Export2DB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void Export2DB::createTables()
std::cout << "Nodes table created" << std::endl;
}

std::string create_ways("CREATE TABLE " + tables_prefix + "ways (gid bigint, class_id integer not null, length double precision, name char(200), x1 double precision, y1 double precision, x2 double precision, y2 double precision, reverse_cost double precision, rule text, to_cost double precision, maxspeed_forward integer, maxspeed_backward integer, osm_id bigint, priority double precision DEFAULT 1);"
std::string create_ways("CREATE TABLE " + tables_prefix + "ways (gid bigint, class_id integer not null, length double precision, name text, x1 double precision, y1 double precision, x2 double precision, y2 double precision, reverse_cost double precision, rule text, to_cost double precision, maxspeed_forward integer, maxspeed_backward integer, osm_id bigint, priority double precision DEFAULT 1);"
+ " SELECT AddGeometryColumn('" + tables_prefix + "ways','the_geom',4326,'LINESTRING',2);");
result = PQexec(mycon, create_ways.c_str());
if (PQresultStatus(result) != PGRES_COMMAND_OK)
Expand All @@ -94,7 +94,7 @@ void Export2DB::createTables()
std::cout << "Ways table created" << std::endl;
}

std::string create_types("CREATE TABLE " + tables_prefix + "types (id integer PRIMARY KEY, name char(200));");
std::string create_types("CREATE TABLE " + tables_prefix + "types (id integer PRIMARY KEY, name text);");
result = PQexec(mycon, create_types.c_str());
if (PQresultStatus(result) != PGRES_COMMAND_OK)
{
Expand All @@ -118,7 +118,7 @@ void Export2DB::createTables()
std::cout << "Way_tag table created" << std::endl;
}

std::string create_relations("CREATE TABLE " + tables_prefix + "relations (relation_id bigint, type_id integer, class_id integer, name character varying(200));");
std::string create_relations("CREATE TABLE " + tables_prefix + "relations (relation_id bigint, type_id integer, class_id integer, name text);");
result = PQexec(mycon, create_relations.c_str());
if (PQresultStatus(result) != PGRES_COMMAND_OK)
{
Expand All @@ -142,7 +142,7 @@ void Export2DB::createTables()
std::cout << "Relation_ways table created" << std::endl;
}

std::string create_classes("CREATE TABLE " + tables_prefix + "classes (id integer PRIMARY KEY, type_id integer, name char(200), cost double precision, priority double precision, default_maxspeed integer);");
std::string create_classes("CREATE TABLE " + tables_prefix + "classes (id integer PRIMARY KEY, type_id integer, name text, cost double precision, priority double precision, default_maxspeed integer);");
result = PQexec(mycon, create_classes.c_str());
if (PQresultStatus(result) != PGRES_COMMAND_OK)
{
Expand Down
10 changes: 5 additions & 5 deletions tools/vagrant/packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# Vagrant - Virtualized Development
# Copyright(c) pgRouting Contributors
#
# Prepare packaging
# Prepare packaging (sample)
# ------------------------------------------------------------------------------

echo "DEBEMAIL=[email protected]" > ~/.bash_aliases
echo "DEBFULLNAME='First Last'" >> ~/.bash_aliases
echo "DEBEMAIL=[email protected]" > ~/.bash_aliases
echo "DEBFULLNAME='Daniel Kastl (Georepublic)'" >> ~/.bash_aliases

git config --global user.name "First Last"
git config --global user.email "[email protected]"
git config --global user.name "Daniel Kastl"
git config --global user.email "[email protected]"
git config --global core.editor vim
git config --global color.ui true
15 changes: 15 additions & 0 deletions tools/vagrant/packaging.sh.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# Vagrant - Virtualized Development
# Copyright(c) pgRouting Contributors
#
# Prepare packaging (sample)
# ------------------------------------------------------------------------------

echo "[email protected]" > ~/.bash_aliases
echo "DEBFULLNAME='First Last'" >> ~/.bash_aliases

git config --global user.name "First Last"
git config --global user.email "[email protected]"
git config --global core.editor vim
git config --global color.ui true

0 comments on commit 0dc0681

Please sign in to comment.