initial
This commit is contained in:
48
manager/migrations/0001_initial.py
Normal file
48
manager/migrations/0001_initial.py
Normal file
@@ -0,0 +1,48 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-07 11:19
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('mikrotik', '0001_initial'),
|
||||
('proxmox', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='CloneContainer',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(help_text='Will be used as hostname', max_length=150)),
|
||||
('cpus', models.IntegerField(default=1)),
|
||||
('memory', models.IntegerField(default=1024)),
|
||||
('disksize', models.IntegerField(default=10, help_text='in GB')),
|
||||
('as_regexp', models.BooleanField(choices=[(False, 'No'), (True, 'Yes')], default=True, help_text='Add a ".*<hostname>" instead of a hostname')),
|
||||
('is_active', models.BooleanField(choices=[(False, 'No'), (True, 'Yes')], default=False)),
|
||||
('status', models.CharField(blank=True, choices=[('pending', 'Pending'), ('running', 'Running'), ('success', 'Success'), ('error', 'Error')], default='pending', max_length=150, null=True)),
|
||||
('network', models.ForeignKey(on_delete=django.db.models.deletion.RESTRICT, related_name='clone_network', to='mikrotik.ipaddress')),
|
||||
('template', models.ForeignKey(null=True, on_delete=django.db.models.deletion.RESTRICT, related_name='clone_template', to='proxmox.lxctemplate')),
|
||||
('vm', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='clone_lxc', to='proxmox.lxc')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='DevContainer',
|
||||
fields=[
|
||||
('internal_id', models.BigAutoField(primary_key=True, serialize=False)),
|
||||
('dns', models.OneToOneField(on_delete=django.db.models.deletion.RESTRICT, related_name='devcontainer_dns', to='mikrotik.dnsstatic')),
|
||||
('lease', models.OneToOneField(on_delete=django.db.models.deletion.RESTRICT, related_name='devcontainer_lease', to='mikrotik.ipdhcplease')),
|
||||
('lxc', models.OneToOneField(on_delete=django.db.models.deletion.RESTRICT, related_name='devcontainer_lxc', to='proxmox.lxc')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
40
manager/migrations/0002_clonecontainer_hostname_and_more.py
Normal file
40
manager/migrations/0002_clonecontainer_hostname_and_more.py
Normal file
@@ -0,0 +1,40 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-09 06:31
|
||||
|
||||
import manager.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='clonecontainer',
|
||||
name='hostname',
|
||||
field=models.CharField(default=0, help_text='Will be used as hostname', max_length=150),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='as_regexp',
|
||||
field=models.BooleanField(choices=[(False, 'No'), (True, 'Yes')], default=True, help_text='Add a ".*<hostname>.replace(".",r"\\.")$" instead of a hostname'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='cpus',
|
||||
field=models.IntegerField(default=1, validators=[manager.models.MinValueValidatorExtended(1), manager.models.MaxValueValidatorExtended(8)]),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='disksize',
|
||||
field=models.IntegerField(default=10, help_text='in GB', validators=[manager.models.MinValueValidatorExtended(10), manager.models.MaxValueValidatorExtended(100)]),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='memory',
|
||||
field=models.IntegerField(default=1024, help_text='in MB', validators=[manager.models.MinValueValidatorExtended(256), manager.models.MaxValueValidatorExtended(8192)]),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,27 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-09 08:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0002_clonecontainer_hostname_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='clonecontainer',
|
||||
old_name='cpus',
|
||||
new_name='cores',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='clonecontainer',
|
||||
name='name',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='clonecontainer',
|
||||
name='node',
|
||||
field=models.CharField(default='proxmox', editable=False, max_length=150),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,31 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-10 09:30
|
||||
|
||||
import django.db.models.deletion
|
||||
import manager.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0003_rename_cpus_clonecontainer_cores_and_more'),
|
||||
('proxmox', '0005_alter_lxc_lxc'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='memory',
|
||||
field=models.IntegerField(default=1024, help_text='in MB', validators=[manager.models.MinValueValidatorExtended(256), manager.models.MaxValueValidatorExtended(8092)]),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='template',
|
||||
field=models.ForeignKey(blank=True, help_text='If set, will use this template instead of a VM', null=True, on_delete=django.db.models.deletion.RESTRICT, related_name='clone_template', to='proxmox.lxctemplate'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='vm',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='clone_lxc', to='proxmox.lxc'),
|
||||
),
|
||||
]
|
||||
20
manager/migrations/0005_alter_clonecontainer_vm.py
Normal file
20
manager/migrations/0005_alter_clonecontainer_vm.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-14 12:46
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0004_alter_clonecontainer_memory_and_more'),
|
||||
('proxmox', '0005_alter_lxc_lxc'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='vm',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='clone_lxc', to='proxmox.lxc', verbose_name='LXC Container'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,31 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-14 13:22
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0005_alter_clonecontainer_vm'),
|
||||
('mikrotik', '0002_alter_dnsstatic_comment_alter_ipaddress_comment_and_more'),
|
||||
('proxmox', '0005_alter_lxc_lxc'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='devcontainer',
|
||||
name='dns',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='devcontainer_dns', to='mikrotik.dnsstatic'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='devcontainer',
|
||||
name='lease',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='devcontainer_lease', to='mikrotik.ipdhcplease'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='devcontainer',
|
||||
name='lxc',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='devcontainer_lxc', to='proxmox.lxc'),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,38 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-21 11:03
|
||||
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0006_alter_devcontainer_dns_alter_devcontainer_lease_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='TaskStatusLog',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('updated_at', models.DateTimeField(auto_now=True)),
|
||||
('task_id', models.CharField(help_text='The task ID', max_length=150)),
|
||||
('task_result', models.JSONField(help_text='The task result')),
|
||||
],
|
||||
options={
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devcontainer',
|
||||
name='created_at',
|
||||
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='devcontainer',
|
||||
name='updated_at',
|
||||
field=models.DateTimeField(auto_now=True),
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,31 @@
|
||||
# Generated by Django 5.2.4 on 2025-07-23 11:16
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0007_taskstatuslog_devcontainer_created_at_and_more'),
|
||||
('mikrotik', '0002_alter_dnsstatic_comment_alter_ipaddress_comment_and_more'),
|
||||
('proxmox', '0007_lxctemplate_net0_alter_lxc_net0'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='devcontainer',
|
||||
name='dns',
|
||||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='devcontainer_dns', to='mikrotik.dnsstatic'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='devcontainer',
|
||||
name='lease',
|
||||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='devcontainer_lease', to='mikrotik.ipdhcplease'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='devcontainer',
|
||||
name='lxc',
|
||||
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='devcontainer_lxc', to='proxmox.lxc'),
|
||||
),
|
||||
]
|
||||
18
manager/migrations/0009_add_task_id.py
Normal file
18
manager/migrations/0009_add_task_id.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated manually for task_id field
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0008_alter_devcontainer_dns_alter_devcontainer_lease_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='clonecontainer',
|
||||
name='task_id',
|
||||
field=models.CharField(blank=True, help_text='UUID for tracking live status', max_length=36, null=True),
|
||||
),
|
||||
]
|
||||
19
manager/migrations/0010_alter_clonecontainer_task_id.py
Normal file
19
manager/migrations/0010_alter_clonecontainer_task_id.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Generated manually for task_id default
|
||||
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('manager', '0009_add_task_id'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='clonecontainer',
|
||||
name='task_id',
|
||||
field=models.CharField(default=uuid.uuid4, help_text='UUID for tracking live status', max_length=36),
|
||||
),
|
||||
]
|
||||
0
manager/migrations/__init__.py
Normal file
0
manager/migrations/__init__.py
Normal file
Reference in New Issue
Block a user