@@ 1,27 1,30 @@
-import django.db.models.deletion
-import mptt.fields
+# Generated by Django 2.2.5 on 2019-10-09 21:12
+
from django.conf import settings
from django.db import migrations, models
-from django.db.models.fields import GenericIPAddressField as IPAddressField
-from wiki.conf.settings import GROUP_MODEL
+import django.db.models.deletion
+import mptt.fields
class Migration(migrations.Migration):
+ initial = True
+
dependencies = [
- ('sites', '0001_initial'),
+ ('contenttypes', '0002_remove_content_type_name'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
- ('contenttypes', '0001_initial'),
- ('auth', '0001_initial'),
+ ('grinch', '0002_auto_20191010_0512'),
+ ('sites', '0002_alter_domain_unique'),
+ ('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
- ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
- ('created', models.DateTimeField(verbose_name='created', auto_now_add=True)),
- ('modified', models.DateTimeField(verbose_name='modified', auto_now=True, help_text='Article properties last modified')),
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
+ ('modified', models.DateTimeField(auto_now=True, help_text='Article properties last modified', verbose_name='modified')),
('group_read', models.BooleanField(default=True, verbose_name='group read access')),
('group_write', models.BooleanField(default=True, verbose_name='group write access')),
('other_read', models.BooleanField(default=True, verbose_name='others read access')),
@@ 30,168 33,142 @@ class Migration(migrations.Migration):
options={
'permissions': (('moderate', 'Can edit all articles and lock/unlock/restore'), ('assign', 'Can change ownership of any article'), ('grant', 'Can assign permissions to other users')),
},
- bases=(models.Model,),
),
migrations.CreateModel(
- name='ArticleForObject',
+ name='ArticlePlugin',
fields=[
- ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
- ('object_id', models.PositiveIntegerField(verbose_name='object ID')),
- ('is_mptt', models.BooleanField(default=False, editable=False)),
- ('article', models.ForeignKey(to='wiki.Article', on_delete=models.CASCADE)),
- ('content_type', models.ForeignKey(related_name='content_type_set_for_articleforobject', verbose_name='content type', to='contenttypes.ContentType', on_delete=models.CASCADE)),
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('deleted', models.BooleanField(default=False)),
+ ('created', models.DateTimeField(auto_now_add=True)),
+ ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wiki.Article', verbose_name='article')),
],
- options={
- 'verbose_name_plural': 'Articles for object',
- 'verbose_name': 'Article for object',
- },
- bases=(models.Model,),
),
migrations.CreateModel(
- name='ArticlePlugin',
+ name='RevisionPlugin',
fields=[
- ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
- ('deleted', models.BooleanField(default=False)),
- ('created', models.DateTimeField(auto_now_add=True)),
+ ('articleplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wiki.ArticlePlugin')),
],
- options={
- },
- bases=(models.Model,),
+ bases=('wiki.articleplugin',),
),
migrations.CreateModel(
name='ArticleRevision',
fields=[
- ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
- ('revision_number', models.IntegerField(verbose_name='revision number', editable=False)),
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('revision_number', models.IntegerField(editable=False, verbose_name='revision number')),
('user_message', models.TextField(blank=True)),
('automatic_log', models.TextField(blank=True, editable=False)),
- ('ip_address', IPAddressField(null=True, verbose_name='IP address', blank=True, editable=False)),
+ ('ip_address', models.GenericIPAddressField(blank=True, editable=False, null=True, verbose_name='IP address')),
('modified', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)),
('deleted', models.BooleanField(default=False, verbose_name='deleted')),
('locked', models.BooleanField(default=False, verbose_name='locked')),
('content', models.TextField(blank=True, verbose_name='article contents')),
- ('title', models.CharField(max_length=512, verbose_name='article title', help_text='Each revision contains a title field that must be filled out, even if the title has not changed')),
- ('article', models.ForeignKey(to='wiki.Article', verbose_name='article', on_delete=models.CASCADE)),
- ('previous_revision', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wiki.ArticleRevision')),
- ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, blank=True, to=settings.AUTH_USER_MODEL, verbose_name='user')),
+ ('title', models.CharField(help_text='Each revision contains a title field that must be filled out, even if the title has not changed', max_length=512, verbose_name='article title')),
+ ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wiki.Article', verbose_name='article')),
+ ('previous_revision', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='wiki.ArticleRevision')),
+ ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
],
options={
- 'get_latest_by': 'revision_number',
'ordering': ('created',),
+ 'get_latest_by': 'revision_number',
+ 'unique_together': {('article', 'revision_number')},
},
- bases=(models.Model,),
+ ),
+ migrations.AddField(
+ model_name='article',
+ name='current_revision',
+ field=models.OneToOneField(blank=True, help_text='The revision being displayed for this article. If you need to do a roll-back, simply change the value of this field.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='current_set', to='wiki.ArticleRevision', verbose_name='current revision'),
+ ),
+ migrations.AddField(
+ model_name='article',
+ name='group',
+ field=models.ForeignKey(blank=True, help_text='Like in a UNIX file system, permissions can be given to a user according to group membership. Groups are handled through the Django auth system.', null=True, on_delete=django.db.models.deletion.SET_NULL, to='auth.Group', verbose_name='group'),
+ ),
+ migrations.AddField(
+ model_name='article',
+ name='organization',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='articles', to='grinch.Organization'),
+ ),
+ migrations.AddField(
+ model_name='article',
+ name='owner',
+ field=models.ForeignKey(blank=True, help_text='The owner of the article, usually the creator. The owner always has both read and write access.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='owned_articles', to=settings.AUTH_USER_MODEL, verbose_name='owner'),
),
migrations.CreateModel(
- name='ReusablePlugin',
+ name='URLPath',
fields=[
- ('articleplugin_ptr', models.OneToOneField(primary_key=True, parent_link=True, to='wiki.ArticlePlugin', serialize=False, auto_created=True, on_delete=models.CASCADE)),
- ('articles', models.ManyToManyField(related_name='shared_plugins_set', to='wiki.Article')),
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('slug', models.SlugField(blank=True, null=True, verbose_name='slug')),
+ ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
+ ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
+ ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
+ ('level', models.PositiveIntegerField(db_index=True, editable=False)),
+ ('article', models.ForeignKey(help_text='This field is automatically updated, but you need to populate it when creating a new URL path.', on_delete=django.db.models.deletion.CASCADE, to='wiki.Article', verbose_name='article')),
+ ('moved_to', mptt.fields.TreeForeignKey(blank=True, help_text='Article path was moved to this location', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='moved_from', to='wiki.URLPath', verbose_name='Moved to')),
+ ('parent', mptt.fields.TreeForeignKey(blank=True, help_text='Position of URL path in the tree.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='wiki.URLPath')),
+ ('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
],
options={
+ 'verbose_name': 'URL path',
+ 'verbose_name_plural': 'URL paths',
+ 'unique_together': {('site', 'parent', 'slug')},
},
- bases=('wiki.articleplugin',),
),
migrations.CreateModel(
- name='RevisionPlugin',
+ name='SimplePlugin',
fields=[
- ('articleplugin_ptr', models.OneToOneField(primary_key=True, parent_link=True, to='wiki.ArticlePlugin', serialize=False, auto_created=True, on_delete=models.CASCADE)),
+ ('articleplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wiki.ArticlePlugin')),
+ ('article_revision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wiki.ArticleRevision')),
],
- options={
- },
bases=('wiki.articleplugin',),
),
migrations.CreateModel(
name='RevisionPluginRevision',
fields=[
- ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
- ('revision_number', models.IntegerField(verbose_name='revision number', editable=False)),
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('revision_number', models.IntegerField(editable=False, verbose_name='revision number')),
('user_message', models.TextField(blank=True)),
('automatic_log', models.TextField(blank=True, editable=False)),
- ('ip_address', IPAddressField(null=True, verbose_name='IP address', blank=True, editable=False)),
+ ('ip_address', models.GenericIPAddressField(blank=True, editable=False, null=True, verbose_name='IP address')),
('modified', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)),
('deleted', models.BooleanField(default=False, verbose_name='deleted')),
('locked', models.BooleanField(default=False, verbose_name='locked')),
- ('plugin', models.ForeignKey(related_name='revision_set', to='wiki.RevisionPlugin', on_delete=models.CASCADE)),
- ('previous_revision', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, blank=True, to='wiki.RevisionPluginRevision')),
- ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, blank=True, to=settings.AUTH_USER_MODEL, verbose_name='user')),
+ ('previous_revision', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='wiki.RevisionPluginRevision')),
+ ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
+ ('plugin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='revision_set', to='wiki.RevisionPlugin')),
],
options={
- 'get_latest_by': 'revision_number',
'ordering': ('-created',),
+ 'get_latest_by': 'revision_number',
},
- bases=(models.Model,),
+ ),
+ migrations.AddField(
+ model_name='revisionplugin',
+ name='current_revision',
+ field=models.OneToOneField(blank=True, help_text='The revision being displayed for this plugin. If you need to do a roll-back, simply change the value of this field.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='plugin_set', to='wiki.RevisionPluginRevision', verbose_name='current revision'),
),
migrations.CreateModel(
- name='SimplePlugin',
+ name='ReusablePlugin',
fields=[
- ('articleplugin_ptr', models.OneToOneField(primary_key=True, parent_link=True, to='wiki.ArticlePlugin', serialize=False, auto_created=True, on_delete=models.CASCADE)),
- ('article_revision', models.ForeignKey(to='wiki.ArticleRevision', on_delete=models.CASCADE)),
+ ('articleplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wiki.ArticlePlugin')),
+ ('articles', models.ManyToManyField(related_name='shared_plugins_set', to='wiki.Article')),
],
- options={
- },
bases=('wiki.articleplugin',),
),
migrations.CreateModel(
- name='URLPath',
+ name='ArticleForObject',
fields=[
- ('id', models.AutoField(serialize=False, primary_key=True, auto_created=True, verbose_name='ID')),
- ('slug', models.SlugField(null=True, blank=True, verbose_name='slug')),
- ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
- ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
- ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
- ('level', models.PositiveIntegerField(db_index=True, editable=False)),
- ('article', models.ForeignKey(help_text='This field is automatically updated, but you need to populate it when creating a new URL path.', on_delete=django.db.models.deletion.CASCADE, to='wiki.Article', verbose_name='article')),
- ('parent', mptt.fields.TreeForeignKey(blank=True, help_text='Position of URL path in the tree.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='wiki.URLPath')),
- ('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sites.Site')),
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('object_id', models.PositiveIntegerField(verbose_name='object ID')),
+ ('is_mptt', models.BooleanField(default=False, editable=False)),
+ ('article', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wiki.Article')),
+ ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='content_type_set_for_articleforobject', to='contenttypes.ContentType', verbose_name='content type')),
],
options={
- 'verbose_name_plural': 'URL paths',
- 'verbose_name': 'URL path',
+ 'verbose_name': 'Article for object',
+ 'verbose_name_plural': 'Articles for object',
+ 'unique_together': {('content_type', 'object_id')},
},
- bases=(models.Model,),
- ),
- migrations.AlterUniqueTogether(
- name='urlpath',
- unique_together=set([('site', 'parent', 'slug')]),
- ),
- migrations.AddField(
- model_name='revisionplugin',
- name='current_revision',
- field=models.OneToOneField(related_name='plugin_set', null=True, help_text='The revision being displayed for this plugin. If you need to do a roll-back, simply change the value of this field.', blank=True, to='wiki.RevisionPluginRevision', verbose_name='current revision', on_delete=models.CASCADE),
- preserve_default=True,
- ),
- migrations.AlterUniqueTogether(
- name='articlerevision',
- unique_together=set([('article', 'revision_number')]),
- ),
- migrations.AddField(
- model_name='articleplugin',
- name='article',
- field=models.ForeignKey(to='wiki.Article', verbose_name='article', on_delete=models.CASCADE),
- preserve_default=True,
- ),
- migrations.AlterUniqueTogether(
- name='articleforobject',
- unique_together=set([('content_type', 'object_id')]),
- ),
- migrations.AddField(
- model_name='article',
- name='current_revision',
- field=models.OneToOneField(related_name='current_set', null=True, help_text='The revision being displayed for this article. If you need to do a roll-back, simply change the value of this field.', blank=True, to='wiki.ArticleRevision', verbose_name='current revision', on_delete=models.CASCADE),
- preserve_default=True,
- ),
- migrations.AddField(
- model_name='article',
- name='group',
- field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, help_text='Like in a UNIX file system, permissions can be given to a user according to group membership. Groups are handled through the Django auth system.', blank=True, to=GROUP_MODEL, verbose_name='group'),
- preserve_default=True,
- ),
- migrations.AddField(
- model_name='article',
- name='owner',
- field=models.ForeignKey(related_name='owned_articles', null=True, on_delete=django.db.models.deletion.SET_NULL, help_text='The owner of the article, usually the creator. The owner always has both read and write access.', blank=True, to=settings.AUTH_USER_MODEL, verbose_name='owner'),
- preserve_default=True,
),
]
@@ 1,12 1,15 @@
-import django.db.models.deletion
-import wiki.plugins.attachments.models
+# Generated by Django 2.2.5 on 2019-10-09 21:12
+
from django.conf import settings
from django.db import migrations, models
-from django.db.models.fields import GenericIPAddressField as IPAddressField
+import django.db.models.deletion
+import wiki.plugins.attachments.models
class Migration(migrations.Migration):
+ initial = True
+
dependencies = [
('wiki', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
@@ 16,45 19,46 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Attachment',
fields=[
- ('reusableplugin_ptr', models.OneToOneField(parent_link=True, serialize=False, primary_key=True, to='wiki.ReusablePlugin', auto_created=True, on_delete=models.CASCADE)),
- ('original_filename', models.CharField(max_length=256, verbose_name='original filename', blank=True, null=True)),
+ ('reusableplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wiki.ReusablePlugin')),
+ ('original_filename', models.CharField(blank=True, max_length=256, null=True, verbose_name='original filename')),
],
options={
'verbose_name': 'attachment',
'verbose_name_plural': 'attachments',
+ 'db_table': 'wiki_attachments_attachment',
},
bases=('wiki.reusableplugin',),
),
migrations.CreateModel(
name='AttachmentRevision',
fields=[
- ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
- ('revision_number', models.IntegerField(verbose_name='revision number', editable=False)),
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('revision_number', models.IntegerField(editable=False, verbose_name='revision number')),
('user_message', models.TextField(blank=True)),
- ('automatic_log', models.TextField(editable=False, blank=True)),
- ('ip_address', IPAddressField(editable=False, verbose_name='IP address', blank=True, null=True)),
+ ('automatic_log', models.TextField(blank=True, editable=False)),
+ ('ip_address', models.GenericIPAddressField(blank=True, editable=False, null=True, verbose_name='IP address')),
('modified', models.DateTimeField(auto_now=True)),
('created', models.DateTimeField(auto_now_add=True)),
('deleted', models.BooleanField(default=False, verbose_name='deleted')),
('locked', models.BooleanField(default=False, verbose_name='locked')),
- ('file', models.FileField(max_length=255, verbose_name='file', upload_to=wiki.plugins.attachments.models.upload_path)),
+ ('file', models.FileField(max_length=255, upload_to=wiki.plugins.attachments.models.upload_path, verbose_name='file')),
('description', models.TextField(blank=True)),
- ('attachment', models.ForeignKey(to='wiki_attachments.Attachment', on_delete=models.CASCADE)),
- ('previous_revision', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.SET_NULL, to='wiki_attachments.AttachmentRevision', null=True)),
- ('user', models.ForeignKey(blank=True, verbose_name='user', on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, null=True)),
+ ('attachment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wiki_attachments.Attachment')),
+ ('previous_revision', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='wiki_attachments.AttachmentRevision')),
+ ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='user')),
],
options={
- 'ordering': ('created',),
- 'get_latest_by': 'revision_number',
'verbose_name': 'attachment revision',
'verbose_name_plural': 'attachment revisions',
+ 'db_table': 'wiki_attachments_attachmentrevision',
+ 'ordering': ('created',),
+ 'get_latest_by': 'revision_number',
},
- bases=(models.Model,),
),
migrations.AddField(
model_name='attachment',
name='current_revision',
- field=models.OneToOneField(to='wiki_attachments.AttachmentRevision', blank=True, verbose_name='current revision', related_name='current_set', help_text='The revision of this attachment currently in use (on all articles using the attachment)', null=True, on_delete=models.CASCADE),
- preserve_default=True,
+ field=models.OneToOneField(blank=True, help_text='The revision of this attachment currently in use (on all articles using the attachment)', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='current_set', to='wiki_attachments.AttachmentRevision', verbose_name='current revision'),
),
]
+