From aa07749a478ca045f110783e577d78f1c55b8b78 Mon Sep 17 00:00:00 2001 From: Skia Date: Fri, 24 Feb 2017 03:15:10 +0100 Subject: [PATCH] Reset forum migrations --- forum/migrations/0001_initial.py | 53 +++++++++++++------ forum/migrations/0002_auto_20170128_1958.py | 22 -------- forum/migrations/0003_forum_owner_club.py | 20 ------- forum/migrations/0004_forumuserinfo.py | 26 --------- .../0005_forumuserinfo_read_messages.py | 19 ------- forum/migrations/0006_auto_20170128_2243.py | 25 --------- forum/migrations/0007_forummessagemeta.py | 27 ---------- 7 files changed, 37 insertions(+), 155 deletions(-) delete mode 100644 forum/migrations/0002_auto_20170128_1958.py delete mode 100644 forum/migrations/0003_forum_owner_club.py delete mode 100644 forum/migrations/0004_forumuserinfo.py delete mode 100644 forum/migrations/0005_forumuserinfo_read_messages.py delete mode 100644 forum/migrations/0006_auto_20170128_2243.py delete mode 100644 forum/migrations/0007_forummessagemeta.py diff --git a/forum/migrations/0001_initial.py b/forum/migrations/0001_initial.py index 4b53912e..5e5a499c 100644 --- a/forum/migrations/0001_initial.py +++ b/forum/migrations/0001_initial.py @@ -2,14 +2,17 @@ from __future__ import unicode_literals from django.db import migrations, models -import django.utils.timezone +from django.utils.timezone import utc from django.conf import settings +import django.utils.timezone +import datetime class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('club', '0006_auto_20161229_0040'), ('core', '0019_preferences_receive_weekmail'), ] @@ -17,35 +20,45 @@ class Migration(migrations.Migration): migrations.CreateModel( name='Forum', fields=[ - ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), - ('name', models.CharField(verbose_name='name', max_length=64)), - ('description', models.CharField(default='', verbose_name='description', max_length=256)), - ('is_category', models.BooleanField(default=False, verbose_name='is a category')), - ('edit_groups', models.ManyToManyField(default=[4], related_name='editable_forums', blank=True, to='core.Group')), - ('owner_group', models.ForeignKey(default=12, related_name='owned_forums', to='core.Group')), - ('parent', models.ForeignKey(null=True, related_name='children', blank=True, to='forum.Forum')), - ('view_groups', models.ManyToManyField(default=[2], related_name='viewable_forums', blank=True, to='core.Group')), + ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)), + ('name', models.CharField(max_length=64, verbose_name='name')), + ('description', models.CharField(max_length=256, verbose_name='description', default='')), + ('is_category', models.BooleanField(verbose_name='is a category', default=False)), + ('edit_groups', models.ManyToManyField(related_name='editable_forums', to='core.Group', blank=True, default=[4])), + ('owner_club', models.ForeignKey(to='club.Club', verbose_name='owner club', related_name='owned_forums', default=1)), + ('parent', models.ForeignKey(to='forum.Forum', null=True, related_name='children', blank=True)), + ('view_groups', models.ManyToManyField(related_name='viewable_forums', to='core.Group', blank=True, default=[2])), ], ), migrations.CreateModel( name='ForumMessage', fields=[ - ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), - ('title', models.CharField(default='', verbose_name='title', blank=True, max_length=64)), - ('message', models.TextField(default='', verbose_name='message')), - ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date')), + ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)), + ('title', models.CharField(max_length=64, blank=True, verbose_name='title', default='')), + ('message', models.TextField(verbose_name='message', default='')), + ('date', models.DateTimeField(verbose_name='date', default=django.utils.timezone.now)), ('author', models.ForeignKey(related_name='forum_messages', to=settings.AUTH_USER_MODEL)), + ('readers', models.ManyToManyField(to=settings.AUTH_USER_MODEL, verbose_name='readers', related_name='read_messages')), ], options={ 'ordering': ['id'], }, ), + migrations.CreateModel( + name='ForumMessageMeta', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)), + ('date', models.DateTimeField(verbose_name='date', default=django.utils.timezone.now)), + ('action', models.CharField(max_length=16, choices=[('EDIT', 'Message edited by'), ('DELETE', 'Message deleted by'), ('UNDELETE', 'Message undeleted by')], verbose_name='action')), + ('message', models.ForeignKey(related_name='metas', to='forum.ForumMessage')), + ('user', models.ForeignKey(related_name='forum_message_metas', to=settings.AUTH_USER_MODEL)), + ], + ), migrations.CreateModel( name='ForumTopic', fields=[ - ('id', models.AutoField(auto_created=True, serialize=False, verbose_name='ID', primary_key=True)), - ('title', models.CharField(default='', verbose_name='title', max_length=64)), - ('description', models.CharField(default='', verbose_name='description', max_length=256)), + ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)), + ('description', models.CharField(max_length=256, verbose_name='description', default='')), ('author', models.ForeignKey(related_name='forum_topics', to=settings.AUTH_USER_MODEL)), ('forum', models.ForeignKey(related_name='topics', to='forum.Forum')), ], @@ -53,6 +66,14 @@ class Migration(migrations.Migration): 'ordering': ['-id'], }, ), + migrations.CreateModel( + name='ForumUserInfo', + fields=[ + ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='ID', auto_created=True)), + ('last_read_date', models.DateTimeField(verbose_name='last read date', default=datetime.datetime(1999, 1, 1, 0, 0, tzinfo=utc))), + ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, related_name='_forum_infos')), + ], + ), migrations.AddField( model_name='forummessage', name='topic', diff --git a/forum/migrations/0002_auto_20170128_1958.py b/forum/migrations/0002_auto_20170128_1958.py deleted file mode 100644 index bfc0c90a..00000000 --- a/forum/migrations/0002_auto_20170128_1958.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('forum', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='forum', - name='owner_group', - ), - migrations.RemoveField( - model_name='forumtopic', - name='title', - ), - ] diff --git a/forum/migrations/0003_forum_owner_club.py b/forum/migrations/0003_forum_owner_club.py deleted file mode 100644 index e4a0510d..00000000 --- a/forum/migrations/0003_forum_owner_club.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('club', '0006_auto_20161229_0040'), - ('forum', '0002_auto_20170128_1958'), - ] - - operations = [ - migrations.AddField( - model_name='forum', - name='owner_club', - field=models.ForeignKey(related_name='owned_forums', verbose_name='owner club', to='club.Club', default=1), - ), - ] diff --git a/forum/migrations/0004_forumuserinfo.py b/forum/migrations/0004_forumuserinfo.py deleted file mode 100644 index 1c468201..00000000 --- a/forum/migrations/0004_forumuserinfo.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -from django.conf import settings -from django.utils.timezone import utc -import datetime - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('forum', '0003_forum_owner_club'), - ] - - operations = [ - migrations.CreateModel( - name='ForumUserInfo', - fields=[ - ('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)), - ('last_read_date', models.DateTimeField(verbose_name='last read date', default=datetime.datetime(1999, 1, 1, 0, 0, tzinfo=utc))), - ('user', models.OneToOneField(related_name='_forum_infos', to=settings.AUTH_USER_MODEL)), - ], - ), - ] diff --git a/forum/migrations/0005_forumuserinfo_read_messages.py b/forum/migrations/0005_forumuserinfo_read_messages.py deleted file mode 100644 index e0a23cfc..00000000 --- a/forum/migrations/0005_forumuserinfo_read_messages.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('forum', '0004_forumuserinfo'), - ] - - operations = [ - migrations.AddField( - model_name='forumuserinfo', - name='read_messages', - field=models.ManyToManyField(to='forum.ForumMessage', related_name='readers', verbose_name='read messages'), - ), - ] diff --git a/forum/migrations/0006_auto_20170128_2243.py b/forum/migrations/0006_auto_20170128_2243.py deleted file mode 100644 index ea9d17ec..00000000 --- a/forum/migrations/0006_auto_20170128_2243.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('forum', '0005_forumuserinfo_read_messages'), - ] - - operations = [ - migrations.RemoveField( - model_name='forumuserinfo', - name='read_messages', - ), - migrations.AddField( - model_name='forummessage', - name='readers', - field=models.ManyToManyField(to=settings.AUTH_USER_MODEL, related_name='read_messages', verbose_name='readers'), - ), - ] diff --git a/forum/migrations/0007_forummessagemeta.py b/forum/migrations/0007_forummessagemeta.py deleted file mode 100644 index 38e0ff25..00000000 --- a/forum/migrations/0007_forummessagemeta.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models -import django.utils.timezone -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ('forum', '0006_auto_20170128_2243'), - ] - - operations = [ - migrations.CreateModel( - name='ForumMessageMeta', - fields=[ - ('id', models.AutoField(verbose_name='ID', serialize=False, primary_key=True, auto_created=True)), - ('date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date')), - ('action', models.CharField(max_length=16, choices=[('EDIT', 'Edit'), ('DELETE', 'Delete'), ('UNDELETE', 'Undelete')], verbose_name='action')), - ('message', models.ForeignKey(related_name='metas', to='forum.ForumMessage')), - ('user', models.ForeignKey(related_name='forum_message_metas', to=settings.AUTH_USER_MODEL)), - ], - ), - ]