2020-03-27 23:36:52 +00:00
|
|
|
# Generated by Django 3.0.3 on 2020-03-27 23:35
|
2020-03-27 21:14:28 +00:00
|
|
|
|
|
|
|
from django.db import migrations, models
|
|
|
|
import django.db.models.deletion
|
2020-03-27 23:36:52 +00:00
|
|
|
import fedireads.models.book
|
2020-03-27 21:14:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
('fedireads', '0019_comment'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Connector',
|
|
|
|
fields=[
|
|
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
|
|
('created_date', models.DateTimeField(auto_now_add=True)),
|
|
|
|
('updated_date', models.DateTimeField(auto_now=True)),
|
2020-03-27 23:36:52 +00:00
|
|
|
('identifier', models.CharField(max_length=255, unique=True)),
|
|
|
|
('connector_file', models.CharField(choices=[('openlibrary', 'Openlibrary'), ('fedireads', 'Fedireads')], default='openlibrary', max_length=255)),
|
|
|
|
('is_self', models.BooleanField(default=False)),
|
2020-03-27 21:14:28 +00:00
|
|
|
('api_key', models.CharField(max_length=255, null=True)),
|
|
|
|
('base_url', models.CharField(max_length=255)),
|
|
|
|
('covers_url', models.CharField(max_length=255)),
|
|
|
|
('search_url', models.CharField(max_length=255, null=True)),
|
2020-03-27 23:36:52 +00:00
|
|
|
('key_name', models.CharField(max_length=255)),
|
2020-03-27 21:14:28 +00:00
|
|
|
('politeness_delay', models.IntegerField(null=True)),
|
|
|
|
('max_query_count', models.IntegerField(null=True)),
|
|
|
|
('query_count', models.IntegerField(default=0)),
|
|
|
|
('query_count_expiry', models.DateTimeField(auto_now_add=True)),
|
|
|
|
],
|
2020-03-27 23:36:52 +00:00
|
|
|
),
|
|
|
|
migrations.RenameField(
|
|
|
|
model_name='book',
|
|
|
|
old_name='local_key',
|
|
|
|
new_name='fedireads_key',
|
2020-03-27 21:14:28 +00:00
|
|
|
),
|
|
|
|
migrations.RenameField(
|
|
|
|
model_name='book',
|
|
|
|
old_name='origin',
|
|
|
|
new_name='source_url',
|
|
|
|
),
|
|
|
|
migrations.RemoveField(
|
|
|
|
model_name='book',
|
|
|
|
name='local_edits',
|
|
|
|
),
|
2020-03-27 23:36:52 +00:00
|
|
|
migrations.AddConstraint(
|
|
|
|
model_name='connector',
|
|
|
|
constraint=models.CheckConstraint(check=models.Q(connector_file__in=fedireads.models.book.ConnectorFiles), name='connector_file_valid'),
|
|
|
|
),
|
2020-03-27 21:14:28 +00:00
|
|
|
migrations.AddField(
|
|
|
|
model_name='book',
|
|
|
|
name='connector',
|
|
|
|
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Connector'),
|
|
|
|
),
|
|
|
|
]
|