rename system user

This commit is contained in:
Christine Dodrill 2016-02-09 10:23:47 -08:00
parent 0ad7a41629
commit de62f04bf4
2 changed files with 4 additions and 3 deletions

View File

@ -60,7 +60,7 @@ proc getTweetsFrom*(url: string, username: string): seq[Tweet] =
proc updateTweetsOnce*() {. gcsafe .} = proc updateTweetsOnce*() {. gcsafe .} =
var db = open("./data/twtxt.db", nil, nil, nil) var db = open("./data/twtxt.db", nil, nil, nil)
var users = db.getAllRows sql"select * from users where username != 'system'" var users = db.getAllRows sql"select * from users where username != 'twtxtlist'"
for user in users.items(): for user in users.items():
echo "updating " & $user echo "updating " & $user
@ -75,4 +75,5 @@ proc updateTweetsOnce*() {. gcsafe .} =
try: try:
db.exec(sql"insert into tweets values(null, ?, ?, ?);", username, tweet.date.timeInfoToTime().toSeconds().int(), tweet.message) db.exec(sql"insert into tweets values(null, ?, ?, ?);", username, tweet.date.timeInfoToTime().toSeconds().int(), tweet.message)
except: discard except: discard
except: discard except:
echo getCurrentExceptionMsg()

View File

@ -17,7 +17,7 @@ proc updateSystemUser() =
echo "wtf it's nil?" echo "wtf it's nil?"
return return
let tweets = db.getAllRows(sql"select * from tweets where username='system'") let tweets = db.getAllRows(sql"select * from tweets where username='twtxtlist'")
for tweet in tweets.items: for tweet in tweets.items:
let tweetObj = tweet.fromDBRow() let tweetObj = tweet.fromDBRow()