Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

056_RemoveRedundantProjectionIndexes.ts

12 lines580 Bytes

1import * as Effect from "effect/Effect";
2import * as SqlClient from "effect/sql/SqlClient";
3​
4export default Effect.gen(function* () {
5 const sql = yield* SqlClient.SqlClient;
6​
7 // Later indexes cover the same column prefixes; avoid maintaining duplicate B-trees.
8 yield* sql`DROP INDEX IF EXISTS idx_projection_threads_project_id`;
9 yield* sql`DROP INDEX IF EXISTS idx_projection_thread_messages_thread_created`;
10 yield* sql`DROP INDEX IF EXISTS idx_projection_thread_activities_thread_sequence`;
11 yield* sql`DROP INDEX IF EXISTS idx_projection_turns_thread_requested`;
12});