feat: Support per-dispensary schedules (not just per-state)
- Add dispensary_id column to task_schedules table - Update scheduler to handle single-dispensary schedules - Update run-now endpoint to handle single-dispensary schedules - Update frontend modal to pass dispensary_id when 1 store selected - Fix existing "Deeply Rooted Hourly" schedule with dispensary_id=112 Now when you select ONE store and check "Make recurring", it creates a schedule that runs for that specific store every interval. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
12
backend/migrations/103_schedule_dispensary_id.sql
Normal file
12
backend/migrations/103_schedule_dispensary_id.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- Migration: 103_schedule_dispensary_id.sql
|
||||
-- Description: Add dispensary_id to task_schedules for per-store schedules
|
||||
-- Created: 2025-12-13
|
||||
|
||||
-- Add dispensary_id column for single-store schedules
|
||||
ALTER TABLE task_schedules
|
||||
ADD COLUMN IF NOT EXISTS dispensary_id INTEGER REFERENCES dispensaries(id);
|
||||
|
||||
-- Index for quick lookups
|
||||
CREATE INDEX IF NOT EXISTS idx_task_schedules_dispensary_id ON task_schedules(dispensary_id);
|
||||
|
||||
COMMENT ON COLUMN task_schedules.dispensary_id IS 'For single-store schedules. If set, only this store is refreshed. If NULL, uses state_code for all stores in state.';
|
||||
Reference in New Issue
Block a user