mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-27 14:57:44 +00:00
added sql import script
This commit is contained in:
parent
85292ad051
commit
d4cb82d82b
2 changed files with 17 additions and 1 deletions
|
@ -31,3 +31,4 @@ script:
|
|||
- mkdir build
|
||||
- cd build
|
||||
- ${DEPS_DIR}/cmake/bin/cmake .. -DSAPPHIRE_BOOST_VER="1.54.0" -DCMAKE_CXX_COMPILER=g++-4.9 -DCMAKE_C_COMPILER=gcc-4.9 && make
|
||||
- sh ./sql_import.sh
|
||||
|
|
15
sql_import.sh
Normal file
15
sql_import.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
cd sql
|
||||
mysql -u root -e 'drop database sapphire;'
|
||||
mysql -u root -e 'create database sapphire;'
|
||||
for f in *.sql
|
||||
do
|
||||
[ "$f" = "update.sql" ] && continue;
|
||||
echo -n "importing $f into the database..."
|
||||
mysql sapphire -u root < $f && echo "Success"
|
||||
CODE=$?
|
||||
if [ $CODE -ne 0 ]; then exit $CODE; fi
|
||||
done
|
||||
mysql sapphire -u root < update.sql -f
|
||||
echo 'todo: test update sql'
|
||||
cd ..
|
Loading…
Add table
Reference in a new issue