mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-02-20 03:34:18 +01:00
Backups when migrating DB
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Checking for OTS support in DB..."
|
||||
sqlite3 db/proxydb ".tables" | grep "stamp" > /dev/null
|
||||
sqlite3 $DB_FILE ".tables" | grep "stamp" > /dev/null
|
||||
if [ "$?" -eq "1" ]; then
|
||||
# stamp not there, we have to migrate
|
||||
echo "Migrating database for OTS support..."
|
||||
echo "Backing up current DB..."
|
||||
cp $DB_FILE $DB_FILE-sqlmigrate20181213_0-0.1
|
||||
echo "Altering DB..."
|
||||
cat sqlmigrate20181213_0-0.1.sql | sqlite3 $DB_FILE
|
||||
else
|
||||
echo "Database OTS support migration already done, skipping!"
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Checking for watch by xpub support in DB..."
|
||||
sqlite3 db/proxydb ".tables" | grep "watching_by_pub32" > /dev/null
|
||||
sqlite3 $DB_FILE ".tables" | grep "watching_by_pub32" > /dev/null
|
||||
if [ "$?" -eq "1" ]; then
|
||||
# watching_by_pub32 not there, we have to migrate
|
||||
echo "Migrating database for watch by xpub support..."
|
||||
echo "Backing up current DB..."
|
||||
cp $DB_FILE $DB_FILE-sqlmigrate20190130_0.1-0.2
|
||||
echo "Altering DB..."
|
||||
cat sqlmigrate20190130_0.1-0.2.sql | sqlite3 $DB_FILE
|
||||
else
|
||||
echo "Database watch by xpub support migration already done, skipping!"
|
||||
|
||||
Reference in New Issue
Block a user