Backups when migrating DB and c-lightning 0.7.0

This commit is contained in:
kexkey
2019-03-07 12:44:27 -05:00
committed by kexkey
parent ab52f96fbf
commit dbdfcceaab
4 changed files with 79 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ WORKDIR ${HOME}
COPY app/data/* ./
COPY app/script/* ./
COPY --from=cyphernode/clightning:v0.6.2 /usr/bin/lightning-cli ./
COPY --from=cyphernode/clightning:v0.7.0 /usr/bin/lightning-cli ./
RUN chmod +x startproxy.sh requesthandler.sh lightning-cli sqlmigrate*.sh waitanyinvoice.sh \
&& chmod o+w . \

View File

@@ -24,7 +24,7 @@ WORKDIR ${HOME}
COPY app/data/* ./
COPY app/script/* ./
COPY --from=cyphernode/clightning:v0.6.2 /usr/bin/lightning-cli ./
COPY --from=cyphernode/clightning:v0.7.0 /usr/bin/lightning-cli ./
RUN chmod +x startproxy.sh requesthandler.sh lightning-cli sqlmigrate*.sh waitanyinvoice.sh \
&& chmod o+w . \

View File

@@ -1,10 +1,13 @@
#!/bin/sh
echo "Checking for full LN support in DB..."
exists=$(sqlite3 db/proxydb "SELECT value FROM cyphernode_props WHERE property='pay_index'")
exists=$(sqlite3 $DB_FILE "SELECT value FROM cyphernode_props WHERE property='pay_index'")
if [ -z "${exists}" ]; then
# pay_index not found, let's migrate
echo "Migrating database for full LN support..."
echo "Backing up current DB..."
cp $DB_FILE $DB_FILE-sqlmigrate20190104_0.1-0.2
echo "Altering DB..."
cat sqlmigrate20190104_0.1-0.2.sql | sqlite3 $DB_FILE
else
echo "Database full LN support migration already done, skipping!"