diff --git a/app/lib/dal/indexDAL/sqlite/SqliteTable.ts b/app/lib/dal/indexDAL/sqlite/SqliteTable.ts index 4310529cbe7b8107ca219d882d9ac386962c99c7..756d367c5df96461a44543f3b6def81e66b3cf24 100644 --- a/app/lib/dal/indexDAL/sqlite/SqliteTable.ts +++ b/app/lib/dal/indexDAL/sqlite/SqliteTable.ts @@ -70,7 +70,7 @@ export class SqliteTable<T> { generateCreateIndexes() { return this.keys() - .filter(key => this.fields[key]?.indexed) + .filter((key) => this.fields[key]?.indexed) .map((fieldName) => { return `CREATE INDEX IF NOT EXISTS idx_${this.name}_${fieldName} ON ${this.name} (${fieldName});\n`; }) diff --git a/app/lib/dal/indexDAL/sqlite/SqliteTransactions.ts b/app/lib/dal/indexDAL/sqlite/SqliteTransactions.ts index af3360ecd853df127afdea381d71a4cfe35aab5a..0298fd57cf350b76660ea1992ddd8cdb82ebe3f6 100644 --- a/app/lib/dal/indexDAL/sqlite/SqliteTransactions.ts +++ b/app/lib/dal/indexDAL/sqlite/SqliteTransactions.ts @@ -18,14 +18,27 @@ export class SqliteTransactions extends SqliteTable<DBTx> implements TxsDAO { "txs", { hash: new SqlNotNullableFieldDefinition("VARCHAR", true, 70), - block_number: new SqlNullableFieldDefinition("INT", true /*need by getTxHistoryByPubkeyBetweenBlocks() */), + block_number: new SqlNullableFieldDefinition( + "INT", + true /*need by getTxHistoryByPubkeyBetweenBlocks() */ + ), locktime: new SqlNullableFieldDefinition("INT", false), version: new SqlNullableFieldDefinition("INT", false), currency: new SqlNullableFieldDefinition("VARCHAR", false, 10), comment: new SqlNullableFieldDefinition("TEXT", false), - blockstamp: new SqlNullableFieldDefinition("VARCHAR", true /* need by getWrittenOn() */, 100), - blockstampTime: new SqlNullableFieldDefinition("INT", true /* need by trimExpiredNonWrittenTxs() */), - time: new SqlNullableFieldDefinition("INT", true /*need by getTxHistoryByPubkeyBetweenTimes() */ ), + blockstamp: new SqlNullableFieldDefinition( + "VARCHAR", + true /* need by getWrittenOn() */, + 100 + ), + blockstampTime: new SqlNullableFieldDefinition( + "INT", + true /* need by trimExpiredNonWrittenTxs() */ + ), + time: new SqlNullableFieldDefinition( + "INT", + true /*need by getTxHistoryByPubkeyBetweenTimes() */ + ), inputs: new SqlNullableFieldDefinition("JSON", false), unlocks: new SqlNullableFieldDefinition("JSON", false), outputs: new SqlNullableFieldDefinition("JSON", false), @@ -42,8 +55,14 @@ export class SqliteTransactions extends SqliteTable<DBTx> implements TxsDAO { 50 ) /* computed column - need by getTxHistoryXxx() */, recipients: new SqlNullableFieldDefinition("JSON", false), - written: new SqlNotNullableFieldDefinition("BOOLEAN", true /* need by getTxHistoryMempool() */), - removed: new SqlNotNullableFieldDefinition("BOOLEAN", true /* need by getSandboxTs() */), + written: new SqlNotNullableFieldDefinition( + "BOOLEAN", + true /* need by getTxHistoryMempool() */ + ), + removed: new SqlNotNullableFieldDefinition( + "BOOLEAN", + true /* need by getSandboxTs() */ + ), received: new SqlNullableFieldDefinition("BOOLEAN", false), output_base: new SqlNullableFieldDefinition("INT", false), output_amount: new SqlNullableFieldDefinition("INT", false),