# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-12 05:04
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),
    ]

    operations = [
        migrations.CreateModel(
            name='FitbitTimeSeriesData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('value', models.CharField(default=None, max_length=32, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='FitbitTimeSeriesDataType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.IntegerField(choices=[(0, 'foods'), (1, 'activities'), (2, 'sleep'), (3, 'body')])),
                ('resource', models.CharField(max_length=128)),
            ],
            options={
                'ordering': ['category', 'resource'],
            },
        ),
        migrations.CreateModel(
            name='UserFitbit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fitbit_user', models.CharField(max_length=32, unique=True)),
                ('access_token', models.TextField()),
                ('refresh_token', models.TextField()),
                ('expires_at', models.FloatField()),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='fitbittimeseriesdatatype',
            unique_together=set([('category', 'resource')]),
        ),
        migrations.AddField(
            model_name='fitbittimeseriesdata',
            name='resource_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='fitbit.FitbitTimeSeriesDataType'),
        ),
        migrations.AddField(
            model_name='fitbittimeseriesdata',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='fitbittimeseriesdata',
            unique_together=set([('user', 'resource_type', 'date')]),
        ),
    ]
