1
0
mirror of https://github.com/etesync/server synced 2024-11-22 08:48:07 +00:00

Set custom user model and reset migrations.

This commit is contained in:
Tom Hacohen 2020-05-13 16:01:49 +03:00
parent df0f7d134d
commit 6b0a40e9dd
47 changed files with 103 additions and 900 deletions

View File

@ -1,9 +1,10 @@
# Generated by Django 3.0.3 on 2020-02-19 15:33 # Generated by Django 3.0.3 on 2020-05-13 13:01
from django.conf import settings from django.conf import settings
import django.core.validators import django.core.validators
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
import django_etesync.models
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -19,7 +20,7 @@ class Migration(migrations.Migration):
name='Collection', name='Collection',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-fA-F0-9\\-_=]{44}')])), ('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')])),
('version', models.PositiveSmallIntegerField()), ('version', models.PositiveSmallIntegerField()),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
], ],
@ -31,37 +32,60 @@ class Migration(migrations.Migration):
name='CollectionItem', name='CollectionItem',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-fA-F0-9\\-_=]{44}')])), ('uid', models.CharField(db_index=True, max_length=44, null=True, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')])),
('version', models.PositiveSmallIntegerField()), ('version', models.PositiveSmallIntegerField()),
('encryptionKey', models.BinaryField(editable=True)), ('encryptionKey', models.BinaryField(editable=True, null=True)),
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_etesync.Collection')), ('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='django_etesync.Collection')),
], ],
options={ options={
'unique_together': {('uid', 'collection')}, 'unique_together': {('uid', 'collection')},
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name='CollectionItemSnapshot', name='CollectionItemChunk',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('current', models.BooleanField(default=True)), ('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')])),
('chunkHmac', models.CharField(max_length=50)), ('chunkFile', models.FileField(max_length=150, unique=True, upload_to=django_etesync.models.chunk_directory_path)),
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_etesync.CollectionItem')), ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chunks', to='django_etesync.CollectionItem')),
],
),
migrations.CreateModel(
name='CollectionItemRevision',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uid', models.CharField(db_index=True, max_length=44, unique=True, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')])),
('meta', models.BinaryField(editable=True)),
('current', models.BooleanField(db_index=True, default=True, null=True)),
('deleted', models.BooleanField(default=False)),
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions', to='django_etesync.CollectionItem')),
], ],
options={ options={
'unique_together': {('item', 'current')}, 'unique_together': {('item', 'current')},
}, },
), ),
migrations.CreateModel( migrations.CreateModel(
name='CollectionItemChunk', name='RevisionChunkRelation',
fields=[ fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uid', models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-fA-F0-9\\-_=]{44}')])), ('chunk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions_relation', to='django_etesync.CollectionItemChunk')),
('order', models.CharField(max_length=100)), ('revision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chunks_relation', to='django_etesync.CollectionItemRevision')),
('itemSnapshot', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='django_etesync.CollectionItemSnapshot')),
], ],
options={ options={
'ordering': ['order'], 'ordering': ('id',),
},
),
migrations.CreateModel(
name='CollectionMember',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('encryptionKey', models.BinaryField(editable=True)),
('accessLevel', models.CharField(choices=[('adm', 'Admin'), ('rw', 'Read Write'), ('ro', 'Read Only')], default='ro', max_length=3)),
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='members', to='django_etesync.Collection')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'unique_together': {('user', 'collection')},
}, },
), ),
] ]

View File

@ -1,53 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 09:43
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='collectionitemchunk',
name='itemSnapshot',
),
migrations.AddField(
model_name='collectionitem',
name='hmac',
field=models.CharField(default='', max_length=50),
preserve_default=False,
),
migrations.AddField(
model_name='collectionitemchunk',
name='items',
field=models.ManyToManyField(related_name='chunks', to='django_etesync.CollectionItem'),
),
migrations.AlterField(
model_name='collection',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-zA-Z0-9\\-_=]{44}')]),
),
migrations.AlterField(
model_name='collectionitem',
name='collection',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='django_etesync.Collection'),
),
migrations.AlterField(
model_name='collectionitem',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-zA-Z0-9\\-_=]{44}')]),
),
migrations.AlterField(
model_name='collectionitemchunk',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-zA-Z0-9\\-_=]{44}')]),
),
migrations.DeleteModel(
name='CollectionItemSnapshot',
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 09:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0002_auto_20200220_0943'),
]
operations = [
migrations.AddField(
model_name='collectionitem',
name='current',
field=models.BooleanField(default=True),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 10:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0003_collectionitem_current'),
]
operations = [
migrations.AlterField(
model_name='collectionitem',
name='current',
field=models.BooleanField(db_index=True, default=True),
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 11:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0004_auto_20200220_1029'),
]
operations = [
migrations.RemoveField(
model_name='collectionitemchunk',
name='items',
),
migrations.AddField(
model_name='collectionitem',
name='chunks',
field=models.ManyToManyField(related_name='items', to='django_etesync.CollectionItemChunk'),
),
migrations.AddField(
model_name='collectionitemchunk',
name='collection',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='chunks', to='django_etesync.Collection'),
preserve_default=False,
),
]

View File

@ -1,49 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 11:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0005_auto_20200220_1123'),
]
operations = [
migrations.RemoveField(
model_name='collectionitem',
name='chunks',
),
migrations.RemoveField(
model_name='collectionitem',
name='current',
),
migrations.RemoveField(
model_name='collectionitem',
name='encryptionKey',
),
migrations.RemoveField(
model_name='collectionitem',
name='hmac',
),
migrations.RemoveField(
model_name='collectionitem',
name='version',
),
migrations.CreateModel(
name='CollectionItemSnapshot',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('version', models.PositiveSmallIntegerField()),
('encryptionKey', models.BinaryField(editable=True)),
('hmac', models.CharField(max_length=50)),
('current', models.BooleanField(db_index=True, default=True)),
('chunks', models.ManyToManyField(related_name='items', to='django_etesync.CollectionItemChunk')),
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='snapshots', to='django_etesync.CollectionItem')),
],
options={
'unique_together': {('item', 'current')},
},
),
]

View File

@ -1,28 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 11:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0006_auto_20200220_1137'),
]
operations = [
migrations.AddField(
model_name='collectionitemchunk',
name='item',
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='chunks', to='django_etesync.CollectionItem'),
preserve_default=False,
),
migrations.AlterUniqueTogether(
name='collectionitemchunk',
unique_together={('item', 'order')},
),
migrations.RemoveField(
model_name='collectionitemchunk',
name='collection',
),
]

View File

@ -1,20 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 12:16
from django.db import migrations, models
import django_etesync.models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0007_auto_20200220_1144'),
]
operations = [
migrations.AddField(
model_name='collectionitemchunk',
name='chunkFile',
field=models.FileField(default='', upload_to=django_etesync.models.chunk_directory_path),
preserve_default=False,
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 12:20
from django.db import migrations, models
import django_etesync.models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0008_collectionitemchunk_chunkfile'),
]
operations = [
migrations.AlterField(
model_name='collectionitemchunk',
name='chunkFile',
field=models.FileField(max_length=150, upload_to=django_etesync.models.chunk_directory_path),
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 12:48
from django.db import migrations, models
import django_etesync.models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0009_auto_20200220_1220'),
]
operations = [
migrations.AlterField(
model_name='collectionitemchunk',
name='chunkFile',
field=models.FileField(max_length=150, unique=True, upload_to=django_etesync.models.chunk_directory_path),
),
]

View File

@ -1,17 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 20:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0010_auto_20200220_1248'),
]
operations = [
migrations.RenameModel(
old_name='CollectionItemSnapshot',
new_name='CollectionItemRevision',
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-20 20:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0011_auto_20200220_2037'),
]
operations = [
migrations.AlterField(
model_name='collectionitemrevision',
name='item',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions', to='django_etesync.CollectionItem'),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-26 13:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0012_auto_20200220_2038'),
]
operations = [
migrations.AddField(
model_name='collectionitemrevision',
name='is_deletion',
field=models.BooleanField(default=False),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-26 13:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0013_collectionitemrevision_is_deletion'),
]
operations = [
migrations.RenameField(
model_name='collectionitemrevision',
old_name='is_deletion',
new_name='isDeletion',
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-26 13:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0014_auto_20200226_1322'),
]
operations = [
migrations.AlterField(
model_name='collectionitemrevision',
name='current',
field=models.BooleanField(blank=True, db_index=True, default=True, null=True),
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-26 14:46
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0015_auto_20200226_1349'),
]
operations = [
migrations.AlterField(
model_name='collection',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-zA-Z0-9\\-_=]{43}')]),
),
migrations.AlterField(
model_name='collectionitem',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-zA-Z0-9\\-_=]{43}')]),
),
migrations.AlterField(
model_name='collectionitemchunk',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID. Expected a 256bit base64url.', regex='[a-zA-Z0-9\\-_=]{43}')]),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-26 14:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0016_auto_20200226_1446'),
]
operations = [
migrations.RenameField(
model_name='collectionitemrevision',
old_name='isDeletion',
new_name='deleted',
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-26 18:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0017_auto_20200226_1455'),
]
operations = [
migrations.AlterField(
model_name='collectionitemrevision',
name='current',
field=models.BooleanField(db_index=True, default=True, null=True),
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 3.0.3 on 2020-02-26 18:33
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('django_etesync', '0018_auto_20200226_1803'),
]
operations = [
migrations.CreateModel(
name='CollectionMember',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('encryptionKey', models.BinaryField(editable=True)),
('accessLevel', models.CharField(choices=[('adm', 'Admin'), ('rw', 'Read Write'), ('ro', 'Read Only')], default='ro', max_length=3)),
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='members', to='django_etesync.Collection')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'unique_together': {('user', 'collection')},
},
),
]

View File

@ -1,29 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-10 14:38
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0019_collectionmember'),
]
operations = [
migrations.AlterField(
model_name='collection',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]{24}')]),
),
migrations.AlterField(
model_name='collectionitem',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]{24}')]),
),
migrations.AlterField(
model_name='collectionitemchunk',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}=?$')]),
),
]

View File

@ -1,24 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-10 14:39
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0020_auto_20200310_1438'),
]
operations = [
migrations.AlterField(
model_name='collection',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')]),
),
migrations.AlterField(
model_name='collectionitem',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')]),
),
]

View File

@ -1,33 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-10 15:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0021_auto_20200310_1439'),
]
operations = [
migrations.RemoveField(
model_name='collectionitemrevision',
name='encryptionKey',
),
migrations.RemoveField(
model_name='collectionitemrevision',
name='version',
),
migrations.AddField(
model_name='collectionitem',
name='encryptionKey',
field=models.BinaryField(default=b'aoesnutheounth', editable=True),
preserve_default=False,
),
migrations.AddField(
model_name='collectionitem',
name='version',
field=models.PositiveSmallIntegerField(default=1),
preserve_default=False,
),
]

View File

@ -1,17 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-10 15:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0022_auto_20200310_1547'),
]
operations = [
migrations.AlterModelOptions(
name='collectionitemchunk',
options={'ordering': ('item', 'order')},
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-12 13:41
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0023_auto_20200310_1556'),
]
operations = [
migrations.AddField(
model_name='collectionitemrevision',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')]),
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-12 13:50
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0024_collectionitemrevision_uid'),
]
operations = [
migrations.AlterField(
model_name='collectionitemrevision',
name='uid',
field=models.CharField(db_index=True, max_length=44, unique=True, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')]),
),
]

View File

@ -1,18 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-12 14:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0025_auto_20200312_1350'),
]
operations = [
migrations.AddField(
model_name='collectionitemrevision',
name='meta',
field=models.BinaryField(blank=True, editable=True, null=True),
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-12 14:14
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0026_collectionitemrevision_meta'),
]
operations = [
migrations.AddField(
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'),
),
]

View File

@ -1,24 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-12 18:19
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0027_collection_mainitem'),
]
operations = [
migrations.AlterField(
model_name='collectionitem',
name='encryptionKey',
field=models.BinaryField(editable=True, null=True),
),
migrations.AlterField(
model_name='collectionitem',
name='uid',
field=models.CharField(db_index=True, max_length=44, null=True, validators=[django.core.validators.RegexValidator(message='Not a valid UID', regex='[a-zA-Z0-9]')]),
),
]

View File

@ -1,35 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-12 18:49
from django.db import migrations
from django.utils.crypto import get_random_string
def generate_rev_uid(length=32):
return get_random_string(length)
def add_collection_main_item(apps, schema_editor):
Collection = apps.get_model('django_etesync', 'Collection')
CollectionItem = apps.get_model('django_etesync', 'CollectionItem')
CollectionItemRevision = apps.get_model('django_etesync', 'CollectionItemRevision')
for col in Collection.objects.all():
main_item = CollectionItem.objects.create(uid=None, encryptionKey=None, version=col.version, collection=col)
col.mainItem = main_item
col.save()
CollectionItemRevision.objects.create(
uid=generate_rev_uid(),
hmac='hmac-hash',
item=main_item)
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0028_auto_20200312_1819'),
]
operations = [
migrations.RunPython(add_collection_main_item),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-12 18:59
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0029_auto_20200312_1849'),
]
operations = [
migrations.AlterField(
model_name='collection',
name='mainItem',
field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='of_collection', to='django_etesync.CollectionItem'),
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-17 15:09
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0030_auto_20200312_1859'),
]
operations = [
migrations.AlterField(
model_name='collectionitemchunk',
name='uid',
field=models.CharField(db_index=True, max_length=44, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')]),
),
]

View File

@ -1,23 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-17 15:13
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0031_auto_20200317_1509'),
]
operations = [
migrations.RemoveField(
model_name='collectionitemrevision',
name='hmac',
),
migrations.AlterField(
model_name='collectionitemrevision',
name='uid',
field=models.CharField(db_index=True, max_length=44, unique=True, validators=[django.core.validators.RegexValidator(message='Expected a 256bit base64url.', regex='^[a-zA-Z0-9\\-_]{43}$')]),
),
]

View File

@ -1,19 +0,0 @@
# Generated by Django 3.0.3 on 2020-03-17 20:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0032_auto_20200317_1513'),
]
operations = [
migrations.AlterField(
model_name='collectionitemrevision',
name='meta',
field=models.BinaryField(default=b'', editable=True),
preserve_default=False,
),
]

View File

@ -1,19 +0,0 @@
# 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'),
),
]

View File

@ -1,19 +0,0 @@
# 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'),
),
]

View File

@ -1,37 +0,0 @@
# Generated by Django 3.0.3 on 2020-04-15 14:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0035_auto_20200415_1259'),
]
operations = [
migrations.AlterModelOptions(
name='collectionitemchunk',
options={},
),
migrations.AlterUniqueTogether(
name='collectionitemchunk',
unique_together=set(),
),
migrations.CreateModel(
name='RevisionChunkRelation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('chunk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revisions_relation', to='django_etesync.CollectionItemChunk')),
('revision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chunks_relation', to='django_etesync.CollectionItemRevision')),
],
options={
'ordering': ('id',),
},
),
migrations.RemoveField(
model_name='collectionitemchunk',
name='order',
),
]

View File

@ -1,23 +0,0 @@
# Generated by Django 3.0.3 on 2020-04-15 14:21
from django.db import migrations
def change_chunk_relation(apps, schema_editor):
CollectionItemRevision = apps.get_model('django_etesync', 'CollectionItemRevision')
RevisionChunkRelation = apps.get_model('django_etesync', 'RevisionChunkRelation')
for revision in CollectionItemRevision.objects.all():
for chunk in revision.chunks.all():
RevisionChunkRelation.objects.create(chunk=chunk, revision=revision)
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0036_auto_20200415_1420'),
]
operations = [
migrations.RunPython(change_chunk_relation),
]

View File

@ -1,17 +0,0 @@
# Generated by Django 3.0.3 on 2020-04-15 14:34
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0037_auto_20200415_1421'),
]
operations = [
migrations.RemoveField(
model_name='collectionitemrevision',
name='chunks',
),
]

View File

@ -1,17 +0,0 @@
# Generated by Django 3.0.3 on 2020-04-16 08:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0038_remove_collectionitemrevision_chunks'),
]
operations = [
migrations.RemoveField(
model_name='collection',
name='mainItem',
),
]

0
myauth/__init__.py Normal file
View File

5
myauth/admin.py Normal file
View File

@ -0,0 +1,5 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
admin.site.register(User, UserAdmin)

5
myauth/apps.py Normal file
View File

@ -0,0 +1,5 @@
from django.apps import AppConfig
class MyauthConfig(AppConfig):
name = 'myauth'

View File

@ -0,0 +1,44 @@
# Generated by Django 3.0.3 on 2020-05-13 13:00
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
],
options={
'verbose_name': 'user',
'verbose_name_plural': 'users',
'abstract': False,
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
]

View File

5
myauth/models.py Normal file
View File

@ -0,0 +1,5 @@
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
pass

3
myauth/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
myauth/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.