# -*- coding: utf-8 -*-
# Generated by reset_migrations_simple.py - Simple Version

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        # 基本的なモデルのみ作成（managed=Falseのモデルは除外）
        
        # 1. ユーザー関連モデル
        migrations.CreateModel(
            name='CustomUser',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('firstname', models.CharField(blank=True, max_length=255, null=True)),
                ('lastname', models.CharField(blank=True, max_length=255, null=True)),
                ('date_of_birth', models.DateField(blank=True, null=True)),
                ('female', models.BooleanField(default=False)),
                ('group', models.CharField(blank=True, max_length=255)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
                ('is_rogaining', models.BooleanField(default=False)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
        ),
        
        # 2. カテゴリモデル
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_name', models.CharField(max_length=255, verbose_name='カテゴリ名')),
                ('parent_category', models.CharField(blank=True, max_length=255, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        
        # 3. イベント関連モデル
        migrations.CreateModel(
            name='NewEvent',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('event_code', models.CharField(max_length=255, verbose_name='イベントコード')),
                ('event_name', models.CharField(max_length=255, verbose_name='イベント名')),
                ('event_date', models.DateField(verbose_name='イベント日')),
                ('start_time', models.TimeField(blank=True, null=True, verbose_name='開始時刻')),
                ('end_time', models.TimeField(blank=True, null=True, verbose_name='終了時刻')),
                ('description', models.TextField(blank=True, null=True, verbose_name='説明')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_updated_at', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(default=1, on_delete=django.db.models.deletion.DO_NOTHING, to='rog.category')),
            ],
            options={
                'db_table': 'rog_newevent',
            },
        ),
        
        # 4. チーム関連モデル
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('team_name', models.CharField(max_length=255, verbose_name='チーム名')),
                ('team_member_num', models.IntegerField(blank=True, default=1, null=True, verbose_name='チーム人数')),
                ('score', models.IntegerField(blank=True, default=0, null=True, verbose_name='スコア')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_updated_at', models.DateTimeField(auto_now=True)),
                ('event', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.newevent')),
            ],
            options={
                'db_table': 'rog_team',
            },
        ),
        
        # 5. ロケーション関連モデル（基本的なもの）
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location_id', models.IntegerField(blank=True, db_index=True, null=True, verbose_name='Location id')),
                ('sub_loc_id', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Sub location id')),
                ('cp', models.FloatField(blank=False, default=0, null=True, verbose_name='Check Point')),
                ('location_name', models.CharField(default='--- 場所をお願いします --', max_length=2048, verbose_name='Location Name')),
                ('category', models.CharField(blank=True, db_index=True, max_length=2048, null=True, verbose_name='Category')),
                ('subcategory', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Sub Category')),
                ('zip', models.CharField(blank=True, max_length=12, null=True, verbose_name='Zip code')),
                ('address', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Address')),
                ('prefecture', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Prefecture')),
                ('area', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Area')),
                ('city', models.CharField(blank=True, max_length=2048, null=True, verbose_name='City')),
                ('latitude', models.FloatField(blank=True, null=True, verbose_name='Latitude')),
                ('longitude', models.FloatField(blank=True, null=True, verbose_name='Latitude')),
                ('photos', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Photos')),
                ('videos', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Videos')),
                ('webcontents', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Web Content')),
                ('status', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Status')),
                ('portal', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Portal')),
                ('group', models.CharField(blank=True, db_index=True, max_length=2048, null=True, verbose_name='Group')),
                ('phone', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Phone')),
                ('fax', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Fax')),
                ('email', models.EmailField(blank=True, max_length=2048, null=True, verbose_name='Email')),
                ('facility', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Facility')),
                ('remark', models.CharField(blank=True, max_length=2048, null=True, verbose_name='Remarks')),
                ('tags', models.CharField(blank=True, max_length=512, null=True, verbose_name='Tags')),
                ('parammeters', models.CharField(blank=True, max_length=512, null=True, verbose_name='Parameters')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_updated_at', models.DateTimeField(auto_now=True)),
                ('last_updated_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='location_updated_user', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'rog_location',
            },
        ),
        
        # 6. エントリー関連モデル
        migrations.CreateModel(
            name='Entry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_time', models.DateTimeField(blank=True, null=True, verbose_name='Start time')),
                ('goal_time', models.DateTimeField(blank=True, null=True, verbose_name='Goal time')),
                ('check_point', models.IntegerField(blank=True, null=True, verbose_name='Check Point')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_updated_at', models.DateTimeField(auto_now=True)),
                ('location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.location')),
                ('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='rog.team')),
                ('last_updated_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='entry_updated_user', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'rog_entry',
            },
        ),
    ]
