mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-21 14:18:17 +02:00
Switch to local PostgreSQL configuration and improve data handling
Migrates from Neon serverless to local PostgreSQL, fixes timestamp comparisons, and applies Node.js 18 compatibility fixes. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/142044c4-d937-4abb-ae50-83d9764cfb4d.jpg
This commit is contained in:
1 parent
49e15b7e46
commit
1baefe2767
5 files changed
+274
-115
No files matched your search
@@ -18,7 +18,7 @@ export async function purgeSalesData() {
|
||||
// Supprimer les ventes antérieures à la date limite
|
||||
const result = await db
|
||||
.delete(sales)
|
||||
.where(lt(sales.timestamp, cutoffDate.toISOString()))
|
||||
.where(lt(sales.timestamp, cutoffDate))
|
||||
.returning({ id: sales.id });
|
||||
|
||||
const deletedCount = result.length;
|
||||
@@ -58,7 +58,7 @@ export async function getPurgeStats() {
|
||||
const oldSales = await db
|
||||
.select({ id: sales.id })
|
||||
.from(sales)
|
||||
.where(lt(sales.timestamp, cutoffDate.toISOString()));
|
||||
.where(lt(sales.timestamp, cutoffDate));
|
||||
|
||||
// Compter le total des ventes
|
||||
const totalSales = await db
|
||||
|
||||
Reference in new issue
Block a user