diff --git a/appdb.py b/appdb.py index 505a1cf..b68b718 100755 --- a/appdb.py +++ b/appdb.py @@ -42,7 +42,7 @@ def getNumSMSLog(did,limit=5): #This gets the last X amount of logs from all numbers. db = pymysql.connect(host=sqlhost, user=sqluser, passwd=sqlpass, db=sqldb) cur = db.cursor() - cur.execute("SELECT * FROM messages WHERE source_number=%s OR dest_number=%s ORDER BY timestamp DESC LIMIT %s;",(did,did,limit)) + cur.execute("SELECT * FROM messages WHERE source_number=%s OR dest_number=%s ORDER BY timestamp DESC LIMIT %s",(did,did,limit)) rows = cur.fetchall() #for row in rows: #pprint.pprint(row) @@ -54,7 +54,7 @@ def updateMsgStatus(msg_id,status): #UPDATE messages SET delivered='success' WHERE pid='mdr2-46999f9ce19e11e99074722a1f1f4bb4' db = pymysql.connect(host=sqlhost, user=sqluser, passwd=sqlpass, db=sqldb) cur = db.cursor() - affected_count = cur.execute("UPDATE messages SET `delivered`=%s WHERE `pid`=%s;",(status,msg_id)) + affected_count = cur.execute("UPDATE messages SET status=%s WHERE `pid`=%s",(status,msg_id)) pprint.pprint("updated : " + str(affected_count) + " set "+ status +" to " +msg_id) db.close() return True diff --git a/database.md b/database.md index 168c5cd..18186ea 100644 --- a/database.md +++ b/database.md @@ -59,5 +59,5 @@ CREATE TABLE `messages` ( COLLATE='utf8_bin' ENGINE=InnoDB ; -########## Update V1, add delivered enum to messages table. -ALTER TABLE messages ADD COLUMN delivered VARCHAR(30) NOT NULL DEFAULT 'pending'; \ No newline at end of file +########## Update V1, add delivered status to messages table. +ALTER TABLE messages ADD COLUMN status VARCHAR(30) NOT NULL DEFAULT 'pending'; \ No newline at end of file diff --git a/thewords.faith.txt b/thewords.faith.txt new file mode 100644 index 0000000..0501091 --- /dev/null +++ b/thewords.faith.txt @@ -0,0 +1,15 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + + root /var/www/thewords.faith/html; + index index.html index.htm index.nginx-debian.html; + + server_name thewords.faith; + + location / { + proxy_pass http://127.0.0.1:8000; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } +} \ No newline at end of file