45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.11.11 on 2018-03-21 23:43
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
def delete_all_client_linked_models(apps, schema_editor):
|
|
OAuth2Authorize = apps.get_model('oauth2', 'OAuth2Authorize')
|
|
OAuth2TempFile = apps.get_model('oauth2', 'OAuth2TempFile')
|
|
OAuth2Authorize.objects.all().delete()
|
|
OAuth2TempFile.objects.all().delete()
|
|
|
|
|
|
def noop(apps, schema_editor):
|
|
pass
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('oauth2', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(delete_all_client_linked_models, noop),
|
|
migrations.AddField(
|
|
model_name='oauth2authorize',
|
|
name='client',
|
|
field=models.ForeignKey(
|
|
default=1, on_delete=django.db.models.deletion.CASCADE, to='oauth2.OAuth2Client'
|
|
),
|
|
preserve_default=False,
|
|
),
|
|
migrations.AddField(
|
|
model_name='oauth2tempfile',
|
|
name='client',
|
|
field=models.ForeignKey(
|
|
default=1, on_delete=django.db.models.deletion.CASCADE, to='oauth2.OAuth2Client'
|
|
),
|
|
preserve_default=False,
|
|
),
|
|
]
|