text: # Generated by Django 3.2.9 on 2021-12-15 08:01
  
  from django.conf import settings
  from django.db import migrations, models
  import django.db.models.deletion
  import uuid
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('agents', '0001_initial'),
          ('projects', '0002_auto_20211215_0801'),
          migrations.swappable_dependency(settings.AUTH_USER_MODEL),
      ]
  
      operations = [
          migrations.CreateModel(
              name='CommandHistoryItem',
              fields=[
                  ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                  ('date_created', models.DateTimeField(auto_now_add=True)),
                  ('date_updated', models.DateTimeField(auto_now=True)),
                  ('command', models.TextField()),
                  ('exit_code', models.IntegerField(blank=True, null=True)),
                  ('output', models.TextField(blank=True, null=True)),
                  ('agent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='agents.agent')),
                  ('command_created', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='commands.commandhistoryitem')),
                  ('creator', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                  ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.project')),
              ],
              options={
                  'abstract': False,
              },
          ),
          migrations.CreateModel(
              name='CommandTemplate',
              fields=[
                  ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                  ('date_created', models.DateTimeField(auto_now_add=True)),
                  ('date_updated', models.DateTimeField(auto_now=True)),
                  ('name', models.CharField(max_length=64)),
                  ('tool_name', models.CharField(max_length=128)),
                  ('description', models.CharField(blank=True, max_length=256, null=True)),
                  ('command', models.TextField(help_text='The following placeholders are available: %target_ip%,%target_domain%,%target_port%,%target_scheme%')),
                  ('creator', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'verbose_name': 'Command Template',
                  'verbose_name_plural': 'Command Templates',
                  'ordering': ['-date_updated'],
                  'unique_together': {('name', 'tool_name')},
              },
          ),
      ]
  