Download backend/migrations/001_add_progress_fields.sql from new-arc/vector: direct link, hf CLI and curl.
- Browser
- Download file 977 Bytes
-
https://huggingface.co/spaces/new-arc/vector/resolve/main/backend/migrations/001_add_progress_fields.sql
- Command line
-
hf download hf://spaces/new-arc/vector/backend/migrations/001_add_progress_fields.sql
-
curl -L -o 001_add_progress_fields.sql https://huggingface.co/spaces/new-arc/vector/resolve/main/backend/migrations/001_add_progress_fields.sql
977 Bytes
| -- Migration: Add progress tracking fields to tasks table | |
| -- This migration can be run on existing databases | |
| -- Add progress columns if they don't exist | |
| DO $$ | |
| BEGIN | |
| -- Add progress column | |
| IF NOT EXISTS ( | |
| SELECT 1 FROM information_schema.columns | |
| WHERE table_name = 'tasks' AND column_name = 'progress' | |
| ) THEN | |
| ALTER TABLE tasks ADD COLUMN progress INTEGER DEFAULT 0 CHECK (progress >= 0 AND progress <= 100); | |
| END IF; | |
| -- Add progress_message column | |
| IF NOT EXISTS ( | |
| SELECT 1 FROM information_schema.columns | |
| WHERE table_name = 'tasks' AND column_name = 'progress_message' | |
| ) THEN | |
| ALTER TABLE tasks ADD COLUMN progress_message TEXT; | |
| END IF; | |
| END $$; | |
| -- Update existing tasks to have progress = 0 | |
| UPDATE tasks SET progress = 0 WHERE progress IS NULL; | |
| COMMENT ON COLUMN tasks.progress IS 'Task progress percentage (0-100)'; | |
| COMMENT ON COLUMN tasks.progress_message IS 'Human-readable progress message'; | |