bgneal@1028: # -*- coding: utf-8 -*- bgneal@1028: from __future__ import unicode_literals bgneal@1028: bgneal@1028: from django.db import migrations, models bgneal@1028: import downloads.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: migrations.swappable_dependency(settings.AUTH_USER_MODEL), bgneal@1028: ] bgneal@1028: bgneal@1028: operations = [ bgneal@1028: migrations.CreateModel( bgneal@1028: name='AllowedExtension', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('extension', models.CharField(help_text=b'e.g. .txt', max_length=8)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('extension',), 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: ('title', models.CharField(max_length=64)), bgneal@1028: ('slug', models.SlugField(max_length=64)), bgneal@1028: ('description', models.TextField(blank=True)), bgneal@1028: ('count', models.IntegerField(default=0, blank=True)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('title',), bgneal@1028: 'verbose_name_plural': 'Categories', bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='Download', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('title', models.CharField(max_length=128)), bgneal@1028: ('description', models.TextField()), bgneal@1028: ('html', models.TextField(blank=True)), bgneal@1028: ('file', models.FileField(upload_to=downloads.models.download_path)), bgneal@1028: ('date_added', models.DateTimeField(db_index=True)), bgneal@1028: ('ip_address', models.IPAddressField(verbose_name=b'IP Address')), bgneal@1028: ('update_date', models.DateTimeField(db_index=True, blank=True)), bgneal@1028: ('hits', models.IntegerField(default=0)), bgneal@1028: ('average_score', models.FloatField(default=0.0)), bgneal@1028: ('total_votes', models.IntegerField(default=0)), bgneal@1028: ('is_public', models.BooleanField(default=False, db_index=True)), bgneal@1028: ('category', models.ForeignKey(to='downloads.Category')), bgneal@1028: ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'abstract': False, bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='PendingDownload', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('title', models.CharField(max_length=128)), bgneal@1028: ('description', models.TextField()), bgneal@1028: ('html', models.TextField(blank=True)), bgneal@1028: ('file', models.FileField(upload_to=downloads.models.download_path)), bgneal@1028: ('date_added', models.DateTimeField(db_index=True)), bgneal@1028: ('ip_address', models.IPAddressField(verbose_name=b'IP Address')), bgneal@1028: ('update_date', models.DateTimeField(db_index=True, blank=True)), bgneal@1028: ('category', models.ForeignKey(to='downloads.Category')), bgneal@1028: ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('date_added',), bgneal@1028: }, bgneal@1028: ), bgneal@1028: migrations.CreateModel( bgneal@1028: name='VoteRecord', bgneal@1028: fields=[ bgneal@1028: ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), bgneal@1028: ('vote_date', models.DateTimeField(auto_now_add=True)), bgneal@1028: ('download', models.ForeignKey(to='downloads.Download')), bgneal@1028: ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), bgneal@1028: ], bgneal@1028: options={ bgneal@1028: 'ordering': ('-vote_date',), bgneal@1028: }, bgneal@1028: ), bgneal@1028: ]