mirror of
https://github.com/bitbaum/orangecat.git
synced 2026-12-05 13:37:15 +01:00
The live `transactions` table was the dead legacy funding-page schema (funding_page_id/transaction_hash NOT NULL, 0 rows, target funding_pages table gone), but all current code speaks an entity schema no migration defined — so wallet transfers and project contributions 400'd silently, and the transfer_between_wallets RPC the transfer path calls didn't exist. Safe rebuild (0 rows, no inbound FKs): - recreate transactions with the entity schema both writers agree on (/api/transactions + domain/wallets/transferService) — verified both payloads insert cleanly - RLS: sender must be auth.uid() (profile) or a project wallet they own; verified real user passes, spoofed sender blocked - add transfer_between_wallets(uuid,uuid,numeric,uuid): atomic, row-locked, re-checks balance — verified happy-path moves funds + overdraw raises Applied to the self-host box; schema-drift audit now green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Scripts Directory
This directory contains all automation scripts organized by purpose.
Directory Structure
analysis/- Bundle analysis, documentation checking, and optimization toolsauth-fix/- Scripts to fix authentication and RLS policy issuesdb/- Database operations, migrations, and schema management- Migration scripts moved from root:
apply-migration.js,apply-*-migration.js - Old schema files archived in
db/archive/
- Migration scripts moved from root:
deployment/- Deployment, production setup, and monitoring scriptsdev/- Development helpers, local setup, and debugging toolsdiagnostics/- Health checks and system diagnosticsmaintenance/- Cleanup, optimization, and maintenance scriptsmonitoring/- Performance monitoring and bundle size trackingoauth/- OAuth provider setup and configurationprofile-fix/- Scripts to fix profile-related issuesschema-fix/- Database schema fixes and migrationsstorage/- Supabase storage bucket setup and managementtest/- Testing utilities and validation scripts- Test/debug scripts moved from root:
test-*.js,check-*.js,debug-*.js
- Test/debug scripts moved from root:
Usage
Most scripts can be run with:
node scripts/{category}/script-name.js
For deployment scripts:
bash scripts/deployment/script-name.sh
Important Scripts
scripts/dev/dev-start.js- Main development server starterscripts/deployment/browser-verify.js- Post-deploy browser smoke test (deploys themselves happen on the box — see docs/deployment/DEPLOYMENT_PROCESS.md)scripts/db/apply-migrations.ts- Database migrationsscripts/maintenance/cleanup-console-logs.ts- Remove console.log statements