diff --git a/init.sql b/init.sql index 90f26818..af146d63 100644 --- a/init.sql +++ b/init.sql @@ -6,14 +6,14 @@ CREATE TABLE IF NOT EXISTS squeak ( hashReplySqk CHAR(64) NOT NULL, hashBlock CHAR(64) NOT NULL, nBlockHeight INTEGER NOT NULL, - scriptPubKey bytea NOT NULL, - encryptionKey bytea NOT NULL, + vchScriptPubKey bytea NOT NULL, + vchEncryptionKey bytea NOT NULL, encDatakey CHAR(256) NOT NULL, - vchIv CHAR(32) NOT NULL, + iv CHAR(32) NOT NULL, nTime INTEGER NOT NULL, nNonce BIGINT NOT NULL, encContent CHAR(2272) NOT NULL, -- Encrypted content length is always 1136 bytes (2272 hex characters). - scriptSig bytea NOT NULL, + vchScriptSig bytea NOT NULL, address VARCHAR(35) NOT NULL, -- Maximum length of a bitcoin address is 35. vchDecryptionKey bytea ); diff --git a/squeakserver/server/postgres_db.py b/squeakserver/server/postgres_db.py index 5e6146eb..32b925df 100644 --- a/squeakserver/server/postgres_db.py +++ b/squeakserver/server/postgres_db.py @@ -51,7 +51,7 @@ class PostgresDb(): def insert_squeak(self, squeak): """ Insert a new squeak. """ sql = """ - INSERT INTO squeak(hash, nVersion, hashEncContent, hashReplySqk, hashBlock, nBlockHeight, scriptPubKey, encryptionKey, encDatakey, vchIv, nTime, nNonce, encContent, scriptSig, address, vchDecryptionKey) + INSERT INTO squeak(hash, nVersion, hashEncContent, hashReplySqk, hashBlock, nBlockHeight, vchScriptPubKey, vchEncryptionKey, encDatakey, iv, nTime, nNonce, encContent, vchScriptSig, address, vchDecryptionKey) VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING hash;"""