Position gains management_position, distinguishing a coach/manager from other staff (physio, kit manager). A CheckConstraint enforces that a management position is always a staff position. TeamMembership and StaffAssignment validate that their season and position belong to the same club as the team. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
19 lines
549 B
Python
19 lines
549 B
Python
# Generated by Django 6.0.6 on 2026-07-13 07:53
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('club', '0009_clubrole'),
|
|
('teams', '0002_position_management_position'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddConstraint(
|
|
model_name='position',
|
|
constraint=models.CheckConstraint(condition=models.Q(('management_position', False), ('staff_position', True), _connector='OR'), name='management_position_implies_staff_position'),
|
|
),
|
|
]
|