summaryrefslogtreecommitdiff
path: root/localserver
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-09 15:41:30 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-09 15:41:30 +0300
commit5c526d2add2b086c00157595109581771bfbbd94 (patch)
treefd5cdb1e56a4ceb1bfa5f5f24934b7e9ae680674 /localserver
parent665c04b18a29eff9f866a9f8e61c251d405d16cd (diff)
downloadevol-tools-5c526d2add2b086c00157595109581771bfbbd94.tar.gz
evol-tools-5c526d2add2b086c00157595109581771bfbbd94.tar.bz2
evol-tools-5c526d2add2b086c00157595109581771bfbbd94.tar.xz
evol-tools-5c526d2add2b086c00157595109581771bfbbd94.zip
localserver: In initdb.sh script put current db version in file.
Diffstat (limited to 'localserver')
-rwxr-xr-xlocalserver/initdb.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/localserver/initdb.sh b/localserver/initdb.sh
index 40358e1..cd014bc 100755
--- a/localserver/initdb.sh
+++ b/localserver/initdb.sh
@@ -1,5 +1,8 @@
#!/bin/bash
+export DIR="$(pwd)"
+export VER=$(cat versions/sqlver 2>/dev/null)
+
cd ../../server-data/sql-files
echo Creating db and user...
@@ -16,3 +19,8 @@ export CMD="mysql -u evol -pevol evol"
echo Creating tables...
$CMD <main.sql
$CMD <logs.sql
+
+if [[ -z "${VER}" ]]; then
+ mkdir ${DIR}/versions
+ echo "2" >${DIR}/versions/sqlver
+fi