diff --git a/src/dbstore/index.ts b/src/dbstore/index.ts index 1bb31108..0e5ae727 100644 --- a/src/dbstore/index.ts +++ b/src/dbstore/index.ts @@ -7,10 +7,10 @@ export const initializeDB = async (config: Config): Promise => { 'CREATE TABLE if not exists `transactions` (`txId` TEXT NOT NULL UNIQUE PRIMARY KEY, `appReceiptId` TEXT, `timestamp` BIGINT NOT NULL, `cycleNumber` NUMBER NOT NULL, `data` JSON NOT NULL, `originalTxData` JSON NOT NULL)' ) await db.runCreate( - 'CREATE INDEX if not exists `transactions_cycleNumber` ON `transactions` (`cycleNumber` DESC)' + 'CREATE INDEX if not exists `transactions_cycleNumber` ON `transactions` (`cycleNumber` ASC)' ) await db.runCreate( - 'CREATE INDEX if not exists `transactions_timestamp` ON `transactions` (`timestamp` DESC)' + 'CREATE INDEX if not exists `transactions_timestamp` ON `transactions` (`timestamp` ASC)' ) await db.runCreate( 'CREATE INDEX if not exists `transactions_appReceiptId_idx` ON `transactions` (`appReceiptId`)' @@ -18,12 +18,12 @@ export const initializeDB = async (config: Config): Promise => { await db.runCreate( 'CREATE TABLE if not exists `cycles` (`cycleMarker` TEXT NOT NULL UNIQUE PRIMARY KEY, `counter` NUMBER NOT NULL, `cycleRecord` JSON NOT NULL)' ) - await db.runCreate('CREATE INDEX if not exists `cycles_idx` ON `cycles` (`counter` DESC)') + await db.runCreate('CREATE INDEX if not exists `cycles_idx` ON `cycles` (`counter` ASC)') await db.runCreate( 'CREATE TABLE if not exists `accounts` (`accountId` TEXT NOT NULL UNIQUE PRIMARY KEY, `data` JSON NOT NULL, `timestamp` BIGINT NOT NULL, `hash` TEXT NOT NULL, `cycleNumber` NUMBER NOT NULL, `isGlobal` BOOLEAN NOT NULL)' ) - await db.runCreate('CREATE INDEX if not exists `accounts_cycleNumber` ON `accounts` (`cycleNumber` DESC)') - await db.runCreate('CREATE INDEX if not exists `accounts_timestamp` ON `accounts` (`timestamp` DESC)') + await db.runCreate('CREATE INDEX if not exists `accounts_cycleNumber` ON `accounts` (`cycleNumber` ASC)') + await db.runCreate('CREATE INDEX if not exists `accounts_timestamp` ON `accounts` (`timestamp` ASC)') await db.runCreate( 'CREATE TABLE if not exists `receipts` (`receiptId` TEXT NOT NULL UNIQUE PRIMARY KEY, `tx` JSON NOT NULL, `cycle` NUMBER NOT NULL, `timestamp` BIGINT NOT NULL, `beforeStateAccounts` JSON, `accounts` JSON NOT NULL, `appliedReceipt` JSON NOT NULL, `appReceiptData` JSON, `executionShardKey` TEXT NOT NULL, `globalModification` BOOLEAN NOT NULL)' )