# Generated by Django 3.2.7 on 2021-09-10 08:31

from django.conf import settings
import django.contrib.gis.db.models.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('core', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Grid',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('number_of_tiles_per_side', models.PositiveIntegerField(default=6, validators=[django.core.validators.MinValueValidator(6), django.core.validators.MaxValueValidator(64)])),
                ('center_point', django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('tile_size', models.FloatField(default=0.001)),
                ('status', models.CharField(choices=[('OPENED', 'Opened'), ('CLOSED', 'Closed')], default='OPENED', max_length=12)),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('last_updated_at', models.DateTimeField(auto_now=True)),
                ('registered_users', models.ManyToManyField(related_name='registered_grids', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Tile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('points', django.contrib.gis.db.models.fields.PolygonField(srid=4326)),
                ('grid_position', models.PositiveIntegerField()),
                ('status', models.IntegerField(choices=[(1, 'Locked'), (0, 'Unlocked')], default=0)),
                ('activity_related', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.activity')),
                ('grid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tiles', to='map.grid')),
            ],
        ),
    ]
