mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-02-18 02:34:21 +01:00
Provide a msg to watch that will be published to a topic when confirmation
This commit is contained in:
@@ -23,6 +23,7 @@ CREATE TABLE watching (
|
||||
imported INTEGER DEFAULT FALSE,
|
||||
watching_by_pub32_id INTEGER REFERENCES watching_by_pub32,
|
||||
pub32_index INTEGER,
|
||||
event_message TEXT,
|
||||
inserted_ts INTEGER DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
|
||||
14
proxy_docker/app/data/sqlmigrate20191127_0.2.4-0.3.0.sh
Normal file
14
proxy_docker/app/data/sqlmigrate20191127_0.2.4-0.3.0.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Checking for watching event support in DB..."
|
||||
count=$(sqlite3 $DB_FILE "select count(*) from pragma_table_info('watching') where name='event_message'")
|
||||
if [ "${count}" -eq "0" ]; then
|
||||
# event_message not there, we have to migrate
|
||||
echo "Migrating database for event triggered on watch notif..."
|
||||
echo "Backing up current DB..."
|
||||
cp $DB_FILE $DB_FILE-sqlmigrate20191127_0.2.4-0.3.0
|
||||
echo "Altering DB..."
|
||||
cat sqlmigrate20191127_0.2.4-0.3.0.sql | sqlite3 $DB_FILE
|
||||
else
|
||||
echo "Database watching event support migration already done, skipping!"
|
||||
fi
|
||||
1
proxy_docker/app/data/sqlmigrate20191127_0.2.4-0.3.0.sql
Normal file
1
proxy_docker/app/data/sqlmigrate20191127_0.2.4-0.3.0.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE watching ADD COLUMN event_message TEXT;
|
||||
Reference in New Issue
Block a user