Skip to content

Commit 861c36b

Browse files
author
Sergio Cruz Moral
committed
Merge pull request #14 from talofo/patch-1
Add new action: create-tables
2 parents b5900aa + 2ffe5ba commit 861c36b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

geonames_importer.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ case "$action" in
119119
mysql -h $dbhost -P $dbport -u $dbusername -p$dbpassword $dbname < $dir/geonames_db_struct.sql
120120
;;
121121

122+
create-tables)
123+
echo "Creating tables for database $dbname..."
124+
mysql -h $dbhost -P $dbport -u $dbusername -p$dbpassword -Bse "USE $dbname;"
125+
mysql -h $dbhost -P $dbport -u $dbusername -p$dbpassword $dbname < $dir/geonames_db_struct.sql
126+
;;
127+
122128
import-dumps)
123129
echo "Importing geonames dumps into database $dbname"
124130
mysql -h $dbhost -P $dbport -u $dbusername -p$dbpassword --local-infile=1 $dbname < $dir/geonames_import_data.sql

0 commit comments

Comments
 (0)