278 lines
9.6 KiB
C#
278 lines
9.6 KiB
C#
// <auto-generated />
|
|
using ConsoleApp1.data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace ConsoleApp1.Migrations
|
|
{
|
|
[DbContext(typeof(PokemonContext))]
|
|
[Migration("20260928132358_checkAll0")]
|
|
partial class checkAll0
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.4")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.Ability", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("ability_id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text")
|
|
.HasColumnName("ability_name");
|
|
|
|
b.Property<string>("ShortEffect")
|
|
.IsRequired()
|
|
.HasColumnType("text")
|
|
.HasColumnName("ability_short_effect");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("ability");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.Pokemon", b =>
|
|
{
|
|
b.Property<int>("id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("id"));
|
|
|
|
b.Property<double>("height")
|
|
.HasColumnType("double precision")
|
|
.HasColumnName("pokemon_height_m");
|
|
|
|
b.Property<string>("name")
|
|
.IsRequired()
|
|
.HasMaxLength(30)
|
|
.HasColumnType("character varying(30)")
|
|
.HasColumnName("pokemon_name");
|
|
|
|
b.Property<double>("weight")
|
|
.HasColumnType("double precision")
|
|
.HasColumnName("pokemon_weight_kg");
|
|
|
|
b.HasKey("id");
|
|
|
|
b.HasIndex("name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("pokemon");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.PokemonAbility", b =>
|
|
{
|
|
b.Property<int>("idAbility")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("ability_id");
|
|
|
|
b.Property<int>("PokemonId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_id");
|
|
|
|
b.Property<string>("name")
|
|
.IsRequired()
|
|
.HasColumnType("text")
|
|
.HasColumnName("name");
|
|
|
|
b.Property<string>("note")
|
|
.IsRequired()
|
|
.HasColumnType("text")
|
|
.HasColumnName("description");
|
|
|
|
b.HasKey("idAbility", "PokemonId");
|
|
|
|
b.HasIndex("PokemonId");
|
|
|
|
b.ToTable("PokemonAbilities");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.PokemonStat", b =>
|
|
{
|
|
b.Property<int>("IdStat")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("idStat");
|
|
|
|
b.Property<int>("PokemonId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("PokemonId");
|
|
|
|
b.HasKey("IdStat", "PokemonId");
|
|
|
|
b.HasIndex("PokemonId");
|
|
|
|
b.ToTable("PokemonStats");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.PokemonType", b =>
|
|
{
|
|
b.Property<int>("TypeId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("type_id");
|
|
|
|
b.Property<int>("PokemonId")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_id");
|
|
|
|
b.Property<int>("Slot")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_type_slot");
|
|
|
|
b.HasKey("TypeId", "PokemonId");
|
|
|
|
b.HasIndex("PokemonId");
|
|
|
|
b.ToTable("pokemon_type");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.Stat", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("stat_id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Attack")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_Attack");
|
|
|
|
b.Property<int>("Defense")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_Defense");
|
|
|
|
b.Property<int>("HP")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_HP");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text")
|
|
.HasColumnName("name");
|
|
|
|
b.Property<int>("SpecialAttack")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_SpecialAttack");
|
|
|
|
b.Property<int>("SpecialDefense")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_SpecialDefense");
|
|
|
|
b.Property<int>("Speed")
|
|
.HasColumnType("integer")
|
|
.HasColumnName("pokemon_Speed");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("stat");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.Type", b =>
|
|
{
|
|
b.Property<int>("typeId")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer")
|
|
.HasColumnName("type_id");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("typeId"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text")
|
|
.HasColumnName("type_name");
|
|
|
|
b.HasKey("typeId");
|
|
|
|
b.HasIndex("Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("type");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.PokemonAbility", b =>
|
|
{
|
|
b.HasOne("ConsoleApp1.data.model.Pokemon", "Pokemon")
|
|
.WithMany()
|
|
.HasForeignKey("PokemonId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ConsoleApp1.data.model.Ability", "Ability")
|
|
.WithMany()
|
|
.HasForeignKey("idAbility")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Ability");
|
|
|
|
b.Navigation("Pokemon");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.PokemonStat", b =>
|
|
{
|
|
b.HasOne("ConsoleApp1.data.model.Stat", "Stat")
|
|
.WithMany()
|
|
.HasForeignKey("IdStat")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ConsoleApp1.data.model.Pokemon", "Pokemon")
|
|
.WithMany()
|
|
.HasForeignKey("PokemonId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Pokemon");
|
|
|
|
b.Navigation("Stat");
|
|
});
|
|
|
|
modelBuilder.Entity("ConsoleApp1.data.model.PokemonType", b =>
|
|
{
|
|
b.HasOne("ConsoleApp1.data.model.Pokemon", "Pokemon")
|
|
.WithMany()
|
|
.HasForeignKey("PokemonId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ConsoleApp1.data.model.Type", "Type")
|
|
.WithMany()
|
|
.HasForeignKey("TypeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Pokemon");
|
|
|
|
b.Navigation("Type");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|