1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-01-26 23:25:20 +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:
Gao Jiangmiao 2019-08-19 09:13:03 +08:00 committed by GitHub
commit dd2706ef34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 13 deletions

View file

@ -1,6 +1,5 @@
from django.db import models, migrations
from django.conf import settings
from django.db.models import CASCADE
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)),
('is_change', models.BooleanField(default=False)),
('is_delete', models.BooleanField(default=False)),
('instance', models.ForeignKey(to='instances.Instance', on_delete=CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=CASCADE)),
('instance', models.ForeignKey(to='instances.Instance', on_delete=models.CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
options={
},

View file

@ -1,6 +1,5 @@
from django.db import models, migrations
from django.conf import settings
from django.db.models import CASCADE
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)),
('keyname', models.CharField(max_length=25)),
('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)),
],
),
]

View file

@ -1,6 +1,5 @@
from django.db import models, migrations
from django.conf import settings
from django.db.models import CASCADE
class Migration(migrations.Migration):
@ -18,7 +17,7 @@ class Migration(migrations.Migration):
('max_instances', models.IntegerField(default=0)),
('max_cpus', 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)),
],
),
]

View file

@ -1,6 +1,5 @@
from django.conf import settings
from django.db import migrations, models
from django.db.models import DO_NOTHING
class Migration(migrations.Migration):
@ -13,6 +12,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='usersshkey',
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),
),
]

View file

@ -14,7 +14,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(max_length=20)),
('uuid', models.CharField(max_length=36)),
('compute', models.ForeignKey(to='computes.Compute')),
('compute', models.ForeignKey(to='computes.Compute', on_delete=models.CASCADE)),
],
options={
},

View file

@ -16,8 +16,8 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('message', models.CharField(max_length=255)),
('date', models.DateTimeField(auto_now=True)),
('instance', models.ForeignKey(to='instances.Instance')),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
('instance', models.ForeignKey(to='instances.Instance', on_delete=models.CASCADE)),
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)),
],
options={
},

View file

@ -13,7 +13,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='logs',
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,
),
migrations.AlterField(