- Make residence_id nullable in contractor model - Add created_by_id field to track contractor creator - Update access control: personal contractors visible only to creator, residence contractors visible to all residence users - Add database migration for schema changes - Update admin panel DTOs and handlers for optional residence - Fix test utilities for new model structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5 lines
195 B
SQL
5 lines
195 B
SQL
-- Make residence_id optional for contractors
|
|
-- Allows contractors to be personal (no residence) or shared (with residence)
|
|
|
|
ALTER TABLE task_contractor ALTER COLUMN residence_id DROP NOT NULL;
|