Cloud-CV/EvalAI

View on GitHub
apps/participants/migrations/0001_initial.py

Summary

Maintainability
A
40 mins
Test Coverage
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-28 04:11
from __future__ import unicode_literals

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),
        ("challenges", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Participant",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("modified_at", models.DateTimeField(auto_now=True)),
                (
                    "challenge",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="participants",
                        to="challenges.Challenge",
                    ),
                ),
            ],
            options={"db_table": "participant"},
        ),
        migrations.CreateModel(
            name="ParticipantStatus",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("modified_at", models.DateTimeField(auto_now=True)),
                ("status", models.CharField(max_length=30, unique=True)),
            ],
            options={"db_table": "participant_status"},
        ),
        migrations.AddField(
            model_name="participant",
            name="status",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to="participants.ParticipantStatus",
            ),
        ),
        migrations.AddField(
            model_name="participant",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="participation",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
    ]