# Generated by Django 4.1.1 on 2022-09-20 05:05

import core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0006_alter_vessel_imo_alter_vessel_mmsi'),
    ]

    operations = [
        migrations.CreateModel(
            name='ReplicationFile',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('checksum', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='ReplicationSource',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('location', models.CharField(max_length=2048, validators=[core.validators.validate_directory])),
            ],
        ),
        migrations.CreateModel(
            name='ReplicationTarget',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('address', models.CharField(max_length=256)),
                ('username', models.CharField(blank=True, default='code', max_length=64, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ReplicationFileLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.replicationfile')),
                ('vessel', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.replicationtarget')),
            ],
        ),
        migrations.AddField(
            model_name='replicationfile',
            name='directory',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.replicationsource'),
        ),
    ]
