nxtgauge-backend-rust/crates/db/migrations/20260627000000_tracecoin_security_hardening.down.sql
Tracewebstudio Dev eb009ac3d0 feat: profile photo upload, PDF resume generation, AI auto-apply, schema fixes
- Profile photo upload: POST /api/profile/photo for all roles, stores via B2 storage
- PDF resume: auto-generated from job seeker portfolio on every profile save (printpdf)
- Company applications: enriched with applicant name, avatar, headline, skills, education
- AI auto-apply cron: rewrote run_auto_apply with correct schema (job_seeker_profiles,
  cover_note, ai_auto_apply_settings, ai_auto_apply_logs, credit deduction)
- Schema fix: job_seeker_profiles table name (was incorrectly 'job_seekers' in two places)
- Migration: add resume_url column to job_seeker_profiles
- Migrations: PayU rename, tracecoin hardening, lead reserve linkage, invoice/wallet crates
- PayU integration: ai_credits, packages, admin payment handlers
- Wallet and invoice crates added

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 13:31:06 +02:00

20 lines
1.1 KiB
SQL

-- Rollback tracecoin security hardening.
DROP TRIGGER IF EXISTS trg_tracecoin_ledger_no_delete ON tracecoin_ledger;
DROP TRIGGER IF EXISTS trg_tracecoin_ledger_no_update ON tracecoin_ledger;
DROP FUNCTION IF EXISTS tracecoin_ledger_immutable();
DROP FUNCTION IF EXISTS lock_tracecoin_wallet(UUID);
DROP INDEX IF EXISTS idx_tracecoin_ledger_type;
DROP INDEX IF EXISTS idx_tracecoin_ledger_wallet_created;
DROP INDEX IF EXISTS uq_tracecoin_ledger_wallet_reference_type;
ALTER TABLE tracecoin_ledger DROP CONSTRAINT IF EXISTS tracecoin_ledger_type_valid;
ALTER TABLE tracecoin_ledger DROP CONSTRAINT IF EXISTS tracecoin_ledger_amount_nonzero;
ALTER TABLE tracecoin_ledger DROP CONSTRAINT IF EXISTS tracecoin_wallets_balance_consistent;
ALTER TABLE tracecoin_wallets DROP CONSTRAINT IF EXISTS tracecoin_wallets_reserved_nonneg;
ALTER TABLE tracecoin_wallets DROP CONSTRAINT IF EXISTS tracecoin_wallets_balance_nonneg;
ALTER TABLE tracecoin_ledger DROP COLUMN IF EXISTS metadata;
ALTER TABLE tracecoin_ledger DROP COLUMN IF EXISTS actor_user_id;
ALTER TABLE tracecoin_ledger DROP COLUMN IF EXISTS balance_after;