mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-09 11:01:45 +00:00
chore(db): adiciona índice composto para filtros de lançamentos
This commit is contained in:
1
drizzle/0019_ordinary_wild_pack.sql
Normal file
1
drizzle/0019_ordinary_wild_pack.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
CREATE INDEX "lancamentos_user_id_pagador_id_period_idx" ON "lancamentos" USING btree ("user_id","pagador_id","periodo");
|
||||||
2443
drizzle/meta/0019_snapshot.json
Normal file
2443
drizzle/meta/0019_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -134,6 +134,13 @@
|
|||||||
"when": 1773020417482,
|
"when": 1773020417482,
|
||||||
"tag": "0018_rainy_epoch",
|
"tag": "0018_rainy_epoch",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 19,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1773699152928,
|
||||||
|
"tag": "0019_ordinary_wild_pack",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -634,6 +634,12 @@ export const transactions = pgTable(
|
|||||||
table.payerId,
|
table.payerId,
|
||||||
table.period,
|
table.period,
|
||||||
),
|
),
|
||||||
|
// Índice composto para o filtro quente do dashboard: userId + payerId + period
|
||||||
|
userIdPayerIdPeriodIdx: index("lancamentos_user_id_pagador_id_period_idx").on(
|
||||||
|
table.userId,
|
||||||
|
table.payerId,
|
||||||
|
table.period,
|
||||||
|
),
|
||||||
// Índice para queries ordenadas por data de compra
|
// Índice para queries ordenadas por data de compra
|
||||||
userIdPurchaseDateIdx: index("lancamentos_user_id_purchase_date_idx").on(
|
userIdPurchaseDateIdx: index("lancamentos_user_id_purchase_date_idx").on(
|
||||||
table.userId,
|
table.userId,
|
||||||
|
|||||||
Reference in New Issue
Block a user