Update DB
continuous-integration/drone/push Build is failing Details

pull/10/head
Louwar 2 years ago
parent bed49aedc1
commit 318d6abf89

@ -2,24 +2,22 @@
using Model; using Model;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
namespace EFlib namespace EFlib
{ {
public class EFChampion public class EFChampion
{ {
// public int Id { get; set; }
// https://learn.microsoft.com/fr-fr/ef/core/modeling/keyless-entity-types?tabs=data-annotations
/**** Only Attributs ****/ /**** Only Attributs ****/
//[Key] [Key]
public string Name { get; set; } public string Name { get; set; }
//[MaxLength(500)] [MaxLength(500)]
public string Bio { get; set; } public string Bio { get; set; }
public string Icon { get; set; } public string Icon { get; set; }
public ReadOnlyDictionary<string, int> Characteristics { get; private set; } public ReadOnlyDictionary<string, int> Characteristics { get; private set; }
public EFChampionClass Class { get; set; } public EFChampionClass Class { get; set; }
public ReadOnlyCollection<EFSkin> Skins { get; private set; } public ReadOnlyCollection<EFSkin> Skins { get; private set; }
public ImmutableHashSet<Skill> Skills { get; private set; } public ImmutableHashSet<EFSkill> Skills { get; private set; }
public LargeImage Image { get; set; } public LargeImage Image { get; set; }
} }
} }

@ -12,7 +12,7 @@ namespace EFlib
public class EFChampionClass public class EFChampionClass
{ {
[Key] [Key]
[ForeignKey("ChampionEntity")] [ForeignKey("EFChampion")]
public int Id { get; set; } public int Id { get; set; }
public ChampionClass Class { get; set; } public ChampionClass Class { get; set; }
} }

@ -1,47 +0,0 @@
// <auto-generated />
using EFlib;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EFlib.Migrations
{
[DbContext(typeof(SQLiteContext))]
[Migration("20230209074746_MyMigration")]
partial class MyMigration
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("EFlib.EFChampion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Champions");
});
#pragma warning restore 612, 618
}
}
}

@ -1,36 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EFlib.Migrations
{
/// <inheritdoc />
public partial class MyMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Champions",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Bio = table.Column<string>(type: "TEXT", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Champions", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Champions");
}
}
}

@ -1,44 +0,0 @@
// <auto-generated />
using EFlib;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace EFlib.Migrations
{
[DbContext(typeof(SQLiteContext))]
partial class SQLiteContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.2");
modelBuilder.Entity("EFlib.EFChampion", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Champions");
});
#pragma warning restore 612, 618
}
}
}

Binary file not shown.
Loading…
Cancel
Save