going to need userid in zonkers table too

This commit is contained in:
Ted Unangst 2019-04-19 22:34:39 -04:00
parent 6283a96e4d
commit b2b21b9ba6
2 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ create table donks (honkid integer, fileid integer);
create table files(fileid integer primary key, xid text, name text, url text, media text, content blob); create table files(fileid integer primary key, xid text, name text, url text, media text, content blob);
create table honkers (honkerid integer primary key, userid integer, name text, xid text, flavor text, pubkey text); create table honkers (honkerid integer primary key, userid integer, name text, xid text, flavor text, pubkey text);
create table xonkers (xonkerid integer primary key, xid text, ibox text, obox text, sbox text, pubkey text); create table xonkers (xonkerid integer primary key, xid text, ibox text, obox text, sbox text, pubkey text);
create table zonkers (zonkerid integer primary key, name text, wherefore 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, username text, rcpt text, msg blob); create table doovers(dooverid integer primary key, dt text, tries integer, username text, rcpt text, msg blob);
create index idx_honksxid on honks(xid); create index idx_honksxid on honks(xid);

View File

@ -49,7 +49,7 @@ func upgradedb() {
doordie(db, "insert into xonkers (xid, ibox, obox, sbox, pubkey) select xid, '', '', '', pubkey from honkers where flavor = 'key'") doordie(db, "insert into xonkers (xid, ibox, obox, sbox, pubkey) select xid, '', '', '', pubkey from honkers where flavor = 'key'")
doordie(db, "delete from honkers where flavor = 'key'") doordie(db, "delete from honkers where flavor = 'key'")
doordie(db, "create index idx_xonkerxid on xonkers(xid)") doordie(db, "create index idx_xonkerxid on xonkers(xid)")
doordie(db, "create table zonkers (zonkerid integer primary key, name text, wherefore text)") doordie(db, "create table zonkers (zonkerid integer primary key, userid integer, name text, wherefore text)")
doordie(db, "create index idx_zonkersname on zonkers(name)") doordie(db, "create index idx_zonkersname on zonkers(name)")
doordie(db, "update config set value = 3 where key = 'dbversion'") doordie(db, "update config set value = 3 where key = 'dbversion'")
fallthrough fallthrough