bgneal@1028: # -*- coding: utf-8 -*- bgneal@1028: from __future__ import unicode_literals bgneal@1028: bgneal@1028: from django.db import migrations, models bgneal@1028: from django.conf import settings bgneal@1028: bgneal@1028: bgneal@1028: class Migration(migrations.Migration): bgneal@1028: bgneal@1028: dependencies = [ bgneal@1028: ('oembed', '__first__'), bgneal@1028: migrations.swappable_dependency(settings.AUTH_USER_MODEL), bgneal@1028: ('auth', '0006_require_contenttypes_0002'), bgneal@1028: ] bgneal@1028: bgneal@1028: operations = [ bgneal@1028: migrations.CreateModel( bgneal@1028: name='Attachment', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('order', models.IntegerField()), bgneal@1028: ('embed', models.ForeignKey(to='oembed.Oembed')), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('order',), bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='Category', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('name', models.CharField(max_length=80)), bgneal@1028: ('slug', models.SlugField(max_length=80)), bgneal@1028: ('position', models.IntegerField(default=0, blank=True)), bgneal@1028: ('groups', models.ManyToManyField(help_text=b'If groups are assigned to this category, only members of those groups can view this category.', to='auth.Group', null=True, blank=True)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('position',), bgneal@1028: 'verbose_name_plural': 'Categories', bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='FlaggedPost', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('flag_date', models.DateTimeField(auto_now_add=True)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('flag_date',), bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='Forum', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('name', models.CharField(max_length=80)), bgneal@1028: ('slug', models.SlugField(max_length=80)), bgneal@1028: ('description', models.TextField(default=b'', blank=True)), bgneal@1028: ('position', models.IntegerField(default=0, blank=True)), bgneal@1028: ('topic_count', models.IntegerField(default=0, blank=True)), bgneal@1028: ('post_count', models.IntegerField(default=0, blank=True)), bgneal@1028: ('category', models.ForeignKey(related_name='forums', to='forums.Category')), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('position',), bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='ForumLastVisit', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('begin_date', models.DateTimeField()), bgneal@1028: ('end_date', models.DateTimeField()), bgneal@1028: ('forum', models.ForeignKey(to='forums.Forum')), bgneal@1028: ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('-end_date',), bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='Post', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('creation_date', models.DateTimeField(db_index=True)), bgneal@1028: ('update_date', models.DateTimeField(db_index=True)), bgneal@1028: ('body', models.TextField()), bgneal@1028: ('html', models.TextField()), bgneal@1028: ('user_ip', models.IPAddressField(default=b'', null=True, blank=True)), bgneal@1028: ('attachments', models.ManyToManyField(to='oembed.Oembed', through='forums.Attachment')), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('creation_date',), bgneal@1028: 'get_latest_by': 'creation_date', bgneal@1028: 'verbose_name': 'forum post', bgneal@1028: 'verbose_name_plural': 'forum posts', bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='Topic', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('name', models.CharField(max_length=255)), bgneal@1028: ('creation_date', models.DateTimeField(db_index=True)), bgneal@1028: ('view_count', models.IntegerField(default=0, blank=True)), bgneal@1028: ('sticky', models.BooleanField(default=False)), bgneal@1028: ('locked', models.BooleanField(default=False)), bgneal@1028: ('post_count', models.IntegerField(default=0, blank=True)), bgneal@1028: ('update_date', models.DateTimeField(db_index=True)), bgneal@1028: ('bookmarkers', models.ManyToManyField(related_name='favorite_topics', verbose_name=b'bookmarkers', to=settings.AUTH_USER_MODEL, blank=True)), bgneal@1028: ('forum', models.ForeignKey(related_name='topics', to='forums.Forum')), bgneal@1028: ('last_post', models.OneToOneField(related_name='parent_topic', null=True, blank=True, to='forums.Post')), bgneal@1028: ('subscribers', models.ManyToManyField(related_name='subscriptions', verbose_name=b'subscribers', to=settings.AUTH_USER_MODEL, blank=True)), bgneal@1028: ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('-sticky', '-update_date'), bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='TopicLastVisit', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('last_visit', models.DateTimeField(db_index=True)), bgneal@1028: ('topic', models.ForeignKey(to='forums.Topic')), bgneal@1028: ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('-last_visit',), bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.AddField( bgneal@1028: model_name='post', bgneal@1028: name='topic', bgneal@1028: field=models.ForeignKey(related_name='posts', to='forums.Topic'), bgneal@1028: ), bgneal@1028: migrations.AddField( bgneal@1028: model_name='post', bgneal@1028: name='user', bgneal@1028: field=models.ForeignKey(related_name='posts', to=settings.AUTH_USER_MODEL), bgneal@1028: ), bgneal@1028: migrations.AddField( bgneal@1028: model_name='forum', bgneal@1028: name='last_post', bgneal@1028: field=models.OneToOneField(related_name='parent_forum', null=True, blank=True, to='forums.Post'), bgneal@1028: ), bgneal@1028: migrations.AddField( bgneal@1028: model_name='forum', bgneal@1028: name='moderators', bgneal@1028: field=models.ManyToManyField(to='auth.Group', null=True, blank=True), bgneal@1028: ), bgneal@1028: migrations.AddField( bgneal@1028: model_name='flaggedpost', bgneal@1028: name='post', bgneal@1028: field=models.ForeignKey(to='forums.Post'), bgneal@1028: ), bgneal@1028: migrations.AddField( bgneal@1028: model_name='flaggedpost', bgneal@1028: name='user', bgneal@1028: field=models.ForeignKey(to=settings.AUTH_USER_MODEL), bgneal@1028: ), bgneal@1028: migrations.AddField( bgneal@1028: model_name='attachment', bgneal@1028: name='post', bgneal@1028: field=models.ForeignKey(to='forums.Post'), bgneal@1028: ), bgneal@1028: migrations.AlterUniqueTogether( bgneal@1028: name='topiclastvisit', bgneal@1028: unique_together=set([('user', 'topic')]), bgneal@1028: ), bgneal@1028: migrations.AlterUniqueTogether( bgneal@1028: name='forumlastvisit', bgneal@1028: unique_together=set([('user', 'forum')]), bgneal@1028: ), bgneal@1028: ]