Provide a msg to watch that will be published to a topic when confirmation

This commit is contained in:
kexkey
2019-11-28 11:41:33 -05:00
committed by kexkey
parent 49299725e0
commit ed40433b28
10 changed files with 108 additions and 49 deletions

View File

@@ -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
);

View 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

View File

@@ -0,0 +1 @@
ALTER TABLE watching ADD COLUMN event_message TEXT;