-- Migration: Add deleted field to projects table
-- This script adds a deleted boolean field to mark projects as deleted (soft delete)

-- Add deleted column to projects table
ALTER TABLE projects 
ADD COLUMN IF NOT EXISTS deleted BOOLEAN NOT NULL DEFAULT FALSE;

-- Create index on deleted column for better query performance
CREATE INDEX IF NOT EXISTS idx_projects_deleted ON projects(deleted);

-- Add comment for documentation
COMMENT ON COLUMN projects.deleted IS 'Soft delete flag: TRUE if project is deleted, FALSE otherwise';

