From 6e7ad92a12365d7c2c32cfd2f7add657464c9b6f Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 26 May 2020 18:52:44 +0300 Subject: [PATCH] Add missing migrations forgotten in the previous commit Missing from: 73f4ff765c7713c9aa48dec2bfc4c3c1c0c7e9f3 --- .../migrations/0008_auto_20200526_1535.py | 28 +++++++++++++++++++ .../migrations/0009_auto_20200526_1535.py | 23 +++++++++++++++ .../migrations/0010_auto_20200526_1539.py | 19 +++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 django_etesync/migrations/0008_auto_20200526_1535.py create mode 100644 django_etesync/migrations/0009_auto_20200526_1535.py create mode 100644 django_etesync/migrations/0010_auto_20200526_1539.py diff --git a/django_etesync/migrations/0008_auto_20200526_1535.py b/django_etesync/migrations/0008_auto_20200526_1535.py new file mode 100644 index 0000000..e544bdd --- /dev/null +++ b/django_etesync/migrations/0008_auto_20200526_1535.py @@ -0,0 +1,28 @@ +# Generated by Django 3.0.3 on 2020-05-26 15:35 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion +import django_etesync.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_etesync', '0007_auto_20200526_1336'), + ] + + operations = [ + migrations.CreateModel( + name='Stoken', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('uid', models.CharField(db_index=True, default=django_etesync.models.generate_stoken_uid, max_length=43, unique=True, validators=[django.core.validators.RegexValidator(message='Expected a base64url.', regex='^[a-zA-Z0-9\\-_]{42,43}$')])), + ], + ), + migrations.AddField( + model_name='collectionitemrevision', + name='stoken', + field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.PROTECT, to='django_etesync.Stoken'), + ), + ] diff --git a/django_etesync/migrations/0009_auto_20200526_1535.py b/django_etesync/migrations/0009_auto_20200526_1535.py new file mode 100644 index 0000000..53100b3 --- /dev/null +++ b/django_etesync/migrations/0009_auto_20200526_1535.py @@ -0,0 +1,23 @@ +# Generated by Django 3.0.3 on 2020-05-26 15:35 + +from django.db import migrations + + +def create_stokens(apps, schema_editor): + Stoken = apps.get_model('django_etesync', 'Stoken') + CollectionItemRevision = apps.get_model('django_etesync', 'CollectionItemRevision') + + for rev in CollectionItemRevision.objects.all(): + rev.stoken = Stoken.objects.create() + rev.save() + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_etesync', '0008_auto_20200526_1535'), + ] + + operations = [ + migrations.RunPython(create_stokens), + ] diff --git a/django_etesync/migrations/0010_auto_20200526_1539.py b/django_etesync/migrations/0010_auto_20200526_1539.py new file mode 100644 index 0000000..c894fd2 --- /dev/null +++ b/django_etesync/migrations/0010_auto_20200526_1539.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.3 on 2020-05-26 15:39 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_etesync', '0009_auto_20200526_1535'), + ] + + operations = [ + migrations.AlterField( + model_name='collectionitemrevision', + name='stoken', + field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='django_etesync.Stoken'), + ), + ]