0001_initial.py 1.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Character',
            fields=[
                ('id', models.BigIntegerField(serialize=False, primary_key=True)),
                ('name', models.CharField(max_length=128)),
20 21
                ('alliance_id', models.BigIntegerField(null=True)),
                ('corporation_id', models.BigIntegerField(null=True)),
22 23
            ],
            options={
24 25
                'verbose_name': 'Character',
                'verbose_name_plural': 'Characters',
26 27 28 29 30 31
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='TESTOAuth2Data',
            fields=[
32 33
                ('user', models.OneToOneField(related_name='auth', primary_key=True, serialize=False,
                                              to=settings.AUTH_USER_MODEL, on_delete=django.db.models.deletion.CASCADE)),
34 35
                ('access_token', models.CharField(max_length=128)),
                ('refresh_token', models.CharField(max_length=128)),
36 37
                ('primary_character', models.ForeignKey(default=None, to='test_oauth.Character',
                                                        null=True, on_delete=django.db.models.deletion.SET_NULL)),
38 39
            ],
            options={
40 41
                'verbose_name': 'OAuth2 Token',
                'verbose_name_plural': 'OAuth2 Tokens',
42 43 44 45 46 47
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='character',
            name='auth',
48
            field=models.ManyToManyField(related_name='characters', to='test_oauth.TESTOAuth2Data', db_index=True),
49 50 51
            preserve_default=True,
        ),
    ]