summaryrefslogtreecommitdiff
path: root/app/books/migrations/0001_initial.py
blob: d272b113bc54120ea8b33434040d368ae0dbca84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-02-08 10:41
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('author_name', models.CharField(max_length=200)),
                ('slug', models.CharField(max_length=50)),
                ('read_date', models.DateTimeField()),
                ('isbn', models.CharField(blank=True, max_length=100, null=True)),
                ('body_markdown', models.TextField(blank=True, null=True)),
                ('body_html', models.TextField(blank=True, null=True)),
                ('read_in', models.TextField(blank=True, null=True)),
                ('url', models.CharField(blank=True, max_length=200, null=True)),
                ('pages', models.CharField(blank=True, max_length=5, null=True)),
                ('publish_date', models.CharField(blank=True, max_length=40, null=True)),
                ('publish_place', models.CharField(blank=True, max_length=100, null=True)),
                ('openlib_url', models.CharField(blank=True, max_length=400, null=True)),
                ('rating', models.CharField(blank=True, choices=[('1', '1 Star'), ('2', '2 Stars'), ('3', '3 Stars'), ('4', '4 Stars'), ('5', '5 Stars')], max_length=1, null=True)),
                ('enable_comments', models.BooleanField(default=False)),
                ('image', models.FileField(blank=True, null=True, upload_to='/Users/sng/Sites/luxagraf/site/media/images/book-covers/')),
            ],
            options={
                'ordering': ('-read_date',),
            },
        ),
        migrations.CreateModel(
            name='BookHighlight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('page', models.PositiveSmallIntegerField(null=True)),
                ('location', models.CharField(blank=True, max_length=200, null=True)),
                ('date_added', models.DateTimeField()),
                ('body_markdown', models.TextField()),
            ],
            options={
                'ordering': ('-date_added',),
            },
        ),
        migrations.CreateModel(
            name='BookNote',
            fields=[
                ('bookhighlight_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='books.BookHighlight')),
            ],
            bases=('books.bookhighlight',),
        ),
        migrations.AddField(
            model_name='bookhighlight',
            name='book',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.Book'),
        ),
    ]