Smooth analytics page reloads
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 34s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 34s
This commit is contained in:
@@ -155,6 +155,23 @@ const initDB = async () => {
|
||||
|
||||
await pool.query(`CREATE INDEX IF NOT EXISTS idx_stock_campaign_queue_status ON stock_campaign_queue (status);`);
|
||||
await pool.query(`CREATE INDEX IF NOT EXISTS idx_orders_cliente_fone ON orders (cliente_fone);`);
|
||||
await pool.query(`
|
||||
CREATE INDEX IF NOT EXISTS idx_orders_normalized_cliente_nome
|
||||
ON orders ((NULLIF(LOWER(TRIM(regexp_replace(COALESCE(cliente_nome, ''), '\\s+', ' ', 'g'))), '')));
|
||||
`).catch(err => {
|
||||
console.error('Notice: Could not create normalized client name index:', err.message);
|
||||
});
|
||||
await pool.query(`
|
||||
CREATE INDEX IF NOT EXISTS idx_orders_normalized_cliente_nome_phone_date
|
||||
ON orders (
|
||||
(NULLIF(LOWER(TRIM(regexp_replace(COALESCE(cliente_nome, ''), '\\s+', ' ', 'g'))), '')),
|
||||
data_pedido_date DESC,
|
||||
id DESC
|
||||
)
|
||||
WHERE NULLIF(cliente_fone, '') IS NOT NULL;
|
||||
`).catch(err => {
|
||||
console.error('Notice: Could not create normalized client phone lookup index:', err.message);
|
||||
});
|
||||
await pool.query(`
|
||||
CREATE INDEX IF NOT EXISTS idx_orders_customer_key_date
|
||||
ON orders (
|
||||
|
||||
Reference in New Issue
Block a user