diff --git a/schema.go b/schema.go index 05646e1..eb3aa05 100644 --- a/schema.go +++ b/schema.go @@ -6,7 +6,7 @@ create table honks (honkid integer primary key, userid integer, what text, honke create table chonks (chonkid integer primary key, userid integer, xid text, who txt, target text, dt text, noise text, format text); create table donks (honkid integer, chonkid integer, fileid integer); create table filemeta (fileid integer primary key, xid text, name text, description text, url text, media text, local integer); -create table honkers (honkerid integer primary key, userid integer, name text, xid text, flavor text, combos text, owner text, meta text); +create table honkers (honkerid integer primary key, userid integer, name text, xid text, flavor text, combos text, owner text, meta text, folxid text); create table xonkers (xonkerid integer primary key, name text, info text, flavor text, dt text); create table zonkers (zonkerid integer primary key, userid integer, name text, wherefore text); create table doovers(dooverid integer primary key, dt text, tries integer, userid integer, rcpt text, msg blob); diff --git a/schema.sql b/schema.sql index 5b9783d..fe97049 100644 --- a/schema.sql +++ b/schema.sql @@ -3,7 +3,7 @@ create table honks (honkid integer primary key, userid integer, what text, honke create table chonks (chonkid integer primary key, userid integer, xid text, who txt, target text, dt text, noise text, format text); create table donks (honkid integer, chonkid integer, fileid integer); create table filemeta (fileid integer primary key, xid text, name text, description text, url text, media text, local integer); -create table honkers (honkerid integer primary key, userid integer, name text, xid text, flavor text, combos text, owner text, meta text); +create table honkers (honkerid integer primary key, userid integer, name text, xid text, flavor text, combos text, owner text, meta text, folxid text); create table xonkers (xonkerid integer primary key, name text, info text, flavor text, dt text); create table zonkers (zonkerid integer primary key, userid integer, name text, wherefore text); create table doovers(dooverid integer primary key, dt text, tries integer, userid integer, rcpt text, msg blob); diff --git a/upgradedb.go b/upgradedb.go index f9a5e35..f1e5787 100644 --- a/upgradedb.go +++ b/upgradedb.go @@ -23,7 +23,7 @@ import ( "time" ) -var myVersion = 36 +var myVersion = 37 func doordie(db *sql.DB, s string, args ...interface{}) { _, err := db.Exec(s, args...) @@ -148,6 +148,11 @@ func upgradedb() { doordie(db, "update config set value = 36 where key = 'dbversion'") fallthrough case 36: + doordie(db, "alter table honkers add column folxid text") + doordie(db, "update honkers set folxid = 'lostdata'") + doordie(db, "update config set value = 37 where key = 'dbversion'") + fallthrough + case 37: default: log.Fatalf("can't upgrade unknown version %d", dbversion)