mirror of
https://github.com/etesync/server
synced 2024-12-28 02:08:08 +00:00
Collection: lax the restrictions on mainItem.
This commit is contained in:
parent
963dc3c62d
commit
c589d06cbe
19
django_etesync/migrations/0034_auto_20200415_1248.py
Normal file
19
django_etesync/migrations/0034_auto_20200415_1248.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 3.0.3 on 2020-04-15 12:48
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('django_etesync', '0033_auto_20200317_2010'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='collection',
|
||||||
|
name='mainItem',
|
||||||
|
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='of_collection', to='django_etesync.CollectionItem'),
|
||||||
|
),
|
||||||
|
]
|
19
django_etesync/migrations/0035_auto_20200415_1259.py
Normal file
19
django_etesync/migrations/0035_auto_20200415_1259.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 3.0.3 on 2020-04-15 12:59
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('django_etesync', '0034_auto_20200415_1248'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='collection',
|
||||||
|
name='mainItem',
|
||||||
|
field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='of_collection', to='django_etesync.CollectionItem'),
|
||||||
|
),
|
||||||
|
]
|
@ -29,7 +29,7 @@ class Collection(models.Model):
|
|||||||
max_length=44, validators=[UidValidator])
|
max_length=44, validators=[UidValidator])
|
||||||
version = models.PositiveSmallIntegerField()
|
version = models.PositiveSmallIntegerField()
|
||||||
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
||||||
mainItem = models.OneToOneField('CollectionItem', related_name='of_collection', on_delete=models.PROTECT)
|
mainItem = models.OneToOneField('CollectionItem', related_name='of_collection', null=True, on_delete=models.SET_NULL)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
unique_together = ('uid', 'owner')
|
unique_together = ('uid', 'owner')
|
||||||
|
Loading…
Reference in New Issue
Block a user