mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-27 23:55:19 +00:00
Merge pull request #3 from dropnas/migrate/to/python3
Fix on_delete of ForeignKey and OneToOneField for migrations
This commit is contained in:
commit
dd2706ef34
7 changed files with 9 additions and 13 deletions
|
@ -1,6 +1,5 @@
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.models import CASCADE
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -17,8 +16,8 @@ class Migration(migrations.Migration):
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||||
('is_change', models.BooleanField(default=False)),
|
('is_change', models.BooleanField(default=False)),
|
||||||
('is_delete', models.BooleanField(default=False)),
|
('is_delete', models.BooleanField(default=False)),
|
||||||
('instance', models.ForeignKey(to='instances.Instance', on_delete=CASCADE)),
|
('instance', models.ForeignKey(to='instances.Instance', on_delete=models.CASCADE)),
|
||||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=CASCADE)),
|
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.models import CASCADE
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -17,7 +16,7 @@ class Migration(migrations.Migration):
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||||
('keyname', models.CharField(max_length=25)),
|
('keyname', models.CharField(max_length=25)),
|
||||||
('keypublic', models.CharField(max_length=500)),
|
('keypublic', models.CharField(max_length=500)),
|
||||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=CASCADE)),
|
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.models import CASCADE
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -18,7 +17,7 @@ class Migration(migrations.Migration):
|
||||||
('max_instances', models.IntegerField(default=0)),
|
('max_instances', models.IntegerField(default=0)),
|
||||||
('max_cpus', models.IntegerField(default=0)),
|
('max_cpus', models.IntegerField(default=0)),
|
||||||
('max_memory', models.IntegerField(default=0)),
|
('max_memory', models.IntegerField(default=0)),
|
||||||
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, on_delete=CASCADE)),
|
('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
from django.db.models import DO_NOTHING
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
@ -13,6 +12,6 @@ class Migration(migrations.Migration):
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='usersshkey',
|
model_name='usersshkey',
|
||||||
name='user',
|
name='user',
|
||||||
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=DO_NOTHING),
|
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.DO_NOTHING),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Migration(migrations.Migration):
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||||
('name', models.CharField(max_length=20)),
|
('name', models.CharField(max_length=20)),
|
||||||
('uuid', models.CharField(max_length=36)),
|
('uuid', models.CharField(max_length=36)),
|
||||||
('compute', models.ForeignKey(to='computes.Compute')),
|
('compute', models.ForeignKey(to='computes.Compute', on_delete=models.CASCADE)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,8 +16,8 @@ class Migration(migrations.Migration):
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||||
('message', models.CharField(max_length=255)),
|
('message', models.CharField(max_length=255)),
|
||||||
('date', models.DateTimeField(auto_now=True)),
|
('date', models.DateTimeField(auto_now=True)),
|
||||||
('instance', models.ForeignKey(to='instances.Instance')),
|
('instance', models.ForeignKey(to='instances.Instance', on_delete=models.CASCADE)),
|
||||||
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
|
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,7 +13,7 @@ class Migration(migrations.Migration):
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='logs',
|
model_name='logs',
|
||||||
name='user',
|
name='user',
|
||||||
field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
|
field=models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE),
|
||||||
preserve_default=False,
|
preserve_default=False,
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
|
|
Loading…
Reference in a new issue