mirror of
https://github.com/etesync/server
synced 2024-11-22 16:58:08 +00:00
68 lines
3.1 KiB
Python
68 lines
3.1 KiB
Python
# Generated by Django 3.0.3 on 2020-02-19 15:33
|
|
|
|
from django.conf import settings
|
|
import django.core.validators
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Collection',
|
|
fields=[
|
|
('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}')])),
|
|
('version', models.PositiveSmallIntegerField()),
|
|
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'unique_together': {('uid', 'owner')},
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='CollectionItem',
|
|
fields=[
|
|
('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}')])),
|
|
('version', models.PositiveSmallIntegerField()),
|
|
('encryptionKey', models.BinaryField(editable=True)),
|
|
('collection', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_etesync.Collection')),
|
|
],
|
|
options={
|
|
'unique_together': {('uid', 'collection')},
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='CollectionItemSnapshot',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('current', models.BooleanField(default=True)),
|
|
('chunkHmac', models.CharField(max_length=50)),
|
|
('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_etesync.CollectionItem')),
|
|
],
|
|
options={
|
|
'unique_together': {('item', 'current')},
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='CollectionItemChunk',
|
|
fields=[
|
|
('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}')])),
|
|
('order', models.CharField(max_length=100)),
|
|
('itemSnapshot', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='django_etesync.CollectionItemSnapshot')),
|
|
],
|
|
options={
|
|
'ordering': ['order'],
|
|
},
|
|
),
|
|
]
|