# Generated by Django 3.0.4 on 2020-07-21 19:50

import codeviewer.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('lang_code', models.CharField(max_length=100, unique=True)),
                ('slug', models.SlugField(max_length=100, unique=True)),
                ('mime', models.CharField(max_length=100)),
                ('file_extension', models.CharField(max_length=10)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_on', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('slug', models.CharField(max_length=100, unique=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Snippet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=100)),
                ('orig_code', models.TextField()),
                ('high_code', models.TextField(help_text='readonly field')),
                ('slug', models.SlugField(help_text='readonly field', max_length=100, unique=True)),
                ('expiration', models.CharField(choices=[('never', 'never'), ('1 month', '1 month'), ('6 months', '6 months'), ('1 year', '1 year')], max_length=10)),
                ('exposure', models.CharField(choices=[('private', 'private'), ('public', 'public'), ('unlisted', 'unlisted')], max_length=10)),
                ('hits', models.IntegerField(default=0, help_text='readonly field')),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('language', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='codeviewer.Language')),
                ('tag', models.ManyToManyField(blank=True, to='codeviewer.Tag')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_on'],
            },
        ),
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('default_exposure', models.CharField(choices=[('private', 'private'), ('public', 'public'), ('unlisted', 'unlisted')], default='public', max_length=10)),
                ('default_expiration', models.CharField(choices=[('never', 'never'), ('1 month', '1 month'), ('6 months', '6 months'), ('1 year', '1 year')], default='never', max_length=10)),
                ('private', models.BooleanField(default=False)),
                ('views', models.IntegerField(default=0)),
                ('default_language', models.ForeignKey(default=codeviewer.models.get_default_language, on_delete=django.db.models.deletion.CASCADE, to='codeviewer.Language')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
