HR-ATS-Portal/backend/migrations/manual/018_talent_run_cost.sql

11 lines
505 B
SQL

-- 018_talent_run_cost.sql
-- Per-run Apify spend on talent_runs. `cost_usd` accumulates usageTotalUsd
-- across the re-arm ladder (one logical run can span several billed Apify
-- runs), folded in once per finished actor run. Feeds the Find Talent
-- balance/spend/$-per-profile chips. Applied at startup by
-- alembic_setup.run_manual_sql(); needed because prod boots with
-- DB_AUTOGENERATE=false.
ALTER TABLE app.talent_runs
ADD COLUMN IF NOT EXISTS cost_usd DOUBLE PRECISION NOT NULL DEFAULT 0;