Envio do estado atual do projeto
Projeto ainda em desenvolvimento. Enviado para o repositório para manter estado atual.
This commit is contained in:
1 parent
e539e83c79
commit
24650484f1
94 files changed
+3575
No files matched your search
@@ -0,0 +1,145 @@
|
||||
# Generated by Django 6.0.2 on 2026-02-28 19:45
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import entities.models.user
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('auth', '0012_alter_user_first_name_max_length'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Animal',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('identifier', models.CharField(max_length=45)),
|
||||
('birth', models.DateField()),
|
||||
('weight', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Batch',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('identifier', models.CharField(max_length=45)),
|
||||
('animal_category', models.CharField(blank=True, max_length=45, null=True)),
|
||||
('batch_type', models.CharField(blank=True, max_length=45, null=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Farm',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('name', models.CharField(max_length=45)),
|
||||
('total_area', models.IntegerField(blank=True, null=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PaddockGroup',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('identifier', models.CharField(max_length=45)),
|
||||
('description', models.TextField(blank=True, null=True)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='BatchAnimal',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('animal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='entities.animal')),
|
||||
('batch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='entities.batch')),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='batch',
|
||||
name='animals',
|
||||
field=models.ManyToManyField(related_name='batches', through='entities.BatchAnimal', to='entities.animal'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='animal',
|
||||
name='farm',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='animals', to='entities.farm'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='User',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('password', models.CharField(max_length=128, verbose_name='password')),
|
||||
('name', models.CharField(max_length=45)),
|
||||
('login', models.CharField(max_length=45, unique=True)),
|
||||
('email', models.EmailField(max_length=254, unique=True)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('is_superuser', models.BooleanField(default=False)),
|
||||
('is_staff', models.BooleanField(default=False)),
|
||||
('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('last_login', models.DateTimeField(blank=True, null=True)),
|
||||
('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')),
|
||||
('farms', models.ManyToManyField(related_name='users', to='entities.farm')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'User',
|
||||
'verbose_name_plural': 'Users',
|
||||
},
|
||||
managers=[
|
||||
('objects', entities.models.user.CustomUserManager()),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Paddock',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('paddock_number', models.IntegerField()),
|
||||
('area', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
|
||||
('load_capacity', models.IntegerField(blank=True, null=True)),
|
||||
('occupied', models.BooleanField(default=False)),
|
||||
('farm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='paddocks', to='entities.farm')),
|
||||
('paddock_group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='paddocks', to='entities.paddockgroup')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Rotation',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('entry_date', models.DateTimeField()),
|
||||
('entry_height', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('exit_date', models.DateTimeField(blank=True, null=True)),
|
||||
('exit_height', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
|
||||
('animal_count', models.IntegerField()),
|
||||
('livestock_unit', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('batch', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rotations', to='entities.batch')),
|
||||
('paddock', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rotations', to='entities.paddock')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='FeedingRecord',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('feed_quantity', models.DecimalField(decimal_places=2, max_digits=10)),
|
||||
('animal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feeding_record', to='entities.animal')),
|
||||
('rotation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feeding_record', to='entities.rotation')),
|
||||
],
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='batchanimal',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('is_active', True)), fields=('animal',), name='unique_active_animal_batch_link'),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='animal',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(('is_active', True)), fields=('identifier', 'farm'), name='unique_active_farm_animal'),
|
||||
),
|
||||
]
|
||||
Whitespace-only changes.
Reference in new issue
Block a user