Updates migrations

To get the app working again I ran resetdb, let it crash in initdb,
then ran the migration, then re-ran initdb
This commit is contained in:
Mouse Reeve 2020-09-21 08:10:37 -07:00
parent d1f1260640
commit c7883cd615
106 changed files with 279 additions and 279 deletions

View file

@ -66,13 +66,13 @@ You will need postgres installed and running on your computer.
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
createdb fedireads
createdb bookwyrm
```
Create the psql user in `psql fedireads`:
Create the psql user in `psql bookwyrm`:
``` psql
CREATE ROLE fedireads WITH LOGIN PASSWORD 'fedireads';
GRANT ALL PRIVILEGES ON DATABASE fedireads TO fedireads;
CREATE ROLE bookwyrm WITH LOGIN PASSWORD 'bookwyrm';
GRANT ALL PRIVILEGES ON DATABASE bookwyrm TO bookwyrm;
```
Initialize the database (or, more specifically, delete the existing database, run migrations, and start fresh):

View file

@ -16,7 +16,7 @@ class Person(ActivityObject):
publicKey: PublicKey
endpoints: Dict
icon: Image = field(default=lambda: {})
fedireadsUser: str = False
bookwyrmUser: str = False
manuallyApprovesFollowers: str = False
discoverable: str = True
type: str = 'Person'

View file

@ -4,8 +4,8 @@ from urllib.parse import urlparse
from requests import HTTPError
from fedireads import models
from fedireads.tasks import app
from bookwyrm import models
from bookwyrm.tasks import app
def get_edition(book_id):
@ -43,7 +43,7 @@ def get_or_create_connector(remote_id):
except models.Connector.DoesNotExist:
connector_info = models.Connector.objects.create(
identifier=identifier,
connector_file='fedireads_connector',
connector_file='bookwyrm_connector',
base_url='https://%s' % identifier,
books_url='https://%s/book' % identifier,
covers_url='https://%s/images/covers' % identifier,
@ -115,6 +115,6 @@ def get_connectors():
def load_connector(connector_info):
''' instantiate the connector class '''
connector = importlib.import_module(
'fedireads.connectors.%s' % connector_info.connector_file
'bookwyrm.connectors.%s' % connector_info.connector_file
)
return connector.Connector(connector_info.identifier)

View file

@ -3,10 +3,10 @@ import json
from django.utils.http import http_date
import requests
from fedireads import models
from fedireads.activitypub import ActivityEncoder
from fedireads.tasks import app
from fedireads.signatures import make_signature, make_digest
from bookwyrm import models
from bookwyrm.activitypub import ActivityEncoder
from bookwyrm.tasks import app
from bookwyrm.signatures import make_signature, make_digest
def get_public_recipients(user, software=None):
@ -14,7 +14,7 @@ def get_public_recipients(user, software=None):
followers = user.followers.filter(local=False)
if software:
# TODO: eventually we may want to handle particular software differently
followers = followers.filter(fedireads_user=(software == 'fedireads'))
followers = followers.filter(bookwyrm_user=(software == 'bookwyrm'))
# we want shared inboxes when available
shared = followers.filter(

View file

@ -6,7 +6,7 @@ import requests
from django.db import transaction
from fedireads import models
from bookwyrm import models
class AbstractConnector(ABC):

View file

@ -1,11 +1,11 @@
''' using another fedireads instance as a source of book data '''
''' using another bookwyrm instance as a source of book data '''
from uuid import uuid4
from django.core.exceptions import ObjectDoesNotExist
from django.core.files.base import ContentFile
import requests
from fedireads import models
from bookwyrm import models
from .abstract_connector import AbstractConnector, SearchResult, Mapping
from .abstract_connector import update_from_mappings, get_date, get_data

View file

@ -4,7 +4,7 @@ import requests
from django.core.files.base import ContentFile
from fedireads import models
from bookwyrm import models
from .abstract_connector import AbstractConnector, SearchResult, Mapping
from .abstract_connector import update_from_mappings
from .abstract_connector import get_date, get_data

View file

@ -1,7 +1,7 @@
''' using a fedireads instance as a source of book data '''
''' using a bookwyrm instance as a source of book data '''
from django.contrib.postgres.search import SearchRank, SearchVector
from fedireads import models
from bookwyrm import models
from .abstract_connector import AbstractConnector, SearchResult
@ -12,7 +12,7 @@ class Connector(AbstractConnector):
def search(self, query):
''' right now you can't search fedireads sorry, but when
''' right now you can't search bookwyrm sorry, but when
that gets implemented it will totally rule '''
vector = SearchVector('title', weight='A') +\
SearchVector('subtitle', weight='B') +\

View file

@ -1,3 +1,3 @@
''' settings book data connectors '''
CONNECTORS = ['openlibrary', 'self_connector', 'fedireads_connector']
CONNECTORS = ['openlibrary', 'self_connector', 'bookwyrm_connector']

View file

@ -5,7 +5,7 @@ from django.core.exceptions import ValidationError
from django.forms import ModelForm, PasswordInput, widgets
from django import forms
from fedireads import models
from bookwyrm import models
class LoginForm(ModelForm):

View file

@ -2,10 +2,10 @@
import csv
from requests import HTTPError
from fedireads import outgoing
from fedireads.tasks import app
from fedireads.models import ImportJob, ImportItem
from fedireads.status import create_notification
from bookwyrm import outgoing
from bookwyrm.tasks import app
from bookwyrm.models import ImportJob, ImportItem
from bookwyrm.status import create_notification
# TODO: remove or increase once we're confident it's not causing problems.
MAX_ENTRIES = 500

View file

@ -8,11 +8,11 @@ from django.http import HttpResponseBadRequest, HttpResponseNotFound
from django.views.decorators.csrf import csrf_exempt
import requests
from fedireads import activitypub, books_manager, models, outgoing
from fedireads import status as status_builder
from fedireads.remote_user import get_or_create_remote_user, refresh_remote_user
from fedireads.tasks import app
from fedireads.signatures import Signature
from bookwyrm import activitypub, books_manager, models, outgoing
from bookwyrm import status as status_builder
from bookwyrm.remote_user import get_or_create_remote_user, refresh_remote_user
from bookwyrm.tasks import app
from bookwyrm.signatures import Signature
@csrf_exempt

View file

@ -7,7 +7,7 @@ import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import fedireads.utils.fields
import bookwyrm.utils.fields
class Migration(migrations.Migration):
@ -62,7 +62,7 @@ class Migration(migrations.Migration):
('content', models.TextField(blank=True, null=True)),
('created_date', models.DateTimeField(auto_now_add=True)),
('openlibrary_key', models.CharField(max_length=255)),
('data', fedireads.utils.fields.JSONField()),
('data', bookwyrm.utils.fields.JSONField()),
],
options={
'abstract': False,
@ -75,10 +75,10 @@ class Migration(migrations.Migration):
('content', models.TextField(blank=True, null=True)),
('created_date', models.DateTimeField(auto_now_add=True)),
('openlibrary_key', models.CharField(max_length=255, unique=True)),
('data', fedireads.utils.fields.JSONField()),
('data', bookwyrm.utils.fields.JSONField()),
('cover', models.ImageField(blank=True, null=True, upload_to='covers/')),
('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
('authors', models.ManyToManyField(to='fedireads.Author')),
('authors', models.ManyToManyField(to='bookwyrm.Author')),
],
options={
'abstract': False,
@ -120,9 +120,9 @@ class Migration(migrations.Migration):
('local', models.BooleanField(default=True)),
('privacy', models.CharField(default='public', max_length=255)),
('sensitive', models.BooleanField(default=False)),
('mention_books', models.ManyToManyField(related_name='mention_book', to='fedireads.Book')),
('mention_books', models.ManyToManyField(related_name='mention_book', to='bookwyrm.Book')),
('mention_users', models.ManyToManyField(related_name='mention_user', to=settings.AUTH_USER_MODEL)),
('reply_parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Status')),
('reply_parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Status')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
options={
@ -151,8 +151,8 @@ class Migration(migrations.Migration):
('content', models.TextField(blank=True, null=True)),
('created_date', models.DateTimeField(auto_now_add=True)),
('added_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')),
('shelf', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Shelf')),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')),
('shelf', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Shelf')),
],
options={
'unique_together': {('book', 'shelf')},
@ -161,7 +161,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='shelf',
name='books',
field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Book'),
field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Book'),
),
migrations.AddField(
model_name='shelf',
@ -171,17 +171,17 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='book',
name='shelves',
field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Shelf'),
field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Shelf'),
),
migrations.AddField(
model_name='user',
name='federated_server',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.FederatedServer'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.FederatedServer'),
),
migrations.AddField(
model_name='user',
name='followers',
field=models.ManyToManyField(through='fedireads.UserRelationship', to=settings.AUTH_USER_MODEL),
field=models.ManyToManyField(through='bookwyrm.UserRelationship', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='user',
@ -200,14 +200,14 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Review',
fields=[
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')),
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')),
('name', models.CharField(max_length=255)),
('rating', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(5)])),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')),
],
options={
'abstract': False,
},
bases=('fedireads.status',),
bases=('bookwyrm.status',),
),
]

View file

@ -8,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0001_initial'),
('bookwyrm', '0001_initial'),
]
operations = [
@ -18,7 +18,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.TextField(blank=True, null=True)),
('created_date', models.DateTimeField(auto_now_add=True)),
('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Status')),
('status', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Status')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
options={
@ -28,11 +28,11 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='status',
name='favorites',
field=models.ManyToManyField(related_name='user_favorites', through='fedireads.Favorite', to=settings.AUTH_USER_MODEL),
field=models.ManyToManyField(related_name='user_favorites', through='bookwyrm.Favorite', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='user',
name='favorites',
field=models.ManyToManyField(related_name='favorite_statuses', through='fedireads.Favorite', to='fedireads.Status'),
field=models.ManyToManyField(related_name='favorite_statuses', through='bookwyrm.Favorite', to='bookwyrm.Status'),
),
]

View file

@ -7,7 +7,7 @@ import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0002_auto_20200219_0816'),
('bookwyrm', '0002_auto_20200219_0816'),
]
operations = [

View file

@ -8,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0003_auto_20200221_0131'),
('bookwyrm', '0003_auto_20200221_0131'),
]
operations = [
@ -19,7 +19,7 @@ class Migration(migrations.Migration):
('created_date', models.DateTimeField(auto_now_add=True)),
('updated_date', models.DateTimeField(auto_now=True)),
('name', models.CharField(max_length=140)),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
options={

View file

@ -5,7 +5,7 @@ from django.db import migrations, models
def populate_identifiers(app_registry, schema_editor):
db_alias = schema_editor.connection.alias
tags = app_registry.get_model('fedireads', 'Tag')
tags = app_registry.get_model('bookwyrm', 'Tag')
for tag in tags.objects.using(db_alias):
tag.identifier = re.sub(r'\W+', '-', tag.name).lower()
tag.save()
@ -14,7 +14,7 @@ def populate_identifiers(app_registry, schema_editor):
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0004_tag'),
('bookwyrm', '0004_tag'),
]
operations = [

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0005_auto_20200221_1645'),
('bookwyrm', '0005_auto_20200221_1645'),
]
operations = [

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0006_auto_20200221_1702'),
('bookwyrm', '0006_auto_20200221_1702'),
]
operations = [

View file

@ -7,13 +7,13 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0007_auto_20200223_0902'),
('bookwyrm', '0007_auto_20200223_0902'),
]
operations = [
migrations.AlterField(
model_name='user',
name='followers',
field=models.ManyToManyField(related_name='following', through='fedireads.UserRelationship', to=settings.AUTH_USER_MODEL),
field=models.ManyToManyField(related_name='following', through='bookwyrm.UserRelationship', to=settings.AUTH_USER_MODEL),
),
]

View file

@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0008_auto_20200224_1504'),
('bookwyrm', '0008_auto_20200224_1504'),
]
operations = [

View file

@ -3,21 +3,21 @@
import datetime
from django.db import migrations, models
import django.db.models.deletion
import fedireads.utils.fields
import bookwyrm.utils.fields
import uuid
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0009_status_published_date'),
('bookwyrm', '0009_status_published_date'),
]
operations = [
migrations.CreateModel(
name='Edition',
fields=[
('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Book')),
('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Book')),
('isbn', models.CharField(max_length=255, null=True, unique=True)),
('oclc_number', models.CharField(max_length=255, null=True, unique=True)),
('pages', models.IntegerField(null=True)),
@ -25,18 +25,18 @@ class Migration(migrations.Migration):
options={
'abstract': False,
},
bases=('fedireads.book',),
bases=('bookwyrm.book',),
),
migrations.CreateModel(
name='Work',
fields=[
('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Book')),
('book_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Book')),
('lccn', models.CharField(max_length=255, null=True, unique=True)),
],
options={
'abstract': False,
},
bases=('fedireads.book',),
bases=('bookwyrm.book',),
),
migrations.RemoveField(
model_name='author',
@ -53,7 +53,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='author',
name='aliases',
field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, size=None),
field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, size=None),
),
migrations.AddField(
model_name='author',
@ -129,7 +129,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='book',
name='misc_identifiers',
field=fedireads.utils.fields.JSONField(null=True),
field=bookwyrm.utils.fields.JSONField(null=True),
),
migrations.AddField(
model_name='book',
@ -185,6 +185,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='book',
name='parent_work',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Work'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Work'),
),
]

View file

@ -8,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0010_auto_20200307_0655'),
('bookwyrm', '0010_auto_20200307_0655'),
]
operations = [
@ -20,8 +20,8 @@ class Migration(migrations.Migration):
('updated_date', models.DateTimeField(auto_now=True)),
('read', models.BooleanField(default=False)),
('notification_type', models.CharField(max_length=255)),
('related_book', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')),
('related_status', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Status')),
('related_book', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')),
('related_status', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Status')),
('related_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='related_user', to=settings.AUTH_USER_MODEL)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],

View file

@ -1,19 +1,19 @@
# Generated by Django 3.0.3 on 2020-03-08 16:25
from django.db import migrations, models
import fedireads.utils.fields
import bookwyrm.utils.fields
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0011_notification'),
('bookwyrm', '0011_notification'),
]
operations = [
migrations.AlterField(
model_name='author',
name='aliases',
field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
),
]

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0012_auto_20200308_1625'),
('bookwyrm', '0012_auto_20200308_1625'),
]
operations = [

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0013_user_manually_approves_followers'),
('bookwyrm', '0013_user_manually_approves_followers'),
]
operations = [

View file

@ -8,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0014_status_remote_id'),
('bookwyrm', '0014_status_remote_id'),
]
operations = [
@ -88,17 +88,17 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='user',
name='blocks',
field=models.ManyToManyField(related_name='blocked_by', through='fedireads.UserBlocks', to=settings.AUTH_USER_MODEL),
field=models.ManyToManyField(related_name='blocked_by', through='bookwyrm.UserBlocks', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='user',
name='follow_requests',
field=models.ManyToManyField(related_name='follower_requests', through='fedireads.UserFollowRequest', to=settings.AUTH_USER_MODEL),
field=models.ManyToManyField(related_name='follower_requests', through='bookwyrm.UserFollowRequest', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='user',
name='following',
field=models.ManyToManyField(related_name='followers', through='fedireads.UserFollows', to=settings.AUTH_USER_MODEL),
field=models.ManyToManyField(related_name='followers', through='bookwyrm.UserFollows', to=settings.AUTH_USER_MODEL),
),
migrations.AddConstraint(
model_name='userfollows',

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0015_auto_20200311_1212'),
('bookwyrm', '0015_auto_20200311_1212'),
]
operations = [

View file

@ -7,7 +7,7 @@ import django.db.models.expressions
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0016_auto_20200313_1337'),
('bookwyrm', '0016_auto_20200313_1337'),
]
operations = [

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0017_auto_20200314_2152'),
('bookwyrm', '0017_auto_20200314_2152'),
]
operations = [

View file

@ -7,20 +7,20 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0018_favorite_remote_id'),
('bookwyrm', '0018_favorite_remote_id'),
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')),
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')),
('name', models.CharField(max_length=255)),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')),
],
options={
'abstract': False,
},
bases=('fedireads.status',),
bases=('bookwyrm.status',),
),
]

View file

@ -2,13 +2,13 @@
from django.db import migrations, models
import django.db.models.deletion
import fedireads.models.book
import bookwyrm.models.book
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0019_comment'),
('bookwyrm', '0019_comment'),
]
operations = [
@ -19,7 +19,7 @@ class Migration(migrations.Migration):
('created_date', models.DateTimeField(auto_now_add=True)),
('updated_date', models.DateTimeField(auto_now=True)),
('identifier', models.CharField(max_length=255, unique=True)),
('connector_file', models.CharField(choices=[('openlibrary', 'Openlibrary'), ('fedireads', 'Fedireads')], default='openlibrary', max_length=255)),
('connector_file', models.CharField(choices=[('openlibrary', 'Openlibrary'), ('bookwyrm', 'BookWyrm')], default='openlibrary', max_length=255)),
('is_self', models.BooleanField(default=False)),
('api_key', models.CharField(max_length=255, null=True)),
('base_url', models.CharField(max_length=255)),
@ -48,11 +48,11 @@ class Migration(migrations.Migration):
),
migrations.AddConstraint(
model_name='connector',
constraint=models.CheckConstraint(check=models.Q(connector_file__in=fedireads.models.connector.ConnectorFiles), name='connector_file_valid'),
constraint=models.CheckConstraint(check=models.Q(connector_file__in=bookwyrm.models.connector.ConnectorFiles), name='connector_file_valid'),
),
migrations.AddField(
model_name='book',
name='connector',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Connector'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Connector'),
),
]

View file

@ -1,13 +1,13 @@
# Generated by Django 3.0.3 on 2020-03-28 04:28
from django.db import migrations, models
import fedireads.utils.fields
import bookwyrm.utils.fields
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0020_auto_20200327_2335'),
('bookwyrm', '0020_auto_20200327_2335'),
]
operations = [
@ -19,12 +19,12 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='book',
name='subject_places',
field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
),
migrations.AddField(
model_name='book',
name='subjects',
field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
),
migrations.AddField(
model_name='edition',
@ -34,7 +34,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='edition',
name='publishers',
field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
),
migrations.AlterField(
model_name='connector',

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0021_auto_20200328_0428'),
('bookwyrm', '0021_auto_20200328_0428'),
]
operations = [

View file

@ -7,7 +7,7 @@ import uuid
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0022_auto_20200328_2001'),
('bookwyrm', '0022_auto_20200328_2001'),
]
operations = [

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0023_auto_20200328_2203'),
('bookwyrm', '0023_auto_20200328_2203'),
]
operations = [

View file

@ -7,7 +7,7 @@ import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0024_federatedserver_application_version'),
('bookwyrm', '0024_federatedserver_application_version'),
]
operations = [

View file

@ -7,19 +7,19 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0025_auto_20200330_0037'),
('bookwyrm', '0025_auto_20200330_0037'),
]
operations = [
migrations.CreateModel(
name='Boost',
fields=[
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')),
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')),
],
options={
'abstract': False,
},
bases=('fedireads.status',),
bases=('bookwyrm.status',),
),
migrations.RemoveConstraint(
model_name='notification',
@ -37,6 +37,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='boost',
name='boosted_status',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='boosters', to='fedireads.Status'),
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='boosters', to='bookwyrm.Status'),
),
]

View file

@ -2,13 +2,13 @@
from django.db import migrations, models
import django.db.models.deletion
import fedireads.utils.fields
import bookwyrm.utils.fields
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0026_auto_20200330_1456'),
('bookwyrm', '0026_auto_20200330_1456'),
]
operations = [
@ -27,7 +27,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='book',
name='languages',
field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
field=bookwyrm.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
),
migrations.AddField(
model_name='edition',
@ -37,46 +37,46 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='edition',
name='parent_work',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Work'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Work'),
),
migrations.AddField(
model_name='edition',
name='shelves',
field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Shelf'),
field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Shelf'),
),
migrations.AlterField(
model_name='comment',
name='book',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'),
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'),
),
migrations.AlterField(
model_name='notification',
name='related_book',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'),
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'),
),
migrations.AlterField(
model_name='review',
name='book',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'),
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'),
),
migrations.AlterField(
model_name='shelf',
name='books',
field=models.ManyToManyField(through='fedireads.ShelfBook', to='fedireads.Edition'),
field=models.ManyToManyField(through='bookwyrm.ShelfBook', to='bookwyrm.Edition'),
),
migrations.AlterField(
model_name='shelfbook',
name='book',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'),
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'),
),
migrations.AlterField(
model_name='status',
name='mention_books',
field=models.ManyToManyField(related_name='mention_book', to='fedireads.Edition'),
field=models.ManyToManyField(related_name='mention_book', to='bookwyrm.Edition'),
),
migrations.AlterField(
model_name='tag',
name='book',
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition'),
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition'),
),
]

View file

@ -7,7 +7,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0027_auto_20200330_2232'),
('bookwyrm', '0027_auto_20200330_2232'),
]
operations = [

View file

@ -6,7 +6,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0028_auto_20200401_1824'),
('bookwyrm', '0028_auto_20200401_1824'),
]
operations = [

View file

@ -7,20 +7,20 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0029_auto_20200403_1835'),
('bookwyrm', '0029_auto_20200403_1835'),
]
operations = [
migrations.CreateModel(
name='Quotation',
fields=[
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='fedireads.Status')),
('status_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='bookwyrm.Status')),
('quote', models.TextField()),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Edition')),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Edition')),
],
options={
'abstract': False,
},
bases=('fedireads.status',),
bases=('bookwyrm.status',),
),
]

View file

@ -8,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0030_quotation'),
('bookwyrm', '0030_quotation'),
]
operations = [
@ -21,7 +21,7 @@ class Migration(migrations.Migration):
('pages_read', models.IntegerField(blank=True, null=True)),
('start_date', models.DateTimeField(blank=True, null=True)),
('finish_date', models.DateTimeField(blank=True, null=True)),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='fedireads.Book')),
('book', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='bookwyrm.Book')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
],
options={

View file

@ -4,13 +4,13 @@ from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import fedireads.utils.fields
import bookwyrm.utils.fields
class Migration(migrations.Migration):
dependencies = [
('fedireads', '0031_readthrough'),
('bookwyrm', '0031_readthrough'),
]
operations = [
@ -18,7 +18,7 @@ class Migration(migrations.Migration):
name='ImportItem',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('data', fedireads.utils.fields.JSONField()),
('data', bookwyrm.utils.fields.JSONField()),
],
),
migrations.CreateModel(
@ -50,11 +50,11 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='importitem',
name='book',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='fedireads.Book'),
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bookwyrm.Book'),
),
migrations.AddField(
model_name='importitem',
name='job',