Updates
This commit is contained in:
261
ETB-API/collaboration_war_rooms/migrations/0001_initial.py
Normal file
261
ETB-API/collaboration_war_rooms/migrations/0001_initial.py
Normal file
@@ -0,0 +1,261 @@
|
||||
# Generated by Django 5.2.6 on 2025-09-18 16:26
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('automation_orchestration', '0002_autoremediationexecution_sla_instance_and_more'),
|
||||
('incident_intelligence', '0004_incident_oncall_assignment_incident_sla_override_and_more'),
|
||||
('security', '0002_user_emergency_contact_user_oncall_preferences_and_more'),
|
||||
('sla_oncall', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ConferenceBridge',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
('bridge_type', models.CharField(choices=[('ZOOM', 'Zoom'), ('TEAMS', 'Microsoft Teams'), ('WEBEX', 'Cisco Webex'), ('GOTO_MEETING', 'GoTo Meeting'), ('CUSTOM', 'Custom Bridge')], max_length=20)),
|
||||
('status', models.CharField(choices=[('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('ENDED', 'Ended'), ('CANCELLED', 'Cancelled')], default='SCHEDULED', max_length=20)),
|
||||
('meeting_id', models.CharField(blank=True, help_text='External meeting ID', max_length=255, null=True)),
|
||||
('meeting_url', models.URLField(blank=True, help_text='Meeting URL', null=True)),
|
||||
('dial_in_number', models.CharField(blank=True, help_text='Dial-in phone number', max_length=50, null=True)),
|
||||
('access_code', models.CharField(blank=True, help_text='Access code for dial-in', max_length=20, null=True)),
|
||||
('scheduled_start', models.DateTimeField(help_text='Scheduled start time')),
|
||||
('scheduled_end', models.DateTimeField(help_text='Scheduled end time')),
|
||||
('actual_start', models.DateTimeField(blank=True, null=True)),
|
||||
('actual_end', models.DateTimeField(blank=True, null=True)),
|
||||
('max_participants', models.PositiveIntegerField(default=50)),
|
||||
('recording_enabled', models.BooleanField(default=False)),
|
||||
('recording_url', models.URLField(blank=True, help_text='URL to recorded meeting', null=True)),
|
||||
('transcription_enabled', models.BooleanField(default=False)),
|
||||
('transcription_url', models.URLField(blank=True, help_text='URL to meeting transcription', null=True)),
|
||||
('integration_config', models.JSONField(default=dict, help_text='Configuration for external bridge integration')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('active_participants', models.ManyToManyField(blank=True, help_text='Users currently in the conference', related_name='active_conferences', to=settings.AUTH_USER_MODEL)),
|
||||
('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_conferences', to=settings.AUTH_USER_MODEL)),
|
||||
('incident', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='conference_bridges', to='incident_intelligence.incident')),
|
||||
('invited_participants', models.ManyToManyField(blank=True, help_text='Users invited to the conference', related_name='invited_conferences', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-scheduled_start'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='IncidentCommandRole',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('role_type', models.CharField(choices=[('INCIDENT_COMMANDER', 'Incident Commander'), ('SCRIBE', 'Scribe'), ('COMMS_LEAD', 'Communications Lead'), ('TECHNICAL_LEAD', 'Technical Lead'), ('BUSINESS_LEAD', 'Business Lead'), ('EXTERNAL_LIAISON', 'External Liaison'), ('OBSERVER', 'Observer')], max_length=30)),
|
||||
('status', models.CharField(choices=[('ACTIVE', 'Active'), ('INACTIVE', 'Inactive'), ('REASSIGNED', 'Reassigned')], default='ACTIVE', max_length=20)),
|
||||
('responsibilities', models.JSONField(default=list, help_text='List of responsibilities for this role')),
|
||||
('decision_authority', models.JSONField(default=list, help_text='Areas where this role has decision authority')),
|
||||
('assigned_at', models.DateTimeField(auto_now_add=True)),
|
||||
('reassigned_at', models.DateTimeField(blank=True, null=True)),
|
||||
('assignment_notes', models.TextField(blank=True, null=True)),
|
||||
('decisions_made', models.PositiveIntegerField(default=0)),
|
||||
('communications_sent', models.PositiveIntegerField(default=0)),
|
||||
('last_activity', models.DateTimeField(blank=True, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('assigned_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assigned_command_roles', to=settings.AUTH_USER_MODEL)),
|
||||
('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_command_roles', to=settings.AUTH_USER_MODEL)),
|
||||
('incident', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='command_roles', to='incident_intelligence.incident')),
|
||||
('reassigned_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reassigned_command_roles', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-assigned_at'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='WarRoom',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
('status', models.CharField(choices=[('ACTIVE', 'Active'), ('ARCHIVED', 'Archived'), ('CLOSED', 'Closed')], default='ACTIVE', max_length=20)),
|
||||
('privacy_level', models.CharField(choices=[('PUBLIC', 'Public'), ('PRIVATE', 'Private'), ('RESTRICTED', 'Restricted')], default='PRIVATE', max_length=20)),
|
||||
('slack_channel_id', models.CharField(blank=True, help_text='Slack channel ID', max_length=100, null=True)),
|
||||
('teams_channel_id', models.CharField(blank=True, help_text='Teams channel ID', max_length=100, null=True)),
|
||||
('discord_channel_id', models.CharField(blank=True, help_text='Discord channel ID', max_length=100, null=True)),
|
||||
('message_count', models.PositiveIntegerField(default=0)),
|
||||
('last_activity', models.DateTimeField(blank=True, null=True)),
|
||||
('active_participants', models.PositiveIntegerField(default=0)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('archived_at', models.DateTimeField(blank=True, null=True)),
|
||||
('allowed_users', models.ManyToManyField(blank=True, help_text='Users with access to this war room', related_name='accessible_war_rooms', to=settings.AUTH_USER_MODEL)),
|
||||
('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_war_rooms', to=settings.AUTH_USER_MODEL)),
|
||||
('incident', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='war_rooms', to='incident_intelligence.incident')),
|
||||
('required_clearance_level', models.ForeignKey(blank=True, help_text='Required clearance level for access', null=True, on_delete=django.db.models.deletion.SET_NULL, to='security.dataclassification')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created_at'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TimelineEvent',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('event_type', models.CharField(choices=[('INCIDENT_CREATED', 'Incident Created'), ('INCIDENT_UPDATED', 'Incident Updated'), ('ASSIGNMENT_CHANGED', 'Assignment Changed'), ('STATUS_CHANGED', 'Status Changed'), ('SEVERITY_CHANGED', 'Severity Changed'), ('COMMENT_ADDED', 'Comment Added'), ('RUNBOOK_EXECUTED', 'Runbook Executed'), ('AUTO_REMEDIATION_ATTEMPTED', 'Auto-remediation Attempted'), ('SLA_BREACHED', 'SLA Breached'), ('ESCALATION_TRIGGERED', 'Escalation Triggered'), ('WAR_ROOM_CREATED', 'War Room Created'), ('CONFERENCE_STARTED', 'Conference Started'), ('COMMAND_ROLE_ASSIGNED', 'Command Role Assigned'), ('DECISION_MADE', 'Decision Made'), ('COMMUNICATION_SENT', 'Communication Sent'), ('EXTERNAL_INTEGRATION', 'External Integration'), ('MANUAL_EVENT', 'Manual Event')], max_length=30)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('description', models.TextField()),
|
||||
('source_type', models.CharField(choices=[('SYSTEM', 'System Generated'), ('USER', 'User Created'), ('INTEGRATION', 'External Integration'), ('AUTOMATION', 'Automation')], default='SYSTEM', max_length=20)),
|
||||
('event_time', models.DateTimeField(help_text='When the event occurred')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('event_data', models.JSONField(default=dict, help_text='Additional data related to the event')),
|
||||
('tags', models.JSONField(default=list, help_text='Tags for categorization and filtering')),
|
||||
('is_critical_event', models.BooleanField(default=False, help_text='Whether this event is critical for postmortem analysis')),
|
||||
('postmortem_notes', models.TextField(blank=True, help_text='Additional notes added during postmortem', null=True)),
|
||||
('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_timeline_events', to=settings.AUTH_USER_MODEL)),
|
||||
('incident', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='timeline_events', to='incident_intelligence.incident')),
|
||||
('related_auto_remediation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to='automation_orchestration.autoremediationexecution')),
|
||||
('related_command_role', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to='collaboration_war_rooms.incidentcommandrole')),
|
||||
('related_conference', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to='collaboration_war_rooms.conferencebridge')),
|
||||
('related_escalation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to='sla_oncall.escalationinstance')),
|
||||
('related_runbook_execution', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to='automation_orchestration.runbookexecution')),
|
||||
('related_sla_instance', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to='sla_oncall.slainstance')),
|
||||
('related_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to=settings.AUTH_USER_MODEL)),
|
||||
('related_war_room', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='timeline_events', to='collaboration_war_rooms.warroom')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['event_time', 'created_at'],
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='incidentcommandrole',
|
||||
name='war_room',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='command_roles', to='collaboration_war_rooms.warroom'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='conferencebridge',
|
||||
name='war_room',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='conference_bridges', to='collaboration_war_rooms.warroom'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='WarRoomMessage',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('message_type', models.CharField(choices=[('TEXT', 'Text Message'), ('SYSTEM', 'System Message'), ('COMMAND', 'Command Message'), ('ALERT', 'Alert Message'), ('UPDATE', 'Status Update')], default='TEXT', max_length=20)),
|
||||
('content', models.TextField()),
|
||||
('sender_name', models.CharField(help_text='Display name of sender', max_length=100)),
|
||||
('is_edited', models.BooleanField(default=False)),
|
||||
('edited_at', models.DateTimeField(blank=True, null=True)),
|
||||
('external_message_id', models.CharField(blank=True, help_text='ID in external system (Slack, Teams, etc.)', max_length=255, null=True)),
|
||||
('external_data', models.JSONField(default=dict, help_text='Additional data from external system')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('reply_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='replies', to='collaboration_war_rooms.warroommessage')),
|
||||
('sender', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='war_room_messages', to=settings.AUTH_USER_MODEL)),
|
||||
('war_room', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='collaboration_war_rooms.warroom')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['created_at'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='IncidentDecision',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('decision_type', models.CharField(choices=[('TECHNICAL', 'Technical Decision'), ('BUSINESS', 'Business Decision'), ('COMMUNICATION', 'Communication Decision'), ('ESCALATION', 'Escalation Decision'), ('RESOURCE', 'Resource Allocation'), ('TIMELINE', 'Timeline Decision')], max_length=20)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
('description', models.TextField()),
|
||||
('rationale', models.TextField(help_text='Reasoning behind the decision')),
|
||||
('status', models.CharField(choices=[('PENDING', 'Pending'), ('APPROVED', 'Approved'), ('REJECTED', 'Rejected'), ('IMPLEMENTED', 'Implemented')], default='PENDING', max_length=20)),
|
||||
('requires_approval', models.BooleanField(default=False)),
|
||||
('approved_at', models.DateTimeField(blank=True, null=True)),
|
||||
('implementation_notes', models.TextField(blank=True, null=True)),
|
||||
('implemented_at', models.DateTimeField(blank=True, null=True)),
|
||||
('impact_assessment', models.TextField(blank=True, null=True)),
|
||||
('success_metrics', models.JSONField(default=list, help_text='Metrics to measure decision success')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('approved_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='approved_decisions', to=settings.AUTH_USER_MODEL)),
|
||||
('command_role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='decisions', to='collaboration_war_rooms.incidentcommandrole')),
|
||||
('implemented_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='implemented_decisions', to=settings.AUTH_USER_MODEL)),
|
||||
('incident', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='decisions', to='incident_intelligence.incident')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-created_at'],
|
||||
'indexes': [models.Index(fields=['incident', 'status'], name='collaborati_inciden_4f34eb_idx'), models.Index(fields=['command_role', 'decision_type'], name='collaborati_command_81be71_idx'), models.Index(fields=['status', 'created_at'], name='collaborati_status_3f5734_idx')],
|
||||
},
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='warroom',
|
||||
index=models.Index(fields=['incident', 'status'], name='collaborati_inciden_bd58db_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='warroom',
|
||||
index=models.Index(fields=['status', 'privacy_level'], name='collaborati_status_649ccc_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='warroom',
|
||||
index=models.Index(fields=['created_at'], name='collaborati_created_e3a240_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='timelineevent',
|
||||
index=models.Index(fields=['incident', 'event_time'], name='collaborati_inciden_3a611f_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='timelineevent',
|
||||
index=models.Index(fields=['event_type', 'event_time'], name='collaborati_event_t_d2100a_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='timelineevent',
|
||||
index=models.Index(fields=['source_type', 'event_time'], name='collaborati_source__0c3cc4_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='timelineevent',
|
||||
index=models.Index(fields=['is_critical_event', 'event_time'], name='collaborati_is_crit_28e610_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='incidentcommandrole',
|
||||
index=models.Index(fields=['incident', 'role_type'], name='collaborati_inciden_7c5ba6_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='incidentcommandrole',
|
||||
index=models.Index(fields=['assigned_user', 'status'], name='collaborati_assigne_e33d48_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='incidentcommandrole',
|
||||
index=models.Index(fields=['status', 'assigned_at'], name='collaborati_status_b2ec4b_idx'),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='incidentcommandrole',
|
||||
unique_together={('incident', 'role_type', 'assigned_user')},
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='conferencebridge',
|
||||
index=models.Index(fields=['incident', 'status'], name='collaborati_inciden_4be2c2_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='conferencebridge',
|
||||
index=models.Index(fields=['bridge_type', 'status'], name='collaborati_bridge__44a9ea_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='conferencebridge',
|
||||
index=models.Index(fields=['scheduled_start'], name='collaborati_schedul_a93d14_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='warroommessage',
|
||||
index=models.Index(fields=['war_room', 'created_at'], name='collaborati_war_roo_6320f9_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='warroommessage',
|
||||
index=models.Index(fields=['sender', 'created_at'], name='collaborati_sender__f499b1_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='warroommessage',
|
||||
index=models.Index(fields=['message_type', 'created_at'], name='collaborati_message_a29f3d_idx'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,215 @@
|
||||
# Generated by Django 5.2.6 on 2025-09-18 18:10
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('automation_orchestration', '0002_autoremediationexecution_sla_instance_and_more'),
|
||||
('collaboration_war_rooms', '0001_initial'),
|
||||
('knowledge_learning', '0001_initial'),
|
||||
('security', '0003_adaptiveauthentication_and_more'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ChatBot',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('name', models.CharField(max_length=100)),
|
||||
('bot_type', models.CharField(choices=[('INCIDENT_ASSISTANT', 'Incident Assistant'), ('KNOWLEDGE_BOT', 'Knowledge Bot'), ('AUTOMATION_BOT', 'Automation Bot'), ('COMPLIANCE_BOT', 'Compliance Bot')], max_length=30)),
|
||||
('description', models.TextField()),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('auto_respond', models.BooleanField(default=False)),
|
||||
('response_triggers', models.JSONField(default=list, help_text='Keywords that trigger bot responses')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ChatCommand',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('command_type', models.CharField(choices=[('STATUS', 'Status Check'), ('RUNBOOK', 'Execute Runbook'), ('ESCALATE', 'Escalate Incident'), ('ASSIGN', 'Assign Incident'), ('UPDATE', 'Update Status'), ('CUSTOM', 'Custom Command')], max_length=20)),
|
||||
('command_text', models.CharField(help_text='Full command text', max_length=500)),
|
||||
('parameters', models.JSONField(default=dict, help_text='Parsed command parameters')),
|
||||
('executed_at', models.DateTimeField(blank=True, null=True)),
|
||||
('execution_status', models.CharField(choices=[('PENDING', 'Pending'), ('EXECUTING', 'Executing'), ('SUCCESS', 'Success'), ('FAILED', 'Failed'), ('CANCELLED', 'Cancelled')], default='PENDING', max_length=20)),
|
||||
('execution_result', models.JSONField(default=dict, help_text='Result of command execution')),
|
||||
('error_message', models.TextField(blank=True, null=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-executed_at'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ChatFile',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('filename', models.CharField(max_length=255)),
|
||||
('original_filename', models.CharField(max_length=255)),
|
||||
('file_type', models.CharField(choices=[('IMAGE', 'Image'), ('DOCUMENT', 'Document'), ('LOG', 'Log File'), ('SCREENSHOT', 'Screenshot'), ('EVIDENCE', 'Evidence'), ('OTHER', 'Other')], max_length=20)),
|
||||
('file_size', models.PositiveIntegerField(help_text='File size in bytes')),
|
||||
('mime_type', models.CharField(max_length=100)),
|
||||
('file_path', models.CharField(help_text='Path to stored file', max_length=500)),
|
||||
('file_url', models.URLField(blank=True, help_text='Public URL for file access', null=True)),
|
||||
('is_encrypted', models.BooleanField(default=False)),
|
||||
('encryption_key_id', models.CharField(blank=True, max_length=255, null=True)),
|
||||
('file_hash', models.CharField(help_text='SHA-256 hash of file', max_length=64)),
|
||||
('uploaded_at', models.DateTimeField(auto_now_add=True)),
|
||||
('access_log', models.JSONField(default=list, help_text='Log of who accessed this file and when')),
|
||||
],
|
||||
options={
|
||||
'ordering': ['-uploaded_at'],
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MessageReaction',
|
||||
fields=[
|
||||
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
||||
('emoji', models.CharField(help_text='Emoji reaction', max_length=10)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['created_at'],
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='attachments',
|
||||
field=models.JSONField(default=list, help_text='List of file attachments with metadata'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='encryption_key_id',
|
||||
field=models.CharField(blank=True, max_length=255, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='is_encrypted',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='is_pinned',
|
||||
field=models.BooleanField(default=False, help_text='Whether this message is pinned'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='mentioned_users',
|
||||
field=models.ManyToManyField(blank=True, help_text='Users mentioned in this message', related_name='mentioned_in_messages', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='notification_sent',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='pinned_at',
|
||||
field=models.DateTimeField(blank=True, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='warroommessage',
|
||||
name='pinned_by',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pinned_messages', to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='warroommessage',
|
||||
name='message_type',
|
||||
field=models.CharField(choices=[('TEXT', 'Text Message'), ('SYSTEM', 'System Message'), ('COMMAND', 'Command Message'), ('ALERT', 'Alert Message'), ('UPDATE', 'Status Update'), ('FILE', 'File Attachment'), ('BOT', 'Bot Message')], default='TEXT', max_length=20),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='warroommessage',
|
||||
index=models.Index(fields=['is_pinned', 'created_at'], name='collaborati_is_pinn_7a25dc_idx'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='chatbot',
|
||||
name='knowledge_base',
|
||||
field=models.ForeignKey(blank=True, help_text='Knowledge base article for bot responses', null=True, on_delete=django.db.models.deletion.SET_NULL, to='knowledge_learning.knowledgebasearticle'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='chatcommand',
|
||||
name='automation_execution',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='chat_commands', to='automation_orchestration.runbookexecution'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='chatcommand',
|
||||
name='executed_by',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='chatcommand',
|
||||
name='message',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chat_commands', to='collaboration_war_rooms.warroommessage'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='chatfile',
|
||||
name='data_classification',
|
||||
field=models.ForeignKey(blank=True, help_text='Data classification level for this file', null=True, on_delete=django.db.models.deletion.SET_NULL, to='security.dataclassification'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='chatfile',
|
||||
name='message',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chat_files', to='collaboration_war_rooms.warroommessage'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='chatfile',
|
||||
name='uploaded_by',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='messagereaction',
|
||||
name='message',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reactions', to='collaboration_war_rooms.warroommessage'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='messagereaction',
|
||||
name='user',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='chatbot',
|
||||
index=models.Index(fields=['bot_type', 'is_active'], name='collaborati_bot_typ_6fc3ba_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='chatcommand',
|
||||
index=models.Index(fields=['command_type', 'execution_status'], name='collaborati_command_915116_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='chatcommand',
|
||||
index=models.Index(fields=['executed_by', 'executed_at'], name='collaborati_execute_d1badb_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='chatfile',
|
||||
index=models.Index(fields=['message', 'file_type'], name='collaborati_message_358b62_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='chatfile',
|
||||
index=models.Index(fields=['data_classification'], name='collaborati_data_cl_e26657_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='chatfile',
|
||||
index=models.Index(fields=['uploaded_at'], name='collaborati_uploade_a6b9bd_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='messagereaction',
|
||||
index=models.Index(fields=['message', 'emoji'], name='collaborati_message_817163_idx'),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='messagereaction',
|
||||
index=models.Index(fields=['user', 'created_at'], name='collaborati_user_id_2d3a22_idx'),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name='messagereaction',
|
||||
unique_together={('message', 'user', 'emoji')},
|
||||
),
|
||||
]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user