mirror of https://github.com/jumpserver/jumpserver
perf: squash migrations
parent
e4c7eb8035
commit
0541c0a9d4
|
@ -1,244 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-01 10:24
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("assets", "0007_baseautomation_start_time"),
|
||||
("accounts", "0004_alter_changesecretrecord_account_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="AccountCheckAutomation",
|
||||
fields=[
|
||||
(
|
||||
"baseautomation_ptr",
|
||||
models.OneToOneField(
|
||||
auto_created=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
parent_link=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
to="assets.baseautomation",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Gather account automation",
|
||||
},
|
||||
bases=("accounts.accountbaseautomation",),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="change_secret_status",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
max_length=16,
|
||||
null=True,
|
||||
verbose_name="Change secret status",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="date_change_secret",
|
||||
field=models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Date change secret"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="date_last_login",
|
||||
field=models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Date last access"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="login_by",
|
||||
field=models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Access by"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="secret_reset",
|
||||
field=models.BooleanField(default=True, verbose_name="Secret reset"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountbackupautomation",
|
||||
name="start_time",
|
||||
field=models.DateTimeField(
|
||||
blank=True,
|
||||
help_text="Datetime when the schedule should begin triggering the task to run",
|
||||
null=True,
|
||||
verbose_name="Start Datetime",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="authorized_keys",
|
||||
field=models.TextField(
|
||||
blank=True, default="", verbose_name="Authorized keys"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="groups",
|
||||
field=models.TextField(blank=True, default="", verbose_name="Groups"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="remote_present",
|
||||
field=models.BooleanField(default=True, verbose_name="Remote present"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="status",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[("confirmed", "Confirmed"), ("ignored", "Ignored"), ("pending", "Pending")],
|
||||
default="",
|
||||
max_length=32,
|
||||
verbose_name="Status",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="sudoers",
|
||||
field=models.TextField(blank=True, default="", verbose_name="Sudoers"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="account",
|
||||
name="connectivity",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("-", "Unknown"),
|
||||
("na", "N/A"),
|
||||
("ok", "OK"),
|
||||
("err", "Error"),
|
||||
],
|
||||
default="-",
|
||||
max_length=16,
|
||||
verbose_name="Connectivity",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="gatheredaccount",
|
||||
name="present",
|
||||
field=models.BooleanField(default=False, verbose_name="Present"),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="GatheredAccountDiff",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("diff", models.TextField(default="", verbose_name="Diff")),
|
||||
(
|
||||
"item",
|
||||
models.CharField(default="", max_length=32, verbose_name="Item"),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"account",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="accounts.gatheredaccount",
|
||||
verbose_name="Gathered account",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="AccountRisk",
|
||||
fields=[
|
||||
(
|
||||
"created_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Created by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"updated_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Updated by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, null=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_updated",
|
||||
models.DateTimeField(auto_now=True, verbose_name="Date updated"),
|
||||
),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
(
|
||||
"org_id",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
db_index=True,
|
||||
default="",
|
||||
max_length=36,
|
||||
verbose_name="Organization",
|
||||
),
|
||||
),
|
||||
(
|
||||
"risk",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("zombie", "Zombie"),
|
||||
("ghost", "Ghost"),
|
||||
("weak_password", "Weak password"),
|
||||
("long_time_no_change", "Long time no change"),
|
||||
],
|
||||
max_length=128,
|
||||
verbose_name="Risk",
|
||||
),
|
||||
),
|
||||
(
|
||||
"confirmed",
|
||||
models.BooleanField(default=False, verbose_name="Confirmed"),
|
||||
),
|
||||
(
|
||||
"account",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="risks",
|
||||
to="accounts.account",
|
||||
verbose_name="Account",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Account risk",
|
||||
},
|
||||
),
|
||||
]
|
|
@ -0,0 +1,753 @@
|
|||
# Generated by Django 4.1.13 on 2025-02-24 03:45
|
||||
|
||||
import uuid
|
||||
from datetime import timedelta as dt_timedelta
|
||||
|
||||
import django.db.models.deletion
|
||||
import private_storage.fields
|
||||
import private_storage.storage.files
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
import common.db.fields
|
||||
import common.db.utils
|
||||
|
||||
|
||||
def migrate_account_backup(apps, schema_editor):
|
||||
old_backup_model = apps.get_model('accounts', 'AccountBackupAutomation')
|
||||
account_backup_model = apps.get_model('accounts', 'BackupAccountAutomation')
|
||||
backup_id_old_new_map = {}
|
||||
for backup in old_backup_model.objects.all():
|
||||
data = {
|
||||
'comment': backup.comment,
|
||||
'created_by': backup.created_by,
|
||||
'updated_by': backup.updated_by,
|
||||
'date_created': backup.date_created,
|
||||
'date_updated': backup.date_updated,
|
||||
'name': backup.name,
|
||||
'interval': backup.interval,
|
||||
'crontab': backup.crontab,
|
||||
'is_periodic': backup.is_periodic,
|
||||
'start_time': backup.start_time,
|
||||
'date_last_run': backup.date_last_run,
|
||||
'org_id': backup.org_id,
|
||||
'type': 'backup_account',
|
||||
'types': backup.types,
|
||||
'backup_type': backup.backup_type,
|
||||
'is_password_divided_by_email': backup.is_password_divided_by_email,
|
||||
'is_password_divided_by_obj_storage': backup.is_password_divided_by_obj_storage,
|
||||
'zip_encrypt_password': backup.zip_encrypt_password
|
||||
}
|
||||
obj = account_backup_model.objects.create(**data)
|
||||
backup_id_old_new_map[str(backup.id)] = str(obj.id)
|
||||
obj.recipients_part_one.set(backup.recipients_part_one.all())
|
||||
obj.recipients_part_two.set(backup.recipients_part_two.all())
|
||||
obj.obj_recipients_part_one.set(backup.obj_recipients_part_one.all())
|
||||
obj.obj_recipients_part_two.set(backup.obj_recipients_part_two.all())
|
||||
|
||||
old_execution_model = apps.get_model('accounts', 'AccountBackupExecution')
|
||||
backup_execution_model = apps.get_model('accounts', 'AutomationExecution')
|
||||
|
||||
for execution in old_execution_model.objects.all():
|
||||
automation_id = backup_id_old_new_map.get(str(execution.plan_id))
|
||||
if not automation_id:
|
||||
continue
|
||||
data = {
|
||||
'automation_id': automation_id,
|
||||
'date_start': execution.date_start,
|
||||
'duration': int(execution.timedelta),
|
||||
'date_finished': execution.date_start + dt_timedelta(seconds=int(execution.timedelta)),
|
||||
'snapshot': execution.snapshot,
|
||||
'trigger': execution.trigger,
|
||||
'status': 'error' if execution.reason == '-' else 'success',
|
||||
'org_id': execution.org_id
|
||||
}
|
||||
backup_execution_model.objects.create(**data)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
("assets", "0012_auto_20241204_1516"),
|
||||
("terminal", "0005_endpoint_vnc_port"),
|
||||
("accounts", "0004_alter_changesecretrecord_account_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="AccountRisk",
|
||||
fields=[
|
||||
(
|
||||
"created_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Created by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"updated_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Updated by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, null=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_updated",
|
||||
models.DateTimeField(auto_now=True, verbose_name="Date updated"),
|
||||
),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
(
|
||||
"org_id",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
db_index=True,
|
||||
default="",
|
||||
max_length=36,
|
||||
verbose_name="Organization",
|
||||
),
|
||||
),
|
||||
("username", models.CharField(max_length=32, verbose_name="Username")),
|
||||
(
|
||||
"risk",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("long_time_no_login", "Long time no login"),
|
||||
("new_found", "New found"),
|
||||
("groups_changed", "Groups change"),
|
||||
("sudoers_changed", "Sudo changed"),
|
||||
("authorized_keys_changed", "Authorized keys changed"),
|
||||
("account_deleted", "Account delete"),
|
||||
("password_expired", "Password expired"),
|
||||
("long_time_password", "Long time no change"),
|
||||
("weak_password", "Weak password"),
|
||||
("leaked_password", "Leaked password"),
|
||||
("repeated_password", "Repeated password"),
|
||||
("password_error", "Password error"),
|
||||
("no_admin_account", "No admin account"),
|
||||
("others", "Others"),
|
||||
],
|
||||
max_length=128,
|
||||
verbose_name="Risk",
|
||||
),
|
||||
),
|
||||
(
|
||||
"status",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("0", "Pending"),
|
||||
("1", "Confirmed"),
|
||||
("2", "Ignored"),
|
||||
],
|
||||
default="0",
|
||||
max_length=32,
|
||||
verbose_name="Status",
|
||||
),
|
||||
),
|
||||
("details", models.JSONField(default=list, verbose_name="Details")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Account risk",
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="BackupAccountAutomation",
|
||||
fields=[
|
||||
(
|
||||
"baseautomation_ptr",
|
||||
models.OneToOneField(
|
||||
auto_created=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
parent_link=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
to="assets.baseautomation",
|
||||
),
|
||||
),
|
||||
("types", models.JSONField(default=list)),
|
||||
(
|
||||
"backup_type",
|
||||
models.CharField(
|
||||
choices=[("email", "Email"), ("object_storage", "SFTP")],
|
||||
default="email",
|
||||
max_length=128,
|
||||
verbose_name="Backup type",
|
||||
),
|
||||
),
|
||||
(
|
||||
"is_password_divided_by_email",
|
||||
models.BooleanField(default=True, verbose_name="Password divided"),
|
||||
),
|
||||
(
|
||||
"is_password_divided_by_obj_storage",
|
||||
models.BooleanField(default=True, verbose_name="Password divided"),
|
||||
),
|
||||
(
|
||||
"zip_encrypt_password",
|
||||
common.db.fields.EncryptCharField(
|
||||
blank=True,
|
||||
max_length=4096,
|
||||
null=True,
|
||||
verbose_name="Zip encrypt password",
|
||||
),
|
||||
),
|
||||
(
|
||||
"obj_recipients_part_one",
|
||||
models.ManyToManyField(
|
||||
blank=True,
|
||||
related_name="obj_recipient_part_one_plans",
|
||||
to="terminal.replaystorage",
|
||||
verbose_name="Object storage recipient part one",
|
||||
),
|
||||
),
|
||||
(
|
||||
"obj_recipients_part_two",
|
||||
models.ManyToManyField(
|
||||
blank=True,
|
||||
related_name="obj_recipient_part_two_plans",
|
||||
to="terminal.replaystorage",
|
||||
verbose_name="Object storage recipient part two",
|
||||
),
|
||||
),
|
||||
(
|
||||
"recipients_part_one",
|
||||
models.ManyToManyField(
|
||||
blank=True,
|
||||
related_name="recipient_part_one_plans",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="Recipient part one",
|
||||
),
|
||||
),
|
||||
(
|
||||
"recipients_part_two",
|
||||
models.ManyToManyField(
|
||||
blank=True,
|
||||
related_name="recipient_part_two_plans",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="Recipient part two",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Account backup plan",
|
||||
},
|
||||
bases=("accounts.accountbaseautomation",),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="CheckAccountAutomation",
|
||||
fields=[
|
||||
(
|
||||
"baseautomation_ptr",
|
||||
models.OneToOneField(
|
||||
auto_created=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
parent_link=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
to="assets.baseautomation",
|
||||
),
|
||||
),
|
||||
("engines", models.JSONField(default=list, verbose_name="Engines")),
|
||||
(
|
||||
"recipients",
|
||||
models.ManyToManyField(
|
||||
blank=True,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name="Recipient",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "account check automation",
|
||||
"permissions": [
|
||||
("view_checkaccountexecution", "Can view check account execution"),
|
||||
("add_checkaccountexecution", "Can add check account execution"),
|
||||
],
|
||||
},
|
||||
bases=("accounts.accountbaseautomation",),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="CheckAccountEngine",
|
||||
fields=[
|
||||
(
|
||||
"created_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Created by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"updated_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Updated by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, null=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_updated",
|
||||
models.DateTimeField(auto_now=True, verbose_name="Date updated"),
|
||||
),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(max_length=128, unique=True, verbose_name="Name"),
|
||||
),
|
||||
(
|
||||
"slug",
|
||||
models.SlugField(max_length=128, unique=True, verbose_name="Slug"),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="IntegrationApplication",
|
||||
fields=[
|
||||
(
|
||||
"created_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Created by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"updated_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Updated by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, null=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_updated",
|
||||
models.DateTimeField(auto_now=True, verbose_name="Date updated"),
|
||||
),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
(
|
||||
"org_id",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
db_index=True,
|
||||
default="",
|
||||
max_length=36,
|
||||
verbose_name="Organization",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=128, verbose_name="Name")),
|
||||
(
|
||||
"logo",
|
||||
private_storage.fields.PrivateImageField(
|
||||
max_length=128,
|
||||
storage=private_storage.storage.files.PrivateFileSystemStorage(),
|
||||
upload_to="images",
|
||||
verbose_name="Logo",
|
||||
),
|
||||
),
|
||||
(
|
||||
"secret",
|
||||
common.db.fields.EncryptTextField(
|
||||
default="", verbose_name="Secret"
|
||||
),
|
||||
),
|
||||
(
|
||||
"accounts",
|
||||
common.db.fields.JSONManyToManyField(
|
||||
default=dict, to="accounts.Account", verbose_name="Accounts"
|
||||
),
|
||||
),
|
||||
(
|
||||
"ip_group",
|
||||
models.JSONField(
|
||||
default=common.db.utils.default_ip_group,
|
||||
verbose_name="IP group",
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_last_used",
|
||||
models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Date last used"
|
||||
),
|
||||
),
|
||||
("is_active", models.BooleanField(default=True, verbose_name="Active")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Integration App",
|
||||
"unique_together": {("name", "org_id")},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="PushSecretRecord",
|
||||
fields=[
|
||||
(
|
||||
"created_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Created by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"updated_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Updated by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, null=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_updated",
|
||||
models.DateTimeField(auto_now=True, verbose_name="Date updated"),
|
||||
),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_finished",
|
||||
models.DateTimeField(
|
||||
blank=True,
|
||||
db_index=True,
|
||||
null=True,
|
||||
verbose_name="Date finished",
|
||||
),
|
||||
),
|
||||
(
|
||||
"status",
|
||||
models.CharField(
|
||||
default="pending", max_length=16, verbose_name="Status"
|
||||
),
|
||||
),
|
||||
(
|
||||
"error",
|
||||
models.TextField(blank=True, null=True, verbose_name="Error"),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Push secret record",
|
||||
},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="accountbackupexecution",
|
||||
name="plan",
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="automationexecution",
|
||||
options={
|
||||
"permissions": [
|
||||
("view_changesecretexecution", "Can view change secret execution"),
|
||||
("add_changesecretexecution", "Can add change secret execution"),
|
||||
(
|
||||
"view_gatheraccountsexecution",
|
||||
"Can view gather accounts execution",
|
||||
),
|
||||
(
|
||||
"add_gatheraccountsexecution",
|
||||
"Can add gather accounts execution",
|
||||
),
|
||||
("view_pushaccountexecution", "Can view push account execution"),
|
||||
("add_pushaccountexecution", "Can add push account execution"),
|
||||
(
|
||||
"view_backupaccountexecution",
|
||||
"Can view backup account execution",
|
||||
),
|
||||
("add_backupaccountexecution", "Can add backup account execution"),
|
||||
],
|
||||
"verbose_name": "Automation execution",
|
||||
"verbose_name_plural": "Automation executions",
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="changesecretrecord",
|
||||
options={"verbose_name": "Change secret record"},
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="changesecretrecord",
|
||||
name="date_started",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="pushaccountautomation",
|
||||
name="action",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="pushaccountautomation",
|
||||
name="triggers",
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name="pushaccountautomation",
|
||||
name="username",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="change_secret_status",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
max_length=16,
|
||||
null=True,
|
||||
verbose_name="Change secret status",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="date_change_secret",
|
||||
field=models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Date change secret"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="date_last_login",
|
||||
field=models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Date last access"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="login_by",
|
||||
field=models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Access by"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="account",
|
||||
name="secret_reset",
|
||||
field=models.BooleanField(default=True, verbose_name="Secret reset"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="changesecretautomation",
|
||||
name="check_conn_after_change",
|
||||
field=models.BooleanField(
|
||||
default=True, verbose_name="Check connection after change"
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="changesecretrecord",
|
||||
name="ignore_fail",
|
||||
field=models.BooleanField(default=False, verbose_name="Ignore fail"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheraccountsautomation",
|
||||
name="check_risk",
|
||||
field=models.BooleanField(default=True, verbose_name="Check risk"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="date_password_change",
|
||||
field=models.DateTimeField(null=True, verbose_name="Date change password"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="date_password_expired",
|
||||
field=models.DateTimeField(null=True, verbose_name="Date password expired"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="detail",
|
||||
field=models.JSONField(blank=True, default=dict, verbose_name="Detail"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="remote_present",
|
||||
field=models.BooleanField(default=True, verbose_name="Remote present"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="status",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[("0", "Pending"), ("1", "Confirmed"), ("2", "Ignored")],
|
||||
default="0",
|
||||
max_length=32,
|
||||
verbose_name="Status",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="pushaccountautomation",
|
||||
name="check_conn_after_change",
|
||||
field=models.BooleanField(
|
||||
default=True, verbose_name="Check connection after change"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="account",
|
||||
name="connectivity",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("-", "Unknown"),
|
||||
("na", "N/A"),
|
||||
("ok", "OK"),
|
||||
("err", "Error"),
|
||||
],
|
||||
default="-",
|
||||
max_length=16,
|
||||
verbose_name="Connectivity",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="changesecretrecord",
|
||||
name="account",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="%(class)ss",
|
||||
to="accounts.account",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="changesecretrecord",
|
||||
name="asset",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="asset_%(class)ss",
|
||||
to="assets.asset",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="changesecretrecord",
|
||||
name="date_finished",
|
||||
field=models.DateTimeField(
|
||||
blank=True, db_index=True, null=True, verbose_name="Date finished"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="changesecretrecord",
|
||||
name="execution",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="execution_%(class)ss",
|
||||
to="accounts.automationexecution",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="gatheredaccount",
|
||||
name="address_last_login",
|
||||
field=models.CharField(
|
||||
default="", max_length=39, null=True, verbose_name="Address login"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="gatheredaccount",
|
||||
name="present",
|
||||
field=models.BooleanField(default=False, verbose_name="Present"),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="AccountBackupAutomation",
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="AccountBackupExecution",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="pushsecretrecord",
|
||||
name="account",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="%(class)ss",
|
||||
to="accounts.account",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="pushsecretrecord",
|
||||
name="asset",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="asset_%(class)ss",
|
||||
to="assets.asset",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="pushsecretrecord",
|
||||
name="execution",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="execution_%(class)ss",
|
||||
to="accounts.automationexecution",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="account",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="risks",
|
||||
to="accounts.account",
|
||||
verbose_name="Account",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="asset",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="risks",
|
||||
to="assets.asset",
|
||||
verbose_name="Asset",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="gathered_account",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="risks",
|
||||
to="accounts.gatheredaccount",
|
||||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name="accountrisk",
|
||||
unique_together={("asset", "username", "risk")},
|
||||
),
|
||||
migrations.RunPython(migrate_account_backup),
|
||||
]
|
|
@ -1,58 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-04 06:37
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("assets", "0007_baseautomation_start_time"),
|
||||
("accounts", "0005_account_secret_reset"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="accountrisk",
|
||||
name="account",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="asset",
|
||||
field=models.ForeignKey(
|
||||
default=None,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="risks",
|
||||
to="assets.asset",
|
||||
verbose_name="Asset",
|
||||
),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="username",
|
||||
field=models.CharField(default="", max_length=32, verbose_name="Username"),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="risk",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("zombie", "Long time no login"),
|
||||
("ghost", "Not managed"),
|
||||
("long_time_no_change", "Long time no change"),
|
||||
("weak_password", "Weak password"),
|
||||
("login_bypass", "Login bypass"),
|
||||
("group_change", "Group change"),
|
||||
("account_delete", "Account delete"),
|
||||
("password_expired", "Password expired"),
|
||||
("no_admin_account", "No admin account"),
|
||||
("password_error", "Password error"),
|
||||
("other", "Other"),
|
||||
],
|
||||
max_length=128,
|
||||
verbose_name="Risk",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,34 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-04 06:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0006_remove_accountrisk_account_accountrisk_asset_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="risk",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
('zombie', 'Long time no login'),
|
||||
('ghost', 'Not managed'),
|
||||
('long_time_password', 'Long time no change'),
|
||||
('weak_password', 'Weak password'),
|
||||
('password_error', 'Password error'),
|
||||
('password_expired', 'Password expired'),
|
||||
('group_changed', 'Group change'),
|
||||
('sudo_changed', 'Sudo changed'),
|
||||
('account_deleted', 'Account delete'),
|
||||
('no_admin_account', 'No admin account'),
|
||||
('others', 'Others')
|
||||
],
|
||||
max_length=128,
|
||||
verbose_name="Risk",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,60 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-06 08:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0007_alter_accountrisk_risk"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name="accountrisk",
|
||||
name="confirmed",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="status",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[("confirmed", "Confirmed"), ("ignored", "Ignored"), ("pending", "Pending")],
|
||||
default="",
|
||||
max_length=32,
|
||||
verbose_name="Status",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="risk",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("zombie", "Long time no login"),
|
||||
("ghost", "Not managed"),
|
||||
("long_time_password", "Long time no change"),
|
||||
("weak_password", "Weak password"),
|
||||
("password_error", "Password error"),
|
||||
("password_expired", "Password expired"),
|
||||
("group_changed", "Group change"),
|
||||
("sudo_changed", "Sudo changed"),
|
||||
("authorized_keys_changed", "Authorized keys changed"),
|
||||
("account_deleted", "Account delete"),
|
||||
("no_admin_account", "No admin account"),
|
||||
("others", "Others"),
|
||||
],
|
||||
max_length=128,
|
||||
verbose_name="Risk",
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='changesecretautomation',
|
||||
name='check_conn_after_change',
|
||||
field=models.BooleanField(default=True, verbose_name='Check connection after change'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='pushaccountautomation',
|
||||
name='check_conn_after_change',
|
||||
field=models.BooleanField(default=True, verbose_name='Check connection after change'),
|
||||
),
|
||||
]
|
|
@ -1,58 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-08 09:04
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("assets", "0007_baseautomation_start_time"),
|
||||
("accounts", "0008_remove_accountrisk_confirmed_accountrisk_status_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="date_change_password",
|
||||
field=models.DateTimeField(null=True, verbose_name="Date change password"),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="gatheredaccount",
|
||||
name="date_password_expired",
|
||||
field=models.DateTimeField(null=True, verbose_name="Date password expired"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="comment",
|
||||
field=models.TextField(default="", verbose_name="Comment"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="risk",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("zombie", "Long time no login"),
|
||||
("ghost", "Not managed"),
|
||||
("groups_changed", "Groups change"),
|
||||
("sudoers_changed", "Sudo changed"),
|
||||
("authorized_keys_changed", "Authorized keys changed"),
|
||||
("account_deleted", "Account delete"),
|
||||
("password_expired", "Password expired"),
|
||||
("long_time_password", "Long time no change"),
|
||||
("weak_password", "Weak password"),
|
||||
("password_error", "Password error"),
|
||||
("no_admin_account", "No admin account"),
|
||||
("others", "Others"),
|
||||
],
|
||||
max_length=128,
|
||||
verbose_name="Risk",
|
||||
),
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name="accountrisk",
|
||||
unique_together={("asset", "username", "risk")},
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="GatheredAccountDiff",
|
||||
),
|
||||
]
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-11 05:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0009_alter_accountrisk_comment"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="details",
|
||||
field=models.JSONField(default=list, verbose_name="Details"),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="comment",
|
||||
field=models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-12 06:35
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0010_accountrisk_details_alter_accountrisk_comment"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name="gatheredaccount",
|
||||
old_name="date_change_password",
|
||||
new_name="date_password_change",
|
||||
),
|
||||
]
|
|
@ -1,121 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-14 11:00
|
||||
|
||||
import uuid
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("assets", "0008_baseautomation_date_last_run_and_more"),
|
||||
(
|
||||
"accounts",
|
||||
"0011_rename_date_change_password_gatheredaccount_date_password_change",
|
||||
),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="CheckAccountAutomation",
|
||||
fields=[
|
||||
(
|
||||
"baseautomation_ptr",
|
||||
models.OneToOneField(
|
||||
auto_created=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
parent_link=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
to="assets.baseautomation",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "account check automation",
|
||||
"permissions": [
|
||||
("view_checkaccountexecution", "Can view check account execution"),
|
||||
("add_checkaccountexecution", "Can add check account execution"),
|
||||
],
|
||||
},
|
||||
bases=("accounts.accountbaseautomation",),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="CheckAccountEngine",
|
||||
fields=[
|
||||
(
|
||||
"created_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Created by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"updated_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Updated by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, null=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_updated",
|
||||
models.DateTimeField(auto_now=True, verbose_name="Date updated"),
|
||||
),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
(
|
||||
"name",
|
||||
models.CharField(max_length=128, unique=True, verbose_name="Name"),
|
||||
),
|
||||
(
|
||||
"slug",
|
||||
models.SlugField(max_length=128, unique=True, verbose_name="Slug"),
|
||||
),
|
||||
(
|
||||
"is_active",
|
||||
models.BooleanField(default=True, verbose_name="Is active"),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="accountbackupautomation",
|
||||
name="date_last_run",
|
||||
field=models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Date last run"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="accountbackupautomation",
|
||||
name="crontab",
|
||||
field=models.CharField(
|
||||
blank=True, default="", max_length=128, verbose_name="Crontab"
|
||||
),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="AccountCheckAutomation",
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="checkaccountautomation",
|
||||
name="engines",
|
||||
field=models.ManyToManyField(
|
||||
related_name="check_automations",
|
||||
to="accounts.checkaccountengine",
|
||||
verbose_name="Engines",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,22 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-15 03:00
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
("accounts", "0012_accountcheckengine_accountcheckautomation_engines"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="checkaccountautomation",
|
||||
name="recipients",
|
||||
field=models.ManyToManyField(
|
||||
blank=True, to=settings.AUTH_USER_MODEL, verbose_name="Recipient"
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-18 03:32
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0013_checkaccountautomation_recipients"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="gatheraccountsautomation",
|
||||
name="check_risk",
|
||||
field=models.BooleanField(default=True, verbose_name="Check risk"),
|
||||
),
|
||||
]
|
|
@ -1,35 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-26 08:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0014_gatheraccountsautomation_check_risk"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="risk",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("long_time_no_login", "Long time no login"),
|
||||
("new_found", "New found"),
|
||||
("groups_changed", "Groups change"),
|
||||
("sudoers_changed", "Sudo changed"),
|
||||
("authorized_keys_changed", "Authorized keys changed"),
|
||||
("account_deleted", "Account delete"),
|
||||
("password_expired", "Password expired"),
|
||||
("long_time_password", "Long time no change"),
|
||||
("weak_password", "Weak password"),
|
||||
("password_error", "Password error"),
|
||||
("no_admin_account", "No admin account"),
|
||||
("others", "Others"),
|
||||
],
|
||||
max_length=128,
|
||||
verbose_name="Risk",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,35 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-27 11:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0015_alter_accountrisk_risk"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="accountrisk",
|
||||
name="status",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[("0", "Pending"), ("1", "Confirmed"), ("2", "Ignored")],
|
||||
default="0",
|
||||
max_length=32,
|
||||
verbose_name="Status",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="gatheredaccount",
|
||||
name="status",
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[("0", "Pending"), ("1", "Confirmed"), ("2", "Ignored")],
|
||||
default="0",
|
||||
max_length=32,
|
||||
verbose_name="Status",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,41 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-11-29 14:41
|
||||
|
||||
import common.db.fields
|
||||
import common.db.utils
|
||||
from django.db import migrations, models
|
||||
import private_storage.fields
|
||||
import private_storage.storage.files
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0016_alter_accountrisk_status_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ServiceIntegration',
|
||||
fields=[
|
||||
('created_by', models.CharField(blank=True, max_length=128, null=True, verbose_name='Created by')),
|
||||
('updated_by', models.CharField(blank=True, max_length=128, null=True, verbose_name='Updated by')),
|
||||
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')),
|
||||
('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
|
||||
('comment', models.TextField(blank=True, default='', verbose_name='Comment')),
|
||||
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
|
||||
('org_id', models.CharField(blank=True, db_index=True, default='', max_length=36, verbose_name='Organization')),
|
||||
('name', models.CharField(max_length=128, verbose_name='Name')),
|
||||
('logo_image', private_storage.fields.PrivateImageField(max_length=128, storage=private_storage.storage.files.PrivateFileSystemStorage(), upload_to='service-integration', verbose_name='Logo')),
|
||||
('secret', common.db.fields.EncryptTextField(default='', verbose_name='Secret')),
|
||||
('accounts', common.db.fields.JSONManyToManyField(default=dict, to='accounts.Account', verbose_name='Accounts')),
|
||||
('ip_group', models.JSONField(default=common.db.utils.default_ip_group, verbose_name='IP group')),
|
||||
('date_last_used', models.DateTimeField(blank=True, null=True, verbose_name='Date last used')),
|
||||
('is_active', models.BooleanField(default=True, verbose_name='Active')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Application integration',
|
||||
'unique_together': {('name', 'org_id')},
|
||||
},
|
||||
),
|
||||
]
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-12-02 03:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0017_serviceintegration'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='changesecretrecord',
|
||||
name='ignore_fail',
|
||||
field=models.BooleanField(default=False, verbose_name='Ignore fail'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='changesecretrecord',
|
||||
name='date_finished',
|
||||
field=models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Date finished'),
|
||||
),
|
||||
]
|
|
@ -1,133 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-12-03 09:23
|
||||
from datetime import timedelta as dt_timedelta
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
import common.db.fields
|
||||
|
||||
|
||||
def migrate_account_backup(apps, schema_editor):
|
||||
old_backup_model = apps.get_model('accounts', 'AccountBackupAutomation')
|
||||
account_backup_model = apps.get_model('accounts', 'BackupAccountAutomation')
|
||||
backup_id_old_new_map = {}
|
||||
for backup in old_backup_model.objects.all():
|
||||
data = {
|
||||
'comment': backup.comment,
|
||||
'created_by': backup.created_by,
|
||||
'updated_by': backup.updated_by,
|
||||
'date_created': backup.date_created,
|
||||
'date_updated': backup.date_updated,
|
||||
'name': backup.name,
|
||||
'interval': backup.interval,
|
||||
'crontab': backup.crontab,
|
||||
'is_periodic': backup.is_periodic,
|
||||
'start_time': backup.start_time,
|
||||
'date_last_run': backup.date_last_run,
|
||||
'org_id': backup.org_id,
|
||||
'type': 'backup_account',
|
||||
'types': backup.types,
|
||||
'backup_type': backup.backup_type,
|
||||
'is_password_divided_by_email': backup.is_password_divided_by_email,
|
||||
'is_password_divided_by_obj_storage': backup.is_password_divided_by_obj_storage,
|
||||
'zip_encrypt_password': backup.zip_encrypt_password
|
||||
}
|
||||
obj = account_backup_model.objects.create(**data)
|
||||
backup_id_old_new_map[str(backup.id)] = str(obj.id)
|
||||
obj.recipients_part_one.set(backup.recipients_part_one.all())
|
||||
obj.recipients_part_two.set(backup.recipients_part_two.all())
|
||||
obj.obj_recipients_part_one.set(backup.obj_recipients_part_one.all())
|
||||
obj.obj_recipients_part_two.set(backup.obj_recipients_part_two.all())
|
||||
|
||||
old_execution_model = apps.get_model('accounts', 'AccountBackupExecution')
|
||||
backup_execution_model = apps.get_model('accounts', 'AutomationExecution')
|
||||
|
||||
for execution in old_execution_model.objects.all():
|
||||
automation_id = backup_id_old_new_map.get(str(execution.plan_id))
|
||||
if not automation_id:
|
||||
continue
|
||||
data = {
|
||||
'automation_id': automation_id,
|
||||
'date_start': execution.date_start,
|
||||
'duration': int(execution.timedelta),
|
||||
'date_finished': execution.date_start + dt_timedelta(seconds=int(execution.timedelta)),
|
||||
'snapshot': execution.snapshot,
|
||||
'trigger': execution.trigger,
|
||||
'status': 'error' if execution.reason == '-' else 'success',
|
||||
'org_id': execution.org_id
|
||||
}
|
||||
backup_execution_model.objects.create(**data)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('assets', '0011_alter_automationexecution_duration'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
('terminal', '0003_auto_20171230_0308'),
|
||||
('accounts', '0018_changesecretrecord_ignore_fail_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='BackupAccountAutomation',
|
||||
fields=[
|
||||
('baseautomation_ptr',
|
||||
models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True,
|
||||
primary_key=True, serialize=False, to='assets.baseautomation')),
|
||||
('types', models.JSONField(default=list)),
|
||||
('backup_type',
|
||||
models.CharField(choices=[('email', 'Email'), ('object_storage', 'SFTP')], default='email',
|
||||
max_length=128, verbose_name='Backup type')),
|
||||
('is_password_divided_by_email', models.BooleanField(default=True, verbose_name='Password divided')),
|
||||
('is_password_divided_by_obj_storage',
|
||||
models.BooleanField(default=True, verbose_name='Password divided')),
|
||||
('zip_encrypt_password', common.db.fields.EncryptCharField(blank=True, max_length=4096, null=True,
|
||||
verbose_name='Zip encrypt password')),
|
||||
('obj_recipients_part_one',
|
||||
models.ManyToManyField(blank=True, related_name='obj_recipient_part_one_plans',
|
||||
to='terminal.replaystorage', verbose_name='Object storage recipient part one')),
|
||||
('obj_recipients_part_two',
|
||||
models.ManyToManyField(blank=True, related_name='obj_recipient_part_two_plans',
|
||||
to='terminal.replaystorage', verbose_name='Object storage recipient part two')),
|
||||
('recipients_part_one', models.ManyToManyField(blank=True, related_name='recipient_part_one_plans',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name='Recipient part one')),
|
||||
('recipients_part_two', models.ManyToManyField(blank=True, related_name='recipient_part_two_plans',
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
verbose_name='Recipient part two')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Account backup plan',
|
||||
},
|
||||
bases=('accounts.accountbaseautomation',),
|
||||
),
|
||||
migrations.RunPython(migrate_account_backup),
|
||||
migrations.RemoveField(
|
||||
model_name='accountbackupexecution',
|
||||
name='plan',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='AccountBackupAutomation',
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='AccountBackupExecution',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='gatheredaccount',
|
||||
name='authorized_keys',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='gatheredaccount',
|
||||
name='groups',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='gatheredaccount',
|
||||
name='sudoers',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='gatheredaccount',
|
||||
name='detail',
|
||||
field=models.JSONField(blank=True, default=dict, verbose_name='Detail'),
|
||||
),
|
||||
]
|
|
@ -1,134 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-12-04 10:49
|
||||
|
||||
import common.db.fields
|
||||
import common.db.utils
|
||||
from django.db import migrations, models
|
||||
import private_storage.fields
|
||||
import private_storage.storage.files
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0019_backupaccountautomation_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="IntegrationApplication",
|
||||
fields=[
|
||||
(
|
||||
"created_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Created by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"updated_by",
|
||||
models.CharField(
|
||||
blank=True, max_length=128, null=True, verbose_name="Updated by"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_created",
|
||||
models.DateTimeField(
|
||||
auto_now_add=True, null=True, verbose_name="Date created"
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_updated",
|
||||
models.DateTimeField(auto_now=True, verbose_name="Date updated"),
|
||||
),
|
||||
(
|
||||
"comment",
|
||||
models.TextField(blank=True, default="", verbose_name="Comment"),
|
||||
),
|
||||
(
|
||||
"id",
|
||||
models.UUIDField(
|
||||
default=uuid.uuid4, primary_key=True, serialize=False
|
||||
),
|
||||
),
|
||||
(
|
||||
"org_id",
|
||||
models.CharField(
|
||||
blank=True,
|
||||
db_index=True,
|
||||
default="",
|
||||
max_length=36,
|
||||
verbose_name="Organization",
|
||||
),
|
||||
),
|
||||
("name", models.CharField(max_length=128, verbose_name="Name")),
|
||||
(
|
||||
"logo",
|
||||
private_storage.fields.PrivateImageField(
|
||||
max_length=128,
|
||||
storage=private_storage.storage.files.PrivateFileSystemStorage(),
|
||||
upload_to="integration-apps",
|
||||
verbose_name="Logo",
|
||||
),
|
||||
),
|
||||
(
|
||||
"secret",
|
||||
common.db.fields.EncryptTextField(
|
||||
default="", verbose_name="Secret"
|
||||
),
|
||||
),
|
||||
(
|
||||
"accounts",
|
||||
common.db.fields.JSONManyToManyField(
|
||||
default=dict, to="accounts.Account", verbose_name="Accounts"
|
||||
),
|
||||
),
|
||||
(
|
||||
"ip_group",
|
||||
models.JSONField(
|
||||
default=common.db.utils.default_ip_group,
|
||||
verbose_name="IP group",
|
||||
),
|
||||
),
|
||||
(
|
||||
"date_last_used",
|
||||
models.DateTimeField(
|
||||
blank=True, null=True, verbose_name="Date last used"
|
||||
),
|
||||
),
|
||||
("is_active", models.BooleanField(default=True, verbose_name="Active")),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Integration App",
|
||||
"unique_together": {("name", "org_id")},
|
||||
},
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name="ServiceIntegration",
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name="automationexecution",
|
||||
options={
|
||||
"permissions": [
|
||||
("view_changesecretexecution", "Can view change secret execution"),
|
||||
("add_changesecretexecution", "Can add change secret execution"),
|
||||
(
|
||||
"view_gatheraccountsexecution",
|
||||
"Can view gather accounts execution",
|
||||
),
|
||||
(
|
||||
"add_gatheraccountsexecution",
|
||||
"Can add gather accounts execution",
|
||||
),
|
||||
("view_pushaccountexecution", "Can view push account execution"),
|
||||
("add_pushaccountexecution", "Can add push account execution"),
|
||||
(
|
||||
"view_backupaccountexecution",
|
||||
"Can view backup account execution",
|
||||
),
|
||||
("add_backupaccountexecution", "Can add backup account execution"),
|
||||
],
|
||||
"verbose_name": "Automation execution",
|
||||
"verbose_name_plural": "Automation executions",
|
||||
},
|
||||
),
|
||||
]
|
|
@ -1,25 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-12-05 08:39
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0020_integrationapplication_delete_serviceintegration_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='pushaccountautomation',
|
||||
name='action',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='pushaccountautomation',
|
||||
name='triggers',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='pushaccountautomation',
|
||||
name='username',
|
||||
),
|
||||
]
|
|
@ -1,24 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-12-09 03:15
|
||||
|
||||
from django.db import migrations
|
||||
import private_storage.fields
|
||||
import private_storage.storage.files
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0021_remove_pushaccountautomation_action_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='changesecretrecord',
|
||||
options={'permissions': [('view_pushsecretrecord', 'Can view change secret execution'), ('add_pushsecretexecution', 'Can add change secret execution')], 'verbose_name': 'Change secret record'},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='integrationapplication',
|
||||
name='logo',
|
||||
field=private_storage.fields.PrivateImageField(max_length=128, storage=private_storage.storage.files.PrivateFileSystemStorage(), upload_to='images', verbose_name='Logo'),
|
||||
),
|
||||
]
|
|
@ -1,17 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-12-10 11:29
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0022_alter_changesecretrecord_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='changesecretrecord',
|
||||
options={'verbose_name': 'Change secret record'},
|
||||
),
|
||||
]
|
|
@ -1,42 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2024-12-24 05:27
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('assets', '0012_auto_20241204_1516'),
|
||||
('accounts', '0023_alter_changesecretrecord_options'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='changesecretrecord',
|
||||
name='date_started',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='changesecretrecord',
|
||||
name='account',
|
||||
field=models.ForeignKey(
|
||||
null=True, on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='change_secret_records', to='accounts.account'
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='changesecretrecord',
|
||||
name='asset',
|
||||
field=models.ForeignKey(
|
||||
null=True, on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='asset_change_secret_records', to='assets.asset'
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='changesecretrecord',
|
||||
name='execution',
|
||||
field=models.ForeignKey(
|
||||
null=True, on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name='execution_change_secret_records', to='accounts.automationexecution'
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2025-01-09 11:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0024_remove_changesecretrecord_date_started_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='accountrisk',
|
||||
name='risk',
|
||||
field=models.CharField(choices=[('long_time_no_login', 'Long time no login'), ('new_found', 'New found'), ('groups_changed', 'Groups change'), ('sudoers_changed', 'Sudo changed'), ('authorized_keys_changed', 'Authorized keys changed'), ('account_deleted', 'Account delete'), ('password_expired', 'Password expired'), ('long_time_password', 'Long time no change'), ('weak_password', 'Weak password'), ('leaked_password', 'Leaked password'), ('repeated_password', 'Repeated password'), ('password_error', 'Password error'), ('no_admin_account', 'No admin account'), ('others', 'Others')], max_length=128, verbose_name='Risk'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='gatheredaccount',
|
||||
name='address_last_login',
|
||||
field=models.CharField(default='', max_length=39, null=True, verbose_name='Address login'),
|
||||
),
|
||||
]
|
|
@ -1,25 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2025-01-13 03:13
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0025_alter_accountrisk_risk_and_more"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="account",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="risks",
|
||||
to="accounts.account",
|
||||
verbose_name="Account",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,24 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2025-01-13 07:36
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("accounts", "0026_accountrisk_account"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="accountrisk",
|
||||
name="gathered_account",
|
||||
field=models.ForeignKey(
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="risks",
|
||||
to="accounts.gatheredaccount",
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1,26 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2025-01-21 08:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0027_accountrisk_gathered_account'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='checkaccountengine',
|
||||
name='is_active',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checkaccountautomation',
|
||||
name='engines',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='checkaccountautomation',
|
||||
name='engines',
|
||||
field=models.JSONField(default=list, verbose_name='Engines'),
|
||||
),
|
||||
]
|
|
@ -1,51 +0,0 @@
|
|||
# Generated by Django 4.1.13 on 2025-01-23 07:22
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('assets', '0012_auto_20241204_1516'),
|
||||
('accounts', '0028_remove_checkaccountengine_is_active_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='changesecretrecord',
|
||||
name='account',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)ss', to='accounts.account'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='changesecretrecord',
|
||||
name='asset',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='asset_%(class)ss', to='assets.asset'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='changesecretrecord',
|
||||
name='execution',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='execution_%(class)ss', to='accounts.automationexecution'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PushSecretRecord',
|
||||
fields=[
|
||||
('created_by', models.CharField(blank=True, max_length=128, null=True, verbose_name='Created by')),
|
||||
('updated_by', models.CharField(blank=True, max_length=128, null=True, verbose_name='Updated by')),
|
||||
('date_created', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Date created')),
|
||||
('date_updated', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
|
||||
('comment', models.TextField(blank=True, default='', verbose_name='Comment')),
|
||||
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
|
||||
('date_finished', models.DateTimeField(blank=True, db_index=True, null=True, verbose_name='Date finished')),
|
||||
('status', models.CharField(default='pending', max_length=16, verbose_name='Status')),
|
||||
('error', models.TextField(blank=True, null=True, verbose_name='Error')),
|
||||
('account', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)ss', to='accounts.account')),
|
||||
('asset', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='asset_%(class)ss', to='assets.asset')),
|
||||
('execution', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='execution_%(class)ss', to='accounts.automationexecution')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Push secret record',
|
||||
},
|
||||
),
|
||||
]
|
Loading…
Reference in New Issue