aboutsummaryrefslogtreecommitdiff
path: root/apps/notes/migrations/0001_initial.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/notes/migrations/0001_initial.py')
-rw-r--r--apps/notes/migrations/0001_initial.py78
1 files changed, 70 insertions, 8 deletions
diff --git a/apps/notes/migrations/0001_initial.py b/apps/notes/migrations/0001_initial.py
index f8e2fff..d2bb58e 100644
--- a/apps/notes/migrations/0001_initial.py
+++ b/apps/notes/migrations/0001_initial.py
@@ -1,9 +1,10 @@
-# Generated by Django 2.1.2 on 2018-11-24 13:55
+# Generated by Django 2.1.2 on 2019-05-02 14:30
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
+import django.db.models.manager
import taggit.managers
import uuid
@@ -13,12 +14,39 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
- ('taggit', '0002_auto_20150616_2121'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateModel(
+ name='Annotation',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('unique_id', models.UUIDField(default=uuid.uuid4, editable=False)),
+ ('date_created', models.DateTimeField(auto_now_add=True)),
+ ('date_updated', models.DateTimeField(auto_now=True)),
+ ('highlight_text', models.TextField(blank=True)),
+ ('body_text', models.TextField(blank=True)),
+ ('body_html', models.TextField(blank=True)),
+ ('body_qjson', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
+ ('is_public', models.BooleanField(default=False)),
+ ],
+ ),
+ migrations.CreateModel(
+ name='LuxTag',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('name', models.CharField(max_length=100, unique=True, verbose_name='Name')),
+ ('slug', models.SlugField(max_length=100, unique=True, verbose_name='Slug')),
+ ('color_rgb', models.CharField(blank=True, max_length=20)),
+ ],
+ options={
+ 'verbose_name_plural': 'Tags',
+ 'verbose_name': 'Tag',
+ },
+ ),
+ migrations.CreateModel(
name='Note',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
@@ -26,13 +54,19 @@ class Migration(migrations.Migration):
('date_created', models.DateTimeField(auto_now_add=True)),
('date_updated', models.DateTimeField(auto_now=True)),
('title', models.CharField(max_length=250)),
- ('body_text', models.TextField(null=True)),
- ('body_html', models.TextField(blank=True, null=True)),
+ ('body_text', models.TextField(blank=True)),
+ ('body_html', models.TextField(blank=True)),
('body_qjson', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
- ('url', models.CharField(blank=True, max_length=250, null=True)),
+ ('url', models.CharField(blank=True, max_length=250)),
('slug', models.SlugField(blank=True)),
('is_public', models.BooleanField(default=False)),
],
+ options={
+ 'ordering': ('-date_created', '-date_updated'),
+ },
+ managers=[
+ ('include_trash', django.db.models.manager.Manager()),
+ ],
),
migrations.CreateModel(
name='Notebook',
@@ -40,12 +74,30 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('unique_id', models.UUIDField(default=uuid.uuid4, editable=False)),
('name', models.CharField(max_length=250)),
- ('url', models.CharField(blank=True, max_length=250, null=True)),
+ ('color_rgb', models.CharField(blank=True, max_length=20)),
('slug', models.SlugField(blank=True)),
('date_created', models.DateTimeField(auto_now_add=True)),
('date_updated', models.DateTimeField(auto_now=True)),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
+ options={
+ 'ordering': ('name', 'date_created', 'date_updated'),
+ },
+ managers=[
+ ('include_trash', django.db.models.manager.Manager()),
+ ],
+ ),
+ migrations.CreateModel(
+ name='TaggedNotes',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('object_id', models.IntegerField(db_index=True, verbose_name='Object id')),
+ ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notes_taggednotes_tagged_items', to='contenttypes.ContentType', verbose_name='Content type')),
+ ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notes_taggednotes_items', to='notes.LuxTag')),
+ ],
+ options={
+ 'abstract': False,
+ },
),
migrations.AddField(
model_name='note',
@@ -60,11 +112,21 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='note',
name='tags',
- field=taggit.managers.TaggableManager(blank=True, help_text='Tags', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
+ field=taggit.managers.TaggableManager(blank=True, help_text='Tags', through='notes.TaggedNotes', to='notes.LuxTag', verbose_name='Tags'),
+ ),
+ migrations.AddField(
+ model_name='annotation',
+ name='note',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='notes.Note'),
+ ),
+ migrations.AddField(
+ model_name='annotation',
+ name='owner',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
migrations.AlterUniqueTogether(
name='notebook',
- unique_together={('owner', 'slug')},
+ unique_together={('owner', 'name')},
),
migrations.AlterUniqueTogether(
name='note',