mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
Prepared SQL migrations for adding due_date support to todos. Migrations: - 003_add_due_date_to_todos.sql - Adds due_date column to todos table - 004_add_due_date_to_global_todos.sql - Adds due_date column to global_todos table Features: - TIMESTAMPTZ column for timezone-aware dates - Indexes on due_date for query performance - Composite indexes on (completed, due_date) for filtering Note: Backend and frontend implementation pending. These migrations are ready to be applied when the feature is completed.
12 lines
518 B
SQL
12 lines
518 B
SQL
-- Migration: Add due_date to todos table
|
|
-- Description: Adds a due_date column to track task deadlines
|
|
|
|
-- Add due_date column to todos table
|
|
ALTER TABLE todos ADD COLUMN IF NOT EXISTS due_date TIMESTAMPTZ;
|
|
|
|
-- Create index on due_date for faster queries
|
|
CREATE INDEX IF NOT EXISTS idx_todos_due_date ON todos(due_date);
|
|
|
|
-- Create index on combination of completed and due_date for efficient queries of pending tasks
|
|
CREATE INDEX IF NOT EXISTS idx_todos_completed_due_date ON todos(completed, due_date);
|