core: change provider to one-to-one field

This commit is contained in:
Jens Langhammer 2018-11-25 20:38:37 +01:00
parent 76a43a7818
commit 1039555113
No known key found for this signature in database
GPG Key ID: BEBC05297D92821B
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 2.1.3 on 2018-11-25 16:38
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('passbook_core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='application',
name='provider',
field=models.OneToOneField(default=None, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, to='passbook_core.Provider'),
),
]

View File

@ -49,7 +49,8 @@ class Application(RuleModel):
name = models.TextField() name = models.TextField()
launch_url = models.URLField(null=True, blank=True) launch_url = models.URLField(null=True, blank=True)
icon_url = models.TextField(null=True, blank=True) icon_url = models.TextField(null=True, blank=True)
provider = models.ForeignKey('Provider', null=True, default=None, on_delete=models.SET_DEFAULT) provider = models.OneToOneField('Provider', null=True,
default=None, on_delete=models.SET_DEFAULT)
skip_authorization = models.BooleanField(default=False) skip_authorization = models.BooleanField(default=False)
objects = InheritanceManager() objects = InheritanceManager()