# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-08-01 22:14
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Groups',
            fields=[
                ('id', models.CharField(default=b'ac4050a557384583bec1e77271175fc4', max_length=32, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=32)),
                ('metadata', models.TextField(default='{}')),
                ('create_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'groups',
            },
        ),
        migrations.CreateModel(
            name='Roles',
            fields=[
                ('name', models.CharField(max_length=32, primary_key=True, serialize=False)),
                ('metadata', models.TextField(default='{}')),
            ],
            options={
                'db_table': 'roles',
            },
        ),
        migrations.CreateModel(
            name='Tokens',
            fields=[
                ('id', models.CharField(default=b'a0941d953fb4409f983f3a8d9b37f3f6', max_length=32, primary_key=True, serialize=False)),
                ('token', models.TextField()),
            ],
            options={
                'db_table': 'tokens',
            },
        ),
        migrations.CreateModel(
            name='Users',
            fields=[
                ('id', models.CharField(default=b'16cc85d60e574177a3c59714959805cb', max_length=32, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=32)),
                ('password', models.CharField(max_length=256)),
                ('salt', models.CharField(max_length=16)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('metadata', models.TextField(default='{}')),
                ('create_at', models.DateTimeField(auto_now_add=True)),
                ('last_login', models.DateTimeField(blank=True, null=True)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Auth.Groups')),
            ],
            options={
                'db_table': 'users',
            },
        ),
        migrations.AddField(
            model_name='tokens',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Auth.Users'),
        ),
        migrations.AddField(
            model_name='groups',
            name='role',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Auth.Roles'),
        ),
    ]
