text: # -*- coding: utf-8 -*-
  # Generated by Django 1.10.2 on 2016-10-30 01:30
  from __future__ import unicode_literals
  
  import datetime
  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='Application',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created_on', models.DateField(default=datetime.datetime.now)),
                  ('accepted_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='application_accepted_by', to=settings.AUTH_USER_MODEL)),
                  ('applicant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='application_applicant', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'db_table': 'application',
                  'verbose_name': 'application',
                  'verbose_name_plural': 'applications',
              },
          ),
          migrations.CreateModel(
              name='Community',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=20, unique=True)),
                  ('description', models.TextField()),
                  ('tag', models.CharField(max_length=10)),
                  ('is_private', models.BooleanField(default=False)),
                  ('created_on', models.DateField(default=datetime.datetime.now)),
                  ('applications', models.ManyToManyField(related_name='community_applications', through='community.Application', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'db_table': 'community',
                  'verbose_name': 'community',
                  'verbose_name_plural': 'communities',
              },
          ),
          migrations.CreateModel(
              name='Invitation',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created_on', models.DateField(default=datetime.datetime.now)),
                  ('to_be_moderator', models.BooleanField(default=False)),
                  ('community', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.Community')),
                  ('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invitation_recipient', to=settings.AUTH_USER_MODEL)),
                  ('sender', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invitation_sender', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'db_table': 'invitation',
                  'verbose_name': 'invitation',
                  'verbose_name_plural': 'invitations',
              },
          ),
          migrations.CreateModel(
              name='Membership',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('joined_on', models.DateField(default=datetime.datetime.now)),
                  ('is_moderator', models.BooleanField(default=False)),
                  ('community', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.Community')),
                  ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'db_table': 'membership',
                  'verbose_name': 'membership',
                  'verbose_name_plural': 'memberships',
              },
          ),
          migrations.AddField(
              model_name='community',
              name='invitations',
              field=models.ManyToManyField(related_name='community_invitations', through='community.Invitation', to=settings.AUTH_USER_MODEL),
          ),
          migrations.AddField(
              model_name='community',
              name='members',
              field=models.ManyToManyField(related_name='community_members', through='community.Membership', to=settings.AUTH_USER_MODEL),
          ),
          migrations.AddField(
              model_name='application',
              name='community',
              field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.Community'),
          ),
      ]
  