Files
GerbilManager/GerbilManagerWebAPI/Migrations/20260605225413_InitialCreate.Designer.cs
Gulum 263ba32e3c DATA-2: fresh Npgsql InitialCreate migration + ColorVariety seed (18)
8 tables (Gerbils, Litters, Contacts, Enclosures, ColorVarieties, GerbilPhotos,
HealthRecords, WeightRecords); enums as text columns; ColorVariety HasData seed
of the 18 GEN-1 base varieties. Replaces the prior pre-DATA-2 InitialCreate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 00:54:56 +02:00

501 lines
19 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace GerbilManagerWebAPI.Migrations
{
[DbContext(typeof(ApplicationContext))]
[Migration("20260605225413_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "10.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("GerbilManagerWebAPI.Models.ColorVariety", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("CanonicalGenotype")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<int>("SortOrder")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("ColorVarieties");
b.HasData(
new
{
Id = new Guid("00000000-0000-0000-0000-000000000001"),
CanonicalGenotype = "AA chch DD EE GG pp spsp rere",
Name = "Pink Eyed White (PEW)",
SortOrder = 0
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000002"),
CanonicalGenotype = "aa chch DD EE GG PP spsp rere",
Name = "Hermelin",
SortOrder = 1
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000003"),
CanonicalGenotype = "AA chch DD EE GG PP spsp rere",
Name = "Himalaya",
SortOrder = 2
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000004"),
CanonicalGenotype = "aa cchmcchm DD EE gg PP spsp rere",
Name = "Zobel",
SortOrder = 3
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000005"),
CanonicalGenotype = "AA CC DD efef GG PP spsp rere",
Name = "Schwarzschimmel",
SortOrder = 4
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000006"),
CanonicalGenotype = "AA CC DD efef GG pp spsp rere",
Name = "Rotaugenschimmel",
SortOrder = 5
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000007"),
CanonicalGenotype = "AA CC DD EE GG PP spsp rere",
Name = "Agouti",
SortOrder = 6
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000008"),
CanonicalGenotype = "aa CC DD EE GG PP spsp rere",
Name = "Schwarz",
SortOrder = 7
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000009"),
CanonicalGenotype = "AA CC DD EE gg PP spsp rere",
Name = "Silberagouti",
SortOrder = 8
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000010"),
CanonicalGenotype = "aa CC DD EE gg PP spsp rere",
Name = "Anthrazit",
SortOrder = 9
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000011"),
CanonicalGenotype = "AA CC DD ee GG PP spsp rere",
Name = "Algierfuchs",
SortOrder = 10
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000012"),
CanonicalGenotype = "aa CC dd EE GG PP spsp rere",
Name = "Blau",
SortOrder = 11
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000013"),
CanonicalGenotype = "AA CC DD EE GG pp spsp rere",
Name = "Gold",
SortOrder = 12
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000014"),
CanonicalGenotype = "aa CC DD EE GG pp spsp rere",
Name = "Platin",
SortOrder = 13
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000015"),
CanonicalGenotype = "AA CC DD ee GG pp spsp rere",
Name = "Goldfuchs",
SortOrder = 14
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000016"),
CanonicalGenotype = "aa CC DD ee GG pp spsp rere",
Name = "Rotfuchs",
SortOrder = 15
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000017"),
CanonicalGenotype = "AA CC dd EE GG pp spsp rere",
Name = "dd Gold",
SortOrder = 16
},
new
{
Id = new Guid("00000000-0000-0000-0000-000000000018"),
CanonicalGenotype = "aa CC dd EE GG pp spsp rere",
Name = "dd Platin",
SortOrder = 17
});
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.Contact", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ContactInfo")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Notes")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Contacts");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.Enclosure", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Notes")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Enclosures");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.Gerbil", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("CauseOfDeath")
.HasColumnType("text");
b.Property<Guid?>("ColorVarietyId")
.HasColumnType("uuid");
b.Property<DateOnly?>("DateOfBirth")
.HasColumnType("date");
b.Property<DateOnly?>("DateOfDeath")
.HasColumnType("date");
b.Property<Guid?>("EnclosureId")
.HasColumnType("uuid");
b.Property<string>("ExternalRef")
.HasColumnType("text");
b.Property<string>("Gender")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Genotype")
.HasColumnType("text");
b.Property<DateOnly?>("GoHomeDate")
.HasColumnType("date");
b.Property<string>("ImportSource")
.HasColumnType("text");
b.Property<Guid?>("LitterId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Notes")
.HasColumnType("text");
b.Property<Guid?>("OriginContactId")
.HasColumnType("uuid");
b.Property<Guid?>("ReceiverContactId")
.HasColumnType("uuid");
b.Property<string>("Status")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("ColorVarietyId");
b.HasIndex("EnclosureId");
b.HasIndex("LitterId");
b.HasIndex("OriginContactId");
b.HasIndex("ReceiverContactId");
b.ToTable("Gerbils");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.GerbilPhoto", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Caption")
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("FileName")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("GerbilId")
.HasColumnType("uuid");
b.Property<int>("SortOrder")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("GerbilId");
b.ToTable("GerbilPhotos");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.HealthRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateOnly>("Date")
.HasColumnType("date");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("GerbilId")
.HasColumnType("uuid");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Veterinarian")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("GerbilId");
b.ToTable("HealthRecords");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.Litter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateOnly>("Date")
.HasColumnType("date");
b.Property<DateOnly?>("ExpectedGoHomeDate")
.HasColumnType("date");
b.Property<Guid?>("FatherId")
.HasColumnType("uuid");
b.Property<Guid?>("MotherId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Notes")
.HasColumnType("text");
b.Property<int?>("TotalBorn")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("FatherId");
b.HasIndex("MotherId");
b.ToTable("Litters");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.WeightRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateOnly>("Date")
.HasColumnType("date");
b.Property<Guid>("GerbilId")
.HasColumnType("uuid");
b.Property<string>("Notes")
.HasColumnType("text");
b.Property<int>("WeightGrams")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("GerbilId");
b.ToTable("WeightRecords");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.Gerbil", b =>
{
b.HasOne("GerbilManagerWebAPI.Models.ColorVariety", "ColorVariety")
.WithMany()
.HasForeignKey("ColorVarietyId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("GerbilManagerWebAPI.Models.Enclosure", "Enclosure")
.WithMany("Gerbils")
.HasForeignKey("EnclosureId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("GerbilManagerWebAPI.Models.Litter", "Litter")
.WithMany()
.HasForeignKey("LitterId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("GerbilManagerWebAPI.Models.Contact", "OriginContact")
.WithMany()
.HasForeignKey("OriginContactId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("GerbilManagerWebAPI.Models.Contact", "ReceiverContact")
.WithMany()
.HasForeignKey("ReceiverContactId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("ColorVariety");
b.Navigation("Enclosure");
b.Navigation("Litter");
b.Navigation("OriginContact");
b.Navigation("ReceiverContact");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.GerbilPhoto", b =>
{
b.HasOne("GerbilManagerWebAPI.Models.Gerbil", null)
.WithMany()
.HasForeignKey("GerbilId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.HealthRecord", b =>
{
b.HasOne("GerbilManagerWebAPI.Models.Gerbil", null)
.WithMany()
.HasForeignKey("GerbilId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.Litter", b =>
{
b.HasOne("GerbilManagerWebAPI.Models.Gerbil", "Father")
.WithMany()
.HasForeignKey("FatherId")
.OnDelete(DeleteBehavior.Restrict);
b.HasOne("GerbilManagerWebAPI.Models.Gerbil", "Mother")
.WithMany()
.HasForeignKey("MotherId")
.OnDelete(DeleteBehavior.Restrict);
b.Navigation("Father");
b.Navigation("Mother");
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.WeightRecord", b =>
{
b.HasOne("GerbilManagerWebAPI.Models.Gerbil", null)
.WithMany()
.HasForeignKey("GerbilId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GerbilManagerWebAPI.Models.Enclosure", b =>
{
b.Navigation("Gerbils");
});
#pragma warning restore 612, 618
}
}
}