@bsv/overlay
Version:
BSV Blockchain Overlay Services Engine
33 lines • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.up = up;
exports.down = down;
async function up(knex) {
// Add index for applied_transactions table
await knex.schema.table('applied_transactions', function (table) {
table.index(['txid', 'topic'], 'idx_applied_transactions_txid_topic');
});
// Add index for transactions table
await knex.schema.table('transactions', function (table) {
table.index('txid', 'idx_transactions_txid');
});
// Add index for outputs table
await knex.schema.table('outputs', function (table) {
table.index(['txid', 'outputIndex', 'topic'], 'idx_outputs_txid_outputIndex_topic');
});
}
async function down(knex) {
// Drop index for applied_transactions table
await knex.schema.table('applied_transactions', function (table) {
table.dropIndex(['txid', 'topic'], 'idx_applied_transactions_txid_topic');
});
// Drop index for transactions table
await knex.schema.table('transactions', function (table) {
table.dropIndex('txid', 'idx_transactions_txid');
});
// Drop index for outputs table
await knex.schema.table('outputs', function (table) {
table.dropIndex(['txid', 'outputIndex', 'topic'], 'idx_outputs_txid_outputIndex_topic');
});
}
//# sourceMappingURL=2024-07-18-001-indexes.js.map