feat(database): actualizar a sibopay_db con usuario dedicado sibopay_user
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
const { Client } = require('pg');
|
const { Client } = require('pg');
|
||||||
|
|
||||||
const pgUrl = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const pgUrl = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
|
|
||||||
const MAPPING = [
|
const MAPPING = [
|
||||||
{ match: /empanada.*arreglada/i, url: '/img/products/empanada_arreglada.jpg' },
|
{ match: /empanada.*arreglada/i, url: '/img/products/empanada_arreglada.jpg' },
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const { Client } = require('pg');
|
const { Client } = require('pg');
|
||||||
|
|
||||||
const pgUrl = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const pgUrl = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
|
|
||||||
async function runAudit() {
|
async function runAudit() {
|
||||||
const client = new Client({ connectionString: pgUrl });
|
const client = new Client({ connectionString: pgUrl });
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
const { Client } = require('pg');
|
const { Client } = require('pg');
|
||||||
const pgUrl = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const pgUrl = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
const client = new Client({ connectionString: pgUrl });
|
const client = new Client({ connectionString: pgUrl });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const { Client } = require('pg');
|
const { Client } = require('pg');
|
||||||
|
|
||||||
const pgUrl = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const pgUrl = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
|
|
||||||
async function deepAudit() {
|
async function deepAudit() {
|
||||||
const client = new Client({ connectionString: pgUrl });
|
const client = new Client({ connectionString: pgUrl });
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const { Client } = require('pg');
|
const { Client } = require('pg');
|
||||||
|
|
||||||
const pgUrl = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const pgUrl = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
|
|
||||||
async function fixAllNulls() {
|
async function fixAllNulls() {
|
||||||
const client = new Client({ connectionString: pgUrl });
|
const client = new Client({ connectionString: pgUrl });
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const path = require('path');
|
|||||||
const sqlitePath = path.join(__dirname, '..', 'server', 'recreopay.db');
|
const sqlitePath = path.join(__dirname, '..', 'server', 'recreopay.db');
|
||||||
const dbSqlite = new Database(sqlitePath);
|
const dbSqlite = new Database(sqlitePath);
|
||||||
|
|
||||||
const pgUrl = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const pgUrl = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
const client = new Client({ connectionString: pgUrl });
|
const client = new Client({ connectionString: pgUrl });
|
||||||
|
|
||||||
async function migrate() {
|
async function migrate() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const { Client } = require('pg');
|
const { Client } = require('pg');
|
||||||
|
|
||||||
const pgUrl = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const pgUrl = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
|
|
||||||
const NEW_PRODUCTS = [
|
const NEW_PRODUCTS = [
|
||||||
// --- 10 COMIDAS Y SNACKS ---
|
// --- 10 COMIDAS Y SNACKS ---
|
||||||
|
|||||||
+1
-1
@@ -97,7 +97,7 @@ if (isPg) {
|
|||||||
return (...args) => fn(...args);
|
return (...args) => fn(...args);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
console.log('🐘 Conectado a PostgreSQL central (recreopay_db)');
|
console.log('🐘 Conectado a PostgreSQL central (sibopay_db)');
|
||||||
} else {
|
} else {
|
||||||
const Database = require('better-sqlite3');
|
const Database = require('better-sqlite3');
|
||||||
const dbPath = path.join(__dirname, 'recreopay.db');
|
const dbPath = path.join(__dirname, 'recreopay.db');
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ types.setTypeParser(1700, (val) => val === null ? null : parseFloat(val)); // nu
|
|||||||
types.setTypeParser(700, (val) => val === null ? null : parseFloat(val)); // float4 / real
|
types.setTypeParser(700, (val) => val === null ? null : parseFloat(val)); // float4 / real
|
||||||
types.setTypeParser(701, (val) => val === null ? null : parseFloat(val)); // float8 / double precision
|
types.setTypeParser(701, (val) => val === null ? null : parseFloat(val)); // float8 / double precision
|
||||||
|
|
||||||
const connectionString = process.env.DATABASE_URL || 'postgresql://postgres:GammaPos2026@127.0.0.1:5432/recreopay_db';
|
const connectionString = process.env.DATABASE_URL || 'postgresql://sibopay_user:SiboPay_Postgres_2026_SecureKey!@127.0.0.1:5432/sibopay_db';
|
||||||
|
|
||||||
const pool = new Pool({
|
const pool = new Pool({
|
||||||
connectionString,
|
connectionString,
|
||||||
|
|||||||
+3
-3
@@ -1854,7 +1854,7 @@ app.get('/api/developer/stats', (req, res) => {
|
|||||||
const totalDisenos = db.prepare('SELECT COUNT(*) as count FROM disenos_tarjetas WHERE activo = 1').get().count;
|
const totalDisenos = db.prepare('SELECT COUNT(*) as count FROM disenos_tarjetas WHERE activo = 1').get().count;
|
||||||
|
|
||||||
let dbTipo = Boolean(process.env.DATABASE_URL) ? 'PostgreSQL' : 'SQLite';
|
let dbTipo = Boolean(process.env.DATABASE_URL) ? 'PostgreSQL' : 'SQLite';
|
||||||
let dbDetalle = Boolean(process.env.DATABASE_URL) ? 'PostgreSQL Central (recreopay_db)' : 'WAL Mode Activado';
|
let dbDetalle = Boolean(process.env.DATABASE_URL) ? 'PostgreSQL Central (sibopay_db)' : 'WAL Mode Activado';
|
||||||
let dbSizeFormatted = '0 KB';
|
let dbSizeFormatted = '0 KB';
|
||||||
let dbSizeBytes = 0;
|
let dbSizeBytes = 0;
|
||||||
|
|
||||||
@@ -2045,11 +2045,11 @@ async function ejecutarBackupBaseDatos() {
|
|||||||
const targetPath = path.join(backupsDir, filename);
|
const targetPath = path.join(backupsDir, filename);
|
||||||
const dbUrl = process.env.DATABASE_URL;
|
const dbUrl = process.env.DATABASE_URL;
|
||||||
const parsed = new URL(dbUrl);
|
const parsed = new URL(dbUrl);
|
||||||
const user = parsed.username || 'postgres';
|
const user = parsed.username || 'sibopay_user';
|
||||||
const password = parsed.password || '';
|
const password = parsed.password || '';
|
||||||
const host = parsed.hostname || '127.0.0.1';
|
const host = parsed.hostname || '127.0.0.1';
|
||||||
const port = parsed.port || '5432';
|
const port = parsed.port || '5432';
|
||||||
const dbname = parsed.pathname ? parsed.pathname.replace(/^\//, '') : 'recreopay_db';
|
const dbname = parsed.pathname ? parsed.pathname.replace(/^\//, '') : 'sibopay_db';
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const { exec } = require('child_process');
|
const { exec } = require('child_process');
|
||||||
|
|||||||
Reference in New Issue
Block a user