Skip to content

Commit

Permalink
Merge pull request #22 from RyanPear/v0.0.2
Browse files Browse the repository at this point in the history
sqlite3 rowid changed to autoincremnet
  • Loading branch information
BarraRoffe committed Sep 9, 2015
2 parents 4f497c3 + 3a22eef commit 48a3d50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/repserver/messagestore/sql/queries.go
Expand Up @@ -158,7 +158,7 @@ var (
},
"sqlite3": map[string]string{
"SignerCreate": `CREATE TABLE IF NOT EXISTS signer (
ID INTEGER PRIMARY KEY,
ID INTEGER PRIMARY KEY AUTOINCREMENT,
PublicKey VARCHAR(` + strconv.FormatInt(message.SignerPubKeySize*2, 10) + `) NOT NULL,
Nonce VARCHAR(` + strconv.FormatInt(hashcash.NonceSize*2, 10) + `) NOT NULL,
Bits INT NOT NULL DEFAULT 0,
Expand Down Expand Up @@ -201,7 +201,7 @@ var (
WHERE LastMessageDeleted!=0 AND LastMessageDeleted<?
;`,
"PeerCreate": `CREATE TABLE IF NOT EXISTS peer (
ID INTEGER PRIMARY KEY,
ID INTEGER PRIMARY KEY AUTOINCREMENT,
PublicKey VARCHAR(` + strconv.FormatInt(ed25519.PublicKeySize*2, 10) + `) NOT NULL,
AuthToken TEXT NOT NULL DEFAULT "",
LastNotifySend BIGINT UNSIGNED NOT NULL DEFAULT 0,
Expand All @@ -217,7 +217,7 @@ var (
"UpdateTokenPeer": `UPDATE peer SET LastNotifyFrom=?, Authtoken=? WHERE PublicKey=?;`,
"SelectPeer": `SELECT AuthToken, LastNotifySend, LastNotifyFrom, LastFetch, ErrorCount, LastPosition FROM peer WHERE PublicKey=?;`,
"MessageCreate": `CREATE TABLE IF NOT EXISTS message (
ID INTEGER PRIMARY KEY,
ID INTEGER PRIMARY KEY AUTOINCREMENT,
Counter BIGINT UNSIGNED NOT NULL DEFAULT 0,
MessageID VARCHAR(` + strconv.FormatInt(message.MessageIDSize*2, 10) + `) NOT NULL,
ReceiverConstantPubKey VARCHAR(` + strconv.FormatInt(message.Curve25519KeySize*2, 10) + `) NOT NULL,
Expand Down Expand Up @@ -255,7 +255,7 @@ var (
"InsertMessageCounter": `INSERT INTO messageCounter (ReceiverConstantPubKey, LastTime) VALUES (?,? );`,
"ExpireMessageCounter": `DELETE FROM messageCounter WHERE LastTime<?;`,
"GlobalIndexCreate": `CREATE TABLE IF NOT EXISTS globalindex (
ID INTEGER PRIMARY KEY,
ID INTEGER PRIMARY KEY AUTOINCREMENT,
Message BIGINT UNSIGNED NOT NULL,
EntryTime BIGINT UNSIGNED NOT NULL DEFAULT 0,
UNIQUE (Message),
Expand Down

0 comments on commit 48a3d50

Please sign in to comment.