remove books table from postgres

This commit is contained in:
CJ Cobb
2021-05-29 09:52:02 -04:00
parent 7f16951a18
commit 4c12bb51dd
3 changed files with 0 additions and 15 deletions

View File

@@ -841,15 +841,6 @@ create table if not exists account_transactions5 partition of account_transactio
create table if not exists account_transactions6 partition of account_transactions for values from (50000000) to (60000000);
create table if not exists account_transactions7 partition of account_transactions for values from (60000000) to (70000000);
-- Table that maps a book to a list of offers in that book. Deletes from the ledger table
-- cascade here based on ledger_seq.
CREATE TABLE IF NOT EXISTS books (
ledger_seq bigint NOT NULL,
book bytea NOT NULL,
offer_key bytea NOT NULL
);
CREATE INDEX book_idx ON books using btree(ledger_seq, book, offer_key);
CREATE TABLE IF NOT EXISTS keys (
ledger_seq bigint NOT NULL,

View File

@@ -643,9 +643,6 @@ PostgresBackend::doFinishWrites() const
std::string keysStr = keysBuffer_.str();
if (keysStr.size())
writeConnection_.bulkInsert("keys", keysStr);
std::string booksStr = booksBuffer_.str();
if (booksStr.size())
writeConnection_.bulkInsert("books", booksStr);
}
auto res = writeConnection_("COMMIT");
if (!res || res.status() != PGRES_COMMAND_OK)
@@ -658,8 +655,6 @@ PostgresBackend::doFinishWrites() const
transactionsBuffer_.clear();
objectsBuffer_.str("");
objectsBuffer_.clear();
booksBuffer_.str("");
booksBuffer_.clear();
keysBuffer_.str("");
keysBuffer_.clear();
accountTxBuffer_.str("");

View File

@@ -9,7 +9,6 @@ class PostgresBackend : public BackendInterface
private:
mutable size_t numRowsInObjectsBuffer_ = 0;
mutable std::stringstream objectsBuffer_;
mutable std::stringstream booksBuffer_;
mutable std::stringstream keysBuffer_;
mutable std::stringstream transactionsBuffer_;
mutable std::stringstream accountTxBuffer_;