sos
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
// <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("20260911141040_init")]
|
||||
partial class init
|
||||
{
|
||||
/// <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.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");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "type",
|
||||
columns: table => new
|
||||
{
|
||||
type_id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
type_name = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_type", x => x.type_id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_type_type_name",
|
||||
table: "type",
|
||||
column: "type_name",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "type");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// <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("20260911141421_initd")]
|
||||
partial class initd
|
||||
{
|
||||
/// <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.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");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class initd : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
// <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("20260911142530_initdx")]
|
||||
partial class initdx
|
||||
{
|
||||
/// <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.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");
|
||||
|
||||
b.Property<string>("name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("character varying(30)");
|
||||
|
||||
b.Property<double>("weight")
|
||||
.HasColumnType("double precision");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("pokemon");
|
||||
});
|
||||
|
||||
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");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class initdx : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "pokemon",
|
||||
columns: table => new
|
||||
{
|
||||
pokemon_id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
name = table.Column<string>(type: "character varying(30)", maxLength: 30, nullable: false),
|
||||
height = table.Column<double>(type: "double precision", nullable: false),
|
||||
weight = table.Column<double>(type: "double precision", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_pokemon", x => x.pokemon_id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_pokemon_name",
|
||||
table: "pokemon",
|
||||
column: "name",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "pokemon");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// <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("20260917124211_hecktype")]
|
||||
partial class hecktype
|
||||
{
|
||||
/// <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.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.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");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class hecktype : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "weight",
|
||||
table: "pokemon",
|
||||
newName: "pokemon_weight_kg");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "name",
|
||||
table: "pokemon",
|
||||
newName: "pokemon_name");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "height",
|
||||
table: "pokemon",
|
||||
newName: "pokemon_height_m");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_pokemon_name",
|
||||
table: "pokemon",
|
||||
newName: "IX_pokemon_pokemon_name");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "pokemon_weight_kg",
|
||||
table: "pokemon",
|
||||
newName: "weight");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "pokemon_name",
|
||||
table: "pokemon",
|
||||
newName: "name");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "pokemon_height_m",
|
||||
table: "pokemon",
|
||||
newName: "height");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_pokemon_pokemon_name",
|
||||
table: "pokemon",
|
||||
newName: "IX_pokemon_name");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
// <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("20260917125100_checktype2")]
|
||||
partial class checktype2
|
||||
{
|
||||
/// <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.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.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.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.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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checktype2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "pokemon_type",
|
||||
columns: table => new
|
||||
{
|
||||
pokemon_id = table.Column<int>(type: "integer", nullable: false),
|
||||
type_id = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_type_slot = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_pokemon_type", x => new { x.type_id, x.pokemon_id });
|
||||
table.ForeignKey(
|
||||
name: "FK_pokemon_type_pokemon_pokemon_id",
|
||||
column: x => x.pokemon_id,
|
||||
principalTable: "pokemon",
|
||||
principalColumn: "pokemon_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_pokemon_type_type_type_id",
|
||||
column: x => x.type_id,
|
||||
principalTable: "type",
|
||||
principalColumn: "type_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_pokemon_type_pokemon_id",
|
||||
table: "pokemon_type",
|
||||
column: "pokemon_id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "pokemon_type");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
// <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("20260923143007_checktype001")]
|
||||
partial class checktype001
|
||||
{
|
||||
/// <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.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.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.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<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("IdStat", "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.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.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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checktype001 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PokemonAbilities",
|
||||
columns: table => new
|
||||
{
|
||||
pokemon_id = table.Column<int>(type: "integer", nullable: false),
|
||||
ability_id = table.Column<int>(type: "integer", nullable: false),
|
||||
name = table.Column<string>(type: "text", nullable: false),
|
||||
description = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PokemonAbilities", x => new { x.ability_id, x.pokemon_id });
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PokemonStats",
|
||||
columns: table => new
|
||||
{
|
||||
idStat = table.Column<int>(type: "integer", nullable: false),
|
||||
PokemonId = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_HP = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_Attack = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_Defense = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_SpecialAttack = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_SpecialDefense = table.Column<int>(type: "integer", nullable: false),
|
||||
pokemon_Speed = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PokemonStats", x => new { x.idStat, x.PokemonId });
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PokemonAbilities");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PokemonStats");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
// <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("20260924142718_checktype0")]
|
||||
partial class checktype0
|
||||
{
|
||||
/// <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.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<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("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<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("name");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checktype0 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ability",
|
||||
columns: table => new
|
||||
{
|
||||
ability_id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ability_name = table.Column<string>(type: "text", nullable: false),
|
||||
ability_short_effect = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ability", x => x.ability_id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "stat",
|
||||
columns: table => new
|
||||
{
|
||||
stat_id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
name = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_stat", x => x.stat_id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PokemonStats_PokemonId",
|
||||
table: "PokemonStats",
|
||||
column: "PokemonId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PokemonAbilities_pokemon_id",
|
||||
table: "PokemonAbilities",
|
||||
column: "pokemon_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ability_ability_name",
|
||||
table: "ability",
|
||||
column: "ability_name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_stat_name",
|
||||
table: "stat",
|
||||
column: "name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonAbilities_ability_ability_id",
|
||||
table: "PokemonAbilities",
|
||||
column: "ability_id",
|
||||
principalTable: "ability",
|
||||
principalColumn: "ability_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonAbilities_pokemon_pokemon_id",
|
||||
table: "PokemonAbilities",
|
||||
column: "pokemon_id",
|
||||
principalTable: "pokemon",
|
||||
principalColumn: "pokemon_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonStats_pokemon_PokemonId",
|
||||
table: "PokemonStats",
|
||||
column: "PokemonId",
|
||||
principalTable: "pokemon",
|
||||
principalColumn: "pokemon_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonStats_stat_idStat",
|
||||
table: "PokemonStats",
|
||||
column: "idStat",
|
||||
principalTable: "stat",
|
||||
principalColumn: "stat_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonAbilities_ability_ability_id",
|
||||
table: "PokemonAbilities");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonAbilities_pokemon_pokemon_id",
|
||||
table: "PokemonAbilities");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonStats_pokemon_PokemonId",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonStats_stat_idStat",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ability");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "stat");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PokemonStats_PokemonId",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PokemonAbilities_pokemon_id",
|
||||
table: "PokemonAbilities");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checkAll0 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_Attack",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_Defense",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_HP",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_SpecialAttack",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_SpecialDefense",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_Speed",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_Attack",
|
||||
table: "stat",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_Defense",
|
||||
table: "stat",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_HP",
|
||||
table: "stat",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_SpecialAttack",
|
||||
table: "stat",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_SpecialDefense",
|
||||
table: "stat",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_Speed",
|
||||
table: "stat",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_Attack",
|
||||
table: "stat");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_Defense",
|
||||
table: "stat");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_HP",
|
||||
table: "stat");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_SpecialAttack",
|
||||
table: "stat");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_SpecialDefense",
|
||||
table: "stat");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_Speed",
|
||||
table: "stat");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_Attack",
|
||||
table: "PokemonStats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_Defense",
|
||||
table: "PokemonStats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_HP",
|
||||
table: "PokemonStats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_SpecialAttack",
|
||||
table: "PokemonStats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_SpecialDefense",
|
||||
table: "PokemonStats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "pokemon_Speed",
|
||||
table: "PokemonStats",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
// <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("20260928132420_checkAll01")]
|
||||
partial class checkAll01
|
||||
{
|
||||
/// <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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checkAll01 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
// <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("20260928133223_checkAll02")]
|
||||
partial class checkAll02
|
||||
{
|
||||
/// <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>("base_experience")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("pokemon_base_experience");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checkAll02 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "pokemon_base_experience",
|
||||
table: "pokemon",
|
||||
type: "double precision",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_base_experience",
|
||||
table: "pokemon");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
// <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("20260928134004_checkAll03")]
|
||||
partial class checkAll03
|
||||
{
|
||||
/// <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>("base_experience")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("pokemon_base_experience");
|
||||
|
||||
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<bool>("abilityHidden")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("pokemon_ability_is_hidden");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checkAll03 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "description",
|
||||
table: "PokemonAbilities");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "name",
|
||||
table: "PokemonAbilities");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "pokemon_ability_is_hidden",
|
||||
table: "PokemonAbilities",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_ability_is_hidden",
|
||||
table: "PokemonAbilities");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "description",
|
||||
table: "PokemonAbilities",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "name",
|
||||
table: "PokemonAbilities",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// <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("20260928141949_checkAll05")]
|
||||
partial class checkAll05
|
||||
{
|
||||
/// <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>("base_experience")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("pokemon_base_experience");
|
||||
|
||||
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<bool>("abilityHidden")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("pokemon_ability_is_hidden");
|
||||
|
||||
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.Property<string>("statBase")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("pokemon_stat_base_stat");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checkAll05 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "pokemon_stat_base_stat",
|
||||
table: "PokemonStats",
|
||||
type: "text",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "pokemon_stat_base_stat",
|
||||
table: "PokemonStats");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// <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("20260928142006_checkAll06")]
|
||||
partial class checkAll06
|
||||
{
|
||||
/// <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>("base_experience")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("pokemon_base_experience");
|
||||
|
||||
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<bool>("abilityHidden")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("pokemon_ability_is_hidden");
|
||||
|
||||
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.Property<string>("statBase")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("pokemon_stat_base_stat");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checkAll06 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// <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("20260928143101_checkAll07")]
|
||||
partial class checkAll07
|
||||
{
|
||||
/// <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>("base_experience")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("pokemon_base_experience");
|
||||
|
||||
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<bool>("abilityHidden")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("pokemon_ability_is_hidden");
|
||||
|
||||
b.HasKey("idAbility", "PokemonId");
|
||||
|
||||
b.HasIndex("PokemonId");
|
||||
|
||||
b.ToTable("PokemonAbilities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ConsoleApp1.data.model.PokemonStat", b =>
|
||||
{
|
||||
b.Property<int>("IdStat")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("stat_id");
|
||||
|
||||
b.Property<int>("PokemonId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("pokemon_id");
|
||||
|
||||
b.Property<string>("statBase")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("pokemon_stat_base_stat");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class checkAll07 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonStats_pokemon_PokemonId",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonStats_stat_idStat",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "PokemonId",
|
||||
table: "PokemonStats",
|
||||
newName: "pokemon_id");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "idStat",
|
||||
table: "PokemonStats",
|
||||
newName: "stat_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_PokemonStats_PokemonId",
|
||||
table: "PokemonStats",
|
||||
newName: "IX_PokemonStats_pokemon_id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonStats_pokemon_pokemon_id",
|
||||
table: "PokemonStats",
|
||||
column: "pokemon_id",
|
||||
principalTable: "pokemon",
|
||||
principalColumn: "pokemon_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonStats_stat_stat_id",
|
||||
table: "PokemonStats",
|
||||
column: "stat_id",
|
||||
principalTable: "stat",
|
||||
principalColumn: "stat_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonStats_pokemon_pokemon_id",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PokemonStats_stat_stat_id",
|
||||
table: "PokemonStats");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "pokemon_id",
|
||||
table: "PokemonStats",
|
||||
newName: "PokemonId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "stat_id",
|
||||
table: "PokemonStats",
|
||||
newName: "idStat");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_PokemonStats_pokemon_id",
|
||||
table: "PokemonStats",
|
||||
newName: "IX_PokemonStats_PokemonId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonStats_pokemon_PokemonId",
|
||||
table: "PokemonStats",
|
||||
column: "PokemonId",
|
||||
principalTable: "pokemon",
|
||||
principalColumn: "pokemon_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PokemonStats_stat_idStat",
|
||||
table: "PokemonStats",
|
||||
column: "idStat",
|
||||
principalTable: "stat",
|
||||
principalColumn: "stat_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
// <auto-generated />
|
||||
using ConsoleApp1.data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ConsoleApp1.Migrations
|
||||
{
|
||||
[DbContext(typeof(PokemonContext))]
|
||||
partial class PokemonContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(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>("base_experience")
|
||||
.HasColumnType("double precision")
|
||||
.HasColumnName("pokemon_base_experience");
|
||||
|
||||
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<bool>("abilityHidden")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("pokemon_ability_is_hidden");
|
||||
|
||||
b.HasKey("idAbility", "PokemonId");
|
||||
|
||||
b.HasIndex("PokemonId");
|
||||
|
||||
b.ToTable("PokemonAbilities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ConsoleApp1.data.model.PokemonStat", b =>
|
||||
{
|
||||
b.Property<int>("IdStat")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("stat_id");
|
||||
|
||||
b.Property<int>("PokemonId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("pokemon_id");
|
||||
|
||||
b.Property<string>("statBase")
|
||||
.IsRequired()
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("pokemon_stat_base_stat");
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user