# Generated by Django 5.2.4 on 2025-08-27 05:21

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


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0008_ttdepartment_ttzone_ttavailability_ttstartpreference_and_more'),
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='TtConstraintProfile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=100)),
                ('name', models.CharField(max_length=100)),
                ('desc', models.TextField(null=True)),
                ('department', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.ttdepartment')),
                ('status', models.SmallIntegerField()),
                ('created_by', models.BigIntegerField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_by', models.BigIntegerField(null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'tt_constraint_profile',
            },
        ),
        migrations.CreateModel(
            name='TtLocation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=150)),
                ('name', models.CharField(max_length=150)),
                ('desc', models.TextField(null=True)),
                ('department', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.ttdepartment')),
                ('capacity', models.IntegerField(null=True)),
                ('area', models.IntegerField(null=True)),
                ('maximum_period', models.IntegerField(null=True)),
                ('contract_period', models.IntegerField(null=True)),
                ('shared_with_all_department', models.BooleanField(default=False)),
                ('zone', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.ttzone')),
                ('availability', models.ForeignKey(blank=True, db_comment='NULL means custom', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.ttavailability')),
                ('availability_pattern', models.TextField(null=True)),
                ('start_preference', models.ForeignKey(blank=True, db_comment='NULL means custom', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.ttstartpreference')),
                ('start_preference_pattern', models.TextField(null=True)),
                ('usage_preference', models.ForeignKey(blank=True, db_comment='NULL means custom', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.ttusagepreference')),
                ('usage_preference_pattern', models.TextField(null=True)),
                ('extra_data_1', models.TextField(null=True)),
                ('extra_data_2', models.TextField(null=True)),
                ('extra_data_3', models.TextField(null=True)),
                ('extra_data_4', models.TextField(null=True)),
                ('extra_data_5', models.TextField(null=True)),
                ('extra_data_6', models.TextField(null=True)),
                ('extra_data_7', models.TextField(null=True)),
                ('extra_data_8', models.TextField(null=True)),
                ('extra_data_9', models.TextField(null=True)),
                ('extra_data_10', models.TextField(null=True)),
                ('status', models.SmallIntegerField()),
                ('created_by', models.BigIntegerField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_by', models.BigIntegerField(null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'tt_location',
            },
        ),
        migrations.CreateModel(
            name='TtLocationAvoidConcurrency',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='avoid_concurrency_from', to='api.ttlocation')),
                ('avoid_location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='avoid_concurrency_to', to='api.ttlocation')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'tt_location_avoid_concurrency',
                'unique_together': {('location', 'avoid_location')},
            },
        ),
        migrations.AddField(
            model_name='ttlocation',
            name='avoid_concurrency',
            field=models.ManyToManyField(through='api.TtLocationAvoidConcurrency', to='api.ttlocation'),
        ),
        migrations.CreateModel(
            name='TtStaff',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=150)),
                ('name', models.CharField(max_length=150)),
                ('email', models.EmailField(max_length=254, null=True)),
                ('desc', models.TextField(null=True)),
                ('department', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.ttdepartment')),
                ('is_part_time', models.BooleanField(default=False)),
                ('maximum_period', models.IntegerField(null=True)),
                ('contract_period', models.IntegerField(null=True)),
                ('shared_with_all_department', models.BooleanField(default=False)),
                ('zone', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.ttzone')),
                ('availability', models.ForeignKey(blank=True, db_comment='NULL means custom', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.ttavailability')),
                ('availability_pattern', models.TextField(null=True)),
                ('start_preference', models.ForeignKey(blank=True, db_comment='NULL means custom', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.ttstartpreference')),
                ('start_preference_pattern', models.TextField(null=True)),
                ('usage_preference', models.ForeignKey(blank=True, db_comment='NULL means custom', null=True, on_delete=django.db.models.deletion.SET_NULL, to='api.ttusagepreference')),
                ('usage_preference_pattern', models.TextField(null=True)),
                ('extra_data_1', models.TextField(null=True)),
                ('extra_data_2', models.TextField(null=True)),
                ('extra_data_3', models.TextField(null=True)),
                ('extra_data_4', models.TextField(null=True)),
                ('extra_data_5', models.TextField(null=True)),
                ('extra_data_6', models.TextField(null=True)),
                ('extra_data_7', models.TextField(null=True)),
                ('extra_data_8', models.TextField(null=True)),
                ('extra_data_9', models.TextField(null=True)),
                ('extra_data_10', models.TextField(null=True)),
                ('status', models.SmallIntegerField()),
                ('created_by', models.BigIntegerField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_by', models.BigIntegerField(null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'tt_staff',
            },
        ),
        migrations.CreateModel(
            name='TtStaffAvoidConcurrency',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('staff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='avoid_concurrency_from', to='api.ttstaff')),
                ('avoid_staff', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='avoid_concurrency_to', to='api.ttstaff')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'tt_staff_avoid_concurrency',
                'unique_together': {('staff', 'avoid_staff')},
            },
        ),
        migrations.AddField(
            model_name='ttstaff',
            name='avoid_concurrency',
            field=models.ManyToManyField(through='api.TtStaffAvoidConcurrency', to='api.ttstaff'),
        ),
        migrations.CreateModel(
            name='TtTag',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=100)),
                ('name', models.CharField(max_length=100)),
                ('desc', models.TextField(null=True)),
                ('department', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.ttdepartment')),
                ('status', models.SmallIntegerField()),
                ('created_by', models.BigIntegerField(null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_by', models.BigIntegerField(null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'tt_tag',
            },
        ),
        migrations.CreateModel(
            name='TtTagRelation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.tttag')),
                ('refer_id', models.PositiveIntegerField()),
                ('refer_table', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'tt_tag_relation',
                'unique_together': {('tag', 'refer_table', 'refer_id')},
            },
        ),
    ]
