# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-13 08:16
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='Cluster',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('clid', models.CharField(max_length=128, null=True)),
                ('name', models.CharField(max_length=256)),
                ('discovered', models.DateTimeField(editable=False)),
                ('updated', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='DataCenter',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('dcid', models.CharField(max_length=128, null=True)),
                ('name', models.CharField(max_length=256)),
                ('discovered', models.DateTimeField(editable=False)),
                ('updated', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Manager',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256)),
                ('fqdn', models.CharField(max_length=256)),
                ('url', models.CharField(max_length=512)),
                ('username', models.CharField(max_length=64)),
                ('password', models.CharField(max_length=64)),
                ('version', models.CharField(max_length=16)),
                ('discovered', models.DateTimeField(editable=False)),
                ('updated', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='StorageDomain',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('sdid', models.CharField(max_length=128)),
                ('name', models.CharField(max_length=256)),
                ('type', models.CharField(max_length=16)),
                ('status', models.CharField(max_length=16)),
            ],
        ),
        migrations.CreateModel(
            name='VM',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256)),
                ('vmid', models.CharField(max_length=128)),
                ('discovered', models.DateTimeField(editable=False)),
                ('updated', models.DateTimeField()),
                ('status', models.CharField(max_length=16)),
                ('protected', models.BooleanField(default=False)),
                ('last_backup', models.DateTimeField(null=True)),
                ('cluster', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='manager.Cluster')),
            ],
        ),
        migrations.CreateModel(
            name='VmBackups',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=256)),
                ('export', models.CharField(max_length=64)),
                ('status', models.IntegerField(default=3)),
                ('start', models.DateTimeField(null=True)),
                ('end', models.DateTimeField(null=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('size', models.IntegerField(default=0)),
                ('log', models.TextField(null=True)),
                ('vmid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='manager.VM')),
            ],
        ),
        migrations.AddField(
            model_name='datacenter',
            name='manager',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='manager.Manager'),
        ),
        migrations.AddField(
            model_name='cluster',
            name='dc',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='manager.DataCenter'),
        ),
    ]
