This commit is contained in:
2024-03-08 07:51:57 +01:00
commit e84a2f4f8d
191 changed files with 43915 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
using Kemkas.Web.Db.Models;
using Microsoft.AspNetCore.DataProtection.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
namespace Kemkas.Web.Db;
public class ApplicationDbContext : IdentityDbContext<ApplicationUser, ApplicationRole, int>, IDataProtectionKeyContext
{
public ApplicationDbContext(DbContextOptions options) : base(options)
{
}
public DbSet<DataProtectionKey> DataProtectionKeys { get; set; }
// 1st edition character
public DbSet<V1Karakter> Karakterek { get; set; }
public DbSet<V1KarakterKepzettseg> KarakterKepzettsegek { get; set; }
public DbSet<V1Szintlepes> Szintlepesek { get; set; }
public DbSet<V1Felszereles> Felszerelesek { get; set; }
// 2nd edition character
public DbSet<V2Karakter> Karakterek2E { get; set; }
public DbSet<V2KarakterKepzettseg> KarakterKepzettsegek2E { get; set; }
public DbSet<V2Szintlepes> Szintlepesek2E { get; set; }
public DbSet<V2Felszereles> Felszerelesek2E { get; set; }
}
+34
View File
@@ -0,0 +1,34 @@
namespace Kemkas.Web.Db.Enums;
public enum Faj1E
{
Ember = 0,
Amazon = 1,
Birodalmi = 2,
Etuniai = 3,
Eszaki = 4,
Osember = 5,
Elf = 6,
Felelf = 7,
Felork = 8,
Felszerzet = 9,
Gnom = 10,
Torpe = 11,
}
public enum Faj2E
{
Ember = 0,
Amazon = 1,
Birodalmi = 2,
Nomad = 3,
Eszaki = 4,
Osember = 5,
Elf = 6,
Felelf = 7,
Felork = 8,
Felszerzet = 9,
Gnom = 10,
Torpe = 11,
}
+84
View File
@@ -0,0 +1,84 @@
namespace Kemkas.Web.Db.Enums;
public static class FajExtensions
{
public static Faj1E Convert1E(string faj)
{
return faj switch
{
"f_ember" => Faj1E.Ember,
"f_amazon" => Faj1E.Amazon,
"f_birodalmi" => Faj1E.Birodalmi,
"f_etuniai" => Faj1E.Etuniai,
"f_eszaki" => Faj1E.Eszaki,
"f_osember" => Faj1E.Osember,
"f_elf" => Faj1E.Elf,
"f_felelf" => Faj1E.Felelf,
"f_felork" => Faj1E.Felork,
"f_felszerzet" => Faj1E.Felszerzet,
"f_gnom" => Faj1E.Gnom,
"f_torpe" => Faj1E.Torpe,
_ => throw new Exception("invalid faj: " + faj)
};
}
public static Faj2E Convert2E(string faj)
{
return faj switch
{
"f_2e_ember" => Faj2E.Ember,
"f_2e_amazon" => Faj2E.Amazon,
"f_2e_birodalmi" => Faj2E.Birodalmi,
"f_2e_nomad" => Faj2E.Nomad,
"f_2e_eszaki" => Faj2E.Eszaki,
"f_2e_osember" => Faj2E.Osember,
"f_2e_elf" => Faj2E.Elf,
"f_2e_felelf" => Faj2E.Felelf,
"f_2e_felork" => Faj2E.Felork,
"f_2e_felszerzet" => Faj2E.Felszerzet,
"f_2e_gnom" => Faj2E.Gnom,
"f_2e_torpe" => Faj2E.Torpe,
_ => throw new Exception("invalid faj: " + faj)
};
}
public static string Convert(this Faj1E faj)
{
return faj switch
{
Faj1E.Ember => "f_ember",
Faj1E.Amazon => "f_amazon",
Faj1E.Birodalmi => "f_birodalmi",
Faj1E.Etuniai => "f_etuniai",
Faj1E.Eszaki => "f_eszaki",
Faj1E.Osember => "f_osember",
Faj1E.Elf => "f_elf",
Faj1E.Felelf => "f_felelf",
Faj1E.Felork => "f_felork",
Faj1E.Felszerzet => "f_felszerzet",
Faj1E.Gnom => "f_gnom",
Faj1E.Torpe => "f_torpe",
_ => throw new Exception("invalid faj: " + faj)
};
}
public static string Convert(this Faj2E faj)
{
return faj switch
{
Faj2E.Ember => "f_2e_ember",
Faj2E.Amazon => "f_2e_amazon",
Faj2E.Birodalmi => "f_2e_birodalmi",
Faj2E.Nomad => "f_2e_nomad",
Faj2E.Eszaki => "f_2e_eszaki",
Faj2E.Osember => "f_2e_osember",
Faj2E.Elf => "f_2e_elf",
Faj2E.Felelf => "f_2e_felelf",
Faj2E.Felork => "f_2e_felork",
Faj2E.Felszerzet => "f_2e_felszerzet",
Faj2E.Gnom => "f_2e_gnom",
Faj2E.Torpe => "f_2e_torpe",
_ => throw new Exception("invalid faj: " + faj)
};
}
}
+15
View File
@@ -0,0 +1,15 @@
namespace Kemkas.Web.Db.Enums;
[Flags]
public enum Jellem : byte
{
Semleges = 0,
Torvenyes = 1,
Kaotikus = 2,
Jo = 4,
TorvenyesJo = Torvenyes | Jo, // 5
KaotikusJo = Kaotikus | Jo, // 6
Gonosz = 8,
TorvenyesGonosz = Torvenyes | Gonosz, // 9
KaotikusGonosz = Kaotikus | Gonosz, // 10
}
+40
View File
@@ -0,0 +1,40 @@
using System.ComponentModel.DataAnnotations;
namespace Kemkas.Web.Db.Enums;
public static class JellemExtensions
{
public static Jellem Convert(string jellem)
{
return jellem switch
{
"TJ" => Jellem.TorvenyesJo,
"SJ" => Jellem.Jo,
"KJ" => Jellem.KaotikusJo,
"TS" => Jellem.Torvenyes,
"S" => Jellem.Semleges,
"KS" => Jellem.Kaotikus,
"TG" => Jellem.TorvenyesGonosz,
"SG" => Jellem.Gonosz,
"KG" => Jellem.KaotikusGonosz,
_ => throw new ValidationException("invalid jellem: " + jellem)
};
}
public static string Convert(this Jellem jellem)
{
return jellem switch
{
Jellem.TorvenyesJo => "TJ",
Jellem.Jo => "SJ",
Jellem.KaotikusJo => "KJ",
Jellem.Torvenyes => "TS",
Jellem.Semleges => "S",
Jellem.Kaotikus => "KS",
Jellem.TorvenyesGonosz => "TG",
Jellem.Gonosz => "SG",
Jellem.KaotikusGonosz => "KG",
_ => throw new ValidationException("invalid jellem: " + (byte)jellem)
};
}
}
+70
View File
@@ -0,0 +1,70 @@
namespace Kemkas.Web.Db.Enums;
public enum Kepzettseg1E
{
Alkimia = 1,
Alcazas = 2,
Allatidomitas = 3,
Csapdak = 4,
Csillagjoslas = 5,
Egyensulyozas = 6,
Eloadas = 7,
Ertekbecsles = 8,
Gyogyitas = 9,
Hajozas = 10,
Hallgatozas = 11,
Hamisitas = 12,
JelekOlvasasa = 13,
Koncentracio = 14,
Lovaglas = 15,
Maszas = 16,
Megfigyeles = 17,
Meregkeveres = 18,
Mesterseg = 19,
Nyomkereses = 20,
Osonas = 21,
Rejtozes = 22,
Szabadulomuveszet = 23,
Tudas = 24,
Ugras = 25,
Uszas = 26,
Varazslatismeret = 27,
Zarnyitas = 28,
Zsebmetszes = 29,
}
// offset by 200 to make it more different from 1e karakter kepzettsegek
// I don't plan to mix them, but let's make it obvious which one is which.
// But it could be useful in one-time character conversions in the future.
public enum Kepzettseg2E
{
Alkimia = 201,
Alcazas = 202,
Allatidomitas = 203,
Csapdak = 204,
Csillagjoslas = 205,
Egyensulyozas = 206,
Eloadas = 207,
Ertekbecsles = 208,
Gyogyitas = 209,
Hajozas = 210,
Hallgatozas = 211,
Hamisitas = 212,
JelekOlvasasa = 213,
Herbalizmus = 601,
Historia = 602,
Lovaglas = 215,
Maszas = 216,
Megfigyeles = 217,
Meregkeveres = 218,
Mesterseg = 219,
Nyomkereses = 220,
Okkultizmus = 666, // inside joke
Osonas = 221,
Szabadulomuveszet = 223,
Ugras = 225,
Uszas = 226,
Vadonjaras = 603,
Zarnyitas = 228,
Zsebmetszes = 229,
}
+154
View File
@@ -0,0 +1,154 @@
using System.ComponentModel.DataAnnotations;
namespace Kemkas.Web.Db.Enums;
public static class KepzettsegExtensions
{
public static Kepzettseg1E Convert1E(string kepzettseg)
{
return kepzettseg switch
{
"k_alkimia" => Kepzettseg1E.Alkimia,
"k_alcazas" => Kepzettseg1E.Alcazas,
"k_allatidomitas" => Kepzettseg1E.Allatidomitas,
"k_csapdak" => Kepzettseg1E.Csapdak,
"k_csillagjoslas" => Kepzettseg1E.Csillagjoslas,
"k_egyensulyozas" => Kepzettseg1E.Egyensulyozas,
"k_eloadas" => Kepzettseg1E.Eloadas,
"k_ertekbecsles" => Kepzettseg1E.Ertekbecsles,
"k_gyogyitas" => Kepzettseg1E.Gyogyitas,
"k_hajozas" => Kepzettseg1E.Hajozas,
"k_hallgatozas" => Kepzettseg1E.Hallgatozas,
"k_hamisitas" => Kepzettseg1E.Hamisitas,
"k_jelek_olvasasa" => Kepzettseg1E.JelekOlvasasa,
"k_koncentracio" => Kepzettseg1E.Koncentracio,
"k_lovaglas" => Kepzettseg1E.Lovaglas,
"k_maszas" => Kepzettseg1E.Maszas,
"k_megfigyeles" => Kepzettseg1E.Megfigyeles,
"k_meregkeveres" => Kepzettseg1E.Meregkeveres,
"k_mesterseg" => Kepzettseg1E.Mesterseg,
"k_nyomkereses" => Kepzettseg1E.Nyomkereses,
"k_osonas" => Kepzettseg1E.Osonas,
"k_rejtozes" => Kepzettseg1E.Rejtozes,
"k_szabadulomuveszet" => Kepzettseg1E.Szabadulomuveszet,
"k_tudas" => Kepzettseg1E.Tudas,
"k_ugras" => Kepzettseg1E.Ugras,
"k_uszas" => Kepzettseg1E.Uszas,
"k_varazslatismeret" => Kepzettseg1E.Varazslatismeret,
"k_zarnyitas" => Kepzettseg1E.Zarnyitas,
"k_zsebmetszes" => Kepzettseg1E.Zsebmetszes,
_ => throw new ValidationException("invalid kepzettseg: " + kepzettseg),
};
}
public static Kepzettseg2E Convert2E(string kepzettseg)
{
return kepzettseg switch
{
"k_alkimia" => Kepzettseg2E.Alkimia,
"k_alcazas" => Kepzettseg2E.Alcazas,
"k_allatidomitas" => Kepzettseg2E.Allatidomitas,
"k_csapdak" => Kepzettseg2E.Csapdak,
"k_csillagjoslas" => Kepzettseg2E.Csillagjoslas,
"k_egyensulyozas" => Kepzettseg2E.Egyensulyozas,
"k_eloadas" => Kepzettseg2E.Eloadas,
"k_ertekbecsles" => Kepzettseg2E.Ertekbecsles,
"k_gyogyitas" => Kepzettseg2E.Gyogyitas,
"k_hajozas" => Kepzettseg2E.Hajozas,
"k_hallgatozas" => Kepzettseg2E.Hallgatozas,
"k_hamisitas" => Kepzettseg2E.Hamisitas,
"k_herbalizmus" => Kepzettseg2E.Herbalizmus,
"k_historia" => Kepzettseg2E.Historia,
"k_jelek_olvasasa" => Kepzettseg2E.JelekOlvasasa,
"k_lovaglas" => Kepzettseg2E.Lovaglas,
"k_maszas" => Kepzettseg2E.Maszas,
"k_megfigyeles" => Kepzettseg2E.Megfigyeles,
"k_meregkeveres" => Kepzettseg2E.Meregkeveres,
"k_mesterseg" => Kepzettseg2E.Mesterseg,
"k_nyomkereses" => Kepzettseg2E.Nyomkereses,
"k_okkultizmus" => Kepzettseg2E.Okkultizmus,
"k_osonas" => Kepzettseg2E.Osonas,
"k_szabadulomuveszet" => Kepzettseg2E.Szabadulomuveszet,
"k_ugras" => Kepzettseg2E.Ugras,
"k_uszas" => Kepzettseg2E.Uszas,
"k_vadonjaras" => Kepzettseg2E.Vadonjaras,
"k_zarnyitas" => Kepzettseg2E.Zarnyitas,
"k_zsebmetszes" => Kepzettseg2E.Zsebmetszes,
_ => throw new ValidationException("invalid kepzettseg: " + kepzettseg),
};
}
public static string Convert(this Kepzettseg1E kepzettseg)
{
return kepzettseg switch
{
Kepzettseg1E.Alkimia => "k_alkimia",
Kepzettseg1E.Alcazas => "k_alcazas",
Kepzettseg1E.Allatidomitas => "k_allatidomitas",
Kepzettseg1E.Csapdak => "k_csapdak",
Kepzettseg1E.Csillagjoslas => "k_csillagjoslas",
Kepzettseg1E.Egyensulyozas => "k_egyensulyozas",
Kepzettseg1E.Eloadas => "k_eloadas",
Kepzettseg1E.Ertekbecsles => "k_ertekbecsles",
Kepzettseg1E.Gyogyitas => "k_gyogyitas",
Kepzettseg1E.Hajozas => "k_hajozas",
Kepzettseg1E.Hallgatozas => "k_hallgatozas",
Kepzettseg1E.Hamisitas => "k_hamisitas",
Kepzettseg1E.JelekOlvasasa => "k_jelek_olvasasa",
Kepzettseg1E.Koncentracio => "k_koncentracio",
Kepzettseg1E.Lovaglas => "k_lovaglas",
Kepzettseg1E.Maszas => "k_maszas",
Kepzettseg1E.Megfigyeles => "k_megfigyeles",
Kepzettseg1E.Meregkeveres => "k_meregkeveres",
Kepzettseg1E.Mesterseg => "k_mesterseg",
Kepzettseg1E.Nyomkereses => "k_nyomkereses",
Kepzettseg1E.Osonas => "k_osonas",
Kepzettseg1E.Rejtozes => "k_rejtozes",
Kepzettseg1E.Szabadulomuveszet => "k_szabadulomuveszet",
Kepzettseg1E.Tudas => "k_tudas",
Kepzettseg1E.Ugras => "k_ugras",
Kepzettseg1E.Uszas => "k_uszas",
Kepzettseg1E.Varazslatismeret => "k_varazslatismeret",
Kepzettseg1E.Zarnyitas => "k_zarnyitas",
Kepzettseg1E.Zsebmetszes => "k_zsebmetszes",
_ => throw new ValidationException("invalid kepzettseg: " + kepzettseg),
};
}
public static string Convert(this Kepzettseg2E kepzettseg)
{
return kepzettseg switch
{
Kepzettseg2E.Alkimia => "k_alkimia",
Kepzettseg2E.Alcazas => "k_alcazas",
Kepzettseg2E.Allatidomitas => "k_allatidomitas",
Kepzettseg2E.Csapdak => "k_csapdak",
Kepzettseg2E.Csillagjoslas => "k_csillagjoslas",
Kepzettseg2E.Egyensulyozas => "k_egyensulyozas",
Kepzettseg2E.Eloadas => "k_eloadas",
Kepzettseg2E.Ertekbecsles => "k_ertekbecsles",
Kepzettseg2E.Gyogyitas => "k_gyogyitas",
Kepzettseg2E.Hajozas => "k_hajozas",
Kepzettseg2E.Hallgatozas => "k_hallgatozas",
Kepzettseg2E.Hamisitas => "k_hamisitas",
Kepzettseg2E.Herbalizmus => "k_herbalizmus",
Kepzettseg2E.Historia => "k_historia",
Kepzettseg2E.JelekOlvasasa => "k_jelek_olvasasa",
Kepzettseg2E.Lovaglas => "k_lovaglas",
Kepzettseg2E.Maszas => "k_maszas",
Kepzettseg2E.Megfigyeles => "k_megfigyeles",
Kepzettseg2E.Meregkeveres => "k_meregkeveres",
Kepzettseg2E.Mesterseg => "k_mesterseg",
Kepzettseg2E.Nyomkereses => "k_nyomkereses",
Kepzettseg2E.Okkultizmus => "k_okkultizmus",
Kepzettseg2E.Osonas => "k_osonas",
Kepzettseg2E.Szabadulomuveszet => "k_szabadulomuveszet",
Kepzettseg2E.Ugras => "k_ugras",
Kepzettseg2E.Uszas => "k_uszas",
Kepzettseg2E.Vadonjaras => "k_vadonjaras",
Kepzettseg2E.Zarnyitas => "k_zarnyitas",
Kepzettseg2E.Zsebmetszes => "k_zsebmetszes",
_ => throw new ValidationException("invalid kepzettseg: " + kepzettseg),
};
}
}
+32
View File
@@ -0,0 +1,32 @@
namespace Kemkas.Web.Db.Enums;
public enum Osztaly1E
{
Error = 0, // for unset enum value mapping
Harcos = 1,
Ijasz = 2,
Amazon = 3,
Kaloz = 4,
Barbar = 5,
Pap = 6,
Tolvaj = 7,
Varazslo = 8,
Illuzionista = 9,
}
public enum Osztaly2E
{
Error = 0, // for unset enum value mapping
Harcos = 1,
Ijasz = 2,
Amazon = 3,
Tengeresz = 4,
Barbar = 5,
Pap = 6,
Tolvaj = 7,
Varazslo = 8,
Illuzionista = 9,
Dalnok = 10,
Druida = 11,
Vandor = 12,
}
+80
View File
@@ -0,0 +1,80 @@
using System.ComponentModel.DataAnnotations;
namespace Kemkas.Web.Db.Enums;
public static class OsztalyExtensions
{
public static Osztaly1E Convert1E(string osztaly)
{
return osztaly switch
{
"o_harcos" => Osztaly1E.Harcos,
"o_ijasz" => Osztaly1E.Ijasz,
"o_amazon" => Osztaly1E.Amazon,
"o_kaloz" => Osztaly1E.Kaloz,
"o_barbar" => Osztaly1E.Barbar,
"o_pap" => Osztaly1E.Pap,
"o_tolvaj" => Osztaly1E.Tolvaj,
"o_varazslo" => Osztaly1E.Varazslo,
"o_illuzionista" => Osztaly1E.Illuzionista,
_ => throw new ValidationException("unknown osztaly: " + osztaly)
};
}
public static Osztaly2E Convert2E(string osztaly)
{
return osztaly switch
{
"o_2e_harcos" => Osztaly2E.Harcos,
"o_2e_ijasz" => Osztaly2E.Ijasz,
"o_2e_amazon" => Osztaly2E.Amazon,
"o_2e_tengeresz" => Osztaly2E.Tengeresz,
"o_2e_barbar" => Osztaly2E.Barbar,
"o_2e_pap" => Osztaly2E.Pap,
"o_2e_tolvaj" => Osztaly2E.Tolvaj,
"o_2e_varazslo" => Osztaly2E.Varazslo,
"o_2e_illuzionista" => Osztaly2E.Illuzionista,
"o_2e_dalnok" => Osztaly2E.Dalnok,
"o_2e_druida" => Osztaly2E.Druida,
"o_2e_vandor" => Osztaly2E.Vandor,
_ => throw new ValidationException("unknown osztaly: " + osztaly)
};
}
public static string Convert(this Osztaly1E osztaly)
{
return osztaly switch
{
Osztaly1E.Harcos => "o_harcos",
Osztaly1E.Ijasz => "o_ijasz",
Osztaly1E.Amazon => "o_amazon",
Osztaly1E.Kaloz => "o_kaloz",
Osztaly1E.Barbar => "o_barbar",
Osztaly1E.Pap => "o_pap",
Osztaly1E.Tolvaj => "o_tolvaj",
Osztaly1E.Varazslo => "o_varazslo",
Osztaly1E.Illuzionista => "o_illuzionista",
_ => throw new ValidationException("invalid osztaly!")
};
}
public static string Convert(this Osztaly2E osztaly)
{
return osztaly switch
{
Osztaly2E.Harcos => "o_2e_harcos",
Osztaly2E.Ijasz => "o_2e_ijasz",
Osztaly2E.Amazon => "o_2e_amazon",
Osztaly2E.Tengeresz => "o_2e_tengeresz",
Osztaly2E.Barbar => "o_2e_barbar",
Osztaly2E.Pap => "o_2e_pap",
Osztaly2E.Tolvaj => "o_2e_tolvaj",
Osztaly2E.Varazslo => "o_2e_varazslo",
Osztaly2E.Illuzionista => "o_2e_illuzionista",
Osztaly2E.Dalnok => "o_2e_dalnok",
Osztaly2E.Druida => "o_2e_druida",
Osztaly2E.Vandor => "o_2e_vandor",
_ => throw new ValidationException("invalid osztaly!")
};
}
}
+12
View File
@@ -0,0 +1,12 @@
namespace Kemkas.Web.Db.Enums;
[Flags]
public enum Tulajdonsag : byte
{
Ero = 1,
Ugyesseg = 2,
Egeszseg = 4,
Intelligencia = 8,
Bolcsesseg = 16,
Karizma = 32,
}
@@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
namespace Kemkas.Web.Db.Enums;
public static class TulajdonsagExtensions
{
public static Tulajdonsag Convert(string tulajdonsag)
{
return tulajdonsag switch
{
"t_ero" => Tulajdonsag.Ero,
"t_ugy" => Tulajdonsag.Ugyesseg,
"t_egs" => Tulajdonsag.Egeszseg,
"t_int" => Tulajdonsag.Intelligencia,
"t_bol" => Tulajdonsag.Bolcsesseg,
"t_kar" => Tulajdonsag.Karizma,
_ => throw new ValidationException("invalid tulajdonsag: " + tulajdonsag),
};
}
public static string Convert(this Tulajdonsag tulajdonsag)
{
return tulajdonsag switch
{
Tulajdonsag.Ero => "t_ero",
Tulajdonsag.Ugyesseg => "t_ugy",
Tulajdonsag.Egeszseg => "t_egs",
Tulajdonsag.Intelligencia => "t_int",
Tulajdonsag.Bolcsesseg => "t_bol",
Tulajdonsag.Karizma => "t_kar",
_ => throw new ValidationException("invalid tulajdonsag: " + tulajdonsag),
};
}
}
@@ -0,0 +1,284 @@
// <auto-generated />
using System;
using Kemkas.Web.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20231215102054_Initial")]
partial class Initial
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,225 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
/// <inheritdoc />
public partial class Initial : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
PasswordHash = table.Column<string>(type: "text", nullable: true),
SecurityStamp = table.Column<string>(type: "text", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
PhoneNumber = table.Column<string>(type: "text", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RoleId = table.Column<int>(type: "integer", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column<int>(type: "integer", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ProviderKey = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
UserId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column<int>(type: "integer", nullable: false),
RoleId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<int>(type: "integer", nullable: false),
LoginProvider = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Value = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AspNetRoleClaims_RoleId",
table: "AspNetRoleClaims",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AspNetUserClaims_UserId",
table: "AspNetUserClaims",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserLogins_UserId",
table: "AspNetUserLogins",
column: "UserId");
migrationBuilder.CreateIndex(
name: "IX_AspNetUserRoles_RoleId",
table: "AspNetUserRoles",
column: "RoleId");
migrationBuilder.CreateIndex(
name: "EmailIndex",
table: "AspNetUsers",
column: "NormalizedEmail");
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AspNetRoleClaims");
migrationBuilder.DropTable(
name: "AspNetUserClaims");
migrationBuilder.DropTable(
name: "AspNetUserLogins");
migrationBuilder.DropTable(
name: "AspNetUserRoles");
migrationBuilder.DropTable(
name: "AspNetUserTokens");
migrationBuilder.DropTable(
name: "AspNetRoles");
migrationBuilder.DropTable(
name: "AspNetUsers");
}
}
}
@@ -0,0 +1,476 @@
// <auto-generated />
using System;
using Kemkas.Web.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20231216232129_AddV1Character")]
partial class AddV1Character
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsFegyver")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Felszerelesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<byte>("Bolcsesseg")
.HasColumnType("smallint");
b.Property<byte>("Egeszseg")
.HasColumnType("smallint");
b.Property<byte>("Ero")
.HasColumnType("smallint");
b.Property<int>("Faj")
.HasColumnType("integer");
b.Property<byte>("Intelligencia")
.HasColumnType("smallint");
b.Property<bool>("IsPublic")
.HasColumnType("boolean");
b.Property<string>("Isten")
.HasColumnType("text");
b.Property<byte>("Jellem")
.HasColumnType("smallint");
b.Property<byte>("Karizma")
.HasColumnType("smallint");
b.Property<double?>("Kor")
.HasColumnType("double precision");
b.Property<string>("Nem")
.HasColumnType("text");
b.Property<string>("Nev")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Osztaly")
.HasColumnType("integer");
b.Property<int?>("OwnerUserId")
.HasColumnType("integer");
b.Property<string>("Pajzs")
.HasColumnType("text");
b.Property<string>("Pancel")
.HasColumnType("text");
b.Property<byte>("Szint")
.HasColumnType("smallint");
b.Property<byte>("Ugyesseg")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("OwnerUserId");
b.ToTable("Karakterek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsTolvajKepzettseg")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<int>("Kepzettseg")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("KarakterKepzettsegek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("FegyverSpecializacio")
.HasColumnType("text");
b.Property<byte>("HpRoll")
.HasColumnType("smallint");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<byte>("KarakterSzint")
.HasColumnType("smallint");
b.Property<byte?>("TulajdonsagNoveles")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Szintlepesek");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Felszereles")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", "OwnerUser")
.WithMany()
.HasForeignKey("OwnerUserId");
b.Navigation("OwnerUser");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("KarakterKepzettsegek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Szintlepesek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Navigation("Felszereles");
b.Navigation("KarakterKepzettsegek");
b.Navigation("Szintlepesek");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,147 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
/// <inheritdoc />
public partial class AddV1Character : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Karakterek",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IsPublic = table.Column<bool>(type: "boolean", nullable: false),
OwnerUserId = table.Column<int>(type: "integer", nullable: true),
Nev = table.Column<string>(type: "text", nullable: false),
Nem = table.Column<string>(type: "text", nullable: true),
Kor = table.Column<double>(type: "double precision", nullable: true),
Jellem = table.Column<byte>(type: "smallint", nullable: false),
Isten = table.Column<string>(type: "text", nullable: true),
Faj = table.Column<int>(type: "integer", nullable: false),
Osztaly = table.Column<int>(type: "integer", nullable: false),
Ero = table.Column<byte>(type: "smallint", nullable: false),
Ugyesseg = table.Column<byte>(type: "smallint", nullable: false),
Egeszseg = table.Column<byte>(type: "smallint", nullable: false),
Intelligencia = table.Column<byte>(type: "smallint", nullable: false),
Bolcsesseg = table.Column<byte>(type: "smallint", nullable: false),
Karizma = table.Column<byte>(type: "smallint", nullable: false),
Szint = table.Column<byte>(type: "smallint", nullable: false),
Pancel = table.Column<string>(type: "text", nullable: true),
Pajzs = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Karakterek", x => x.Id);
table.ForeignKey(
name: "FK_Karakterek_AspNetUsers_OwnerUserId",
column: x => x.OwnerUserId,
principalTable: "AspNetUsers",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Felszerelesek",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
KarakterId = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
IsFegyver = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Felszerelesek", x => x.Id);
table.ForeignKey(
name: "FK_Felszerelesek_Karakterek_KarakterId",
column: x => x.KarakterId,
principalTable: "Karakterek",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "KarakterKepzettsegek",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
KarakterId = table.Column<Guid>(type: "uuid", nullable: false),
Kepzettseg = table.Column<int>(type: "integer", nullable: false),
IsTolvajKepzettseg = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_KarakterKepzettsegek", x => x.Id);
table.ForeignKey(
name: "FK_KarakterKepzettsegek_Karakterek_KarakterId",
column: x => x.KarakterId,
principalTable: "Karakterek",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Szintlepesek",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
KarakterId = table.Column<Guid>(type: "uuid", nullable: false),
KarakterSzint = table.Column<byte>(type: "smallint", nullable: false),
HpRoll = table.Column<byte>(type: "smallint", nullable: false),
TulajdonsagNoveles = table.Column<byte>(type: "smallint", nullable: true),
FegyverSpecializacio = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Szintlepesek", x => x.Id);
table.ForeignKey(
name: "FK_Szintlepesek_Karakterek_KarakterId",
column: x => x.KarakterId,
principalTable: "Karakterek",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Felszerelesek_KarakterId",
table: "Felszerelesek",
column: "KarakterId");
migrationBuilder.CreateIndex(
name: "IX_Karakterek_OwnerUserId",
table: "Karakterek",
column: "OwnerUserId");
migrationBuilder.CreateIndex(
name: "IX_KarakterKepzettsegek_KarakterId",
table: "KarakterKepzettsegek",
column: "KarakterId");
migrationBuilder.CreateIndex(
name: "IX_Szintlepesek_KarakterId",
table: "Szintlepesek",
column: "KarakterId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Felszerelesek");
migrationBuilder.DropTable(
name: "KarakterKepzettsegek");
migrationBuilder.DropTable(
name: "Szintlepesek");
migrationBuilder.DropTable(
name: "Karakterek");
}
}
}
@@ -0,0 +1,495 @@
// <auto-generated />
using System;
using Kemkas.Web.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20231219150639_AddDataProtectionKeys")]
partial class AddDataProtectionKeys
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsFegyver")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Felszerelesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<byte>("Bolcsesseg")
.HasColumnType("smallint");
b.Property<byte>("Egeszseg")
.HasColumnType("smallint");
b.Property<byte>("Ero")
.HasColumnType("smallint");
b.Property<int>("Faj")
.HasColumnType("integer");
b.Property<byte>("Intelligencia")
.HasColumnType("smallint");
b.Property<bool>("IsPublic")
.HasColumnType("boolean");
b.Property<string>("Isten")
.HasColumnType("text");
b.Property<byte>("Jellem")
.HasColumnType("smallint");
b.Property<byte>("Karizma")
.HasColumnType("smallint");
b.Property<double?>("Kor")
.HasColumnType("double precision");
b.Property<string>("Nem")
.HasColumnType("text");
b.Property<string>("Nev")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Osztaly")
.HasColumnType("integer");
b.Property<int?>("OwnerUserId")
.HasColumnType("integer");
b.Property<string>("Pajzs")
.HasColumnType("text");
b.Property<string>("Pancel")
.HasColumnType("text");
b.Property<byte>("Szint")
.HasColumnType("smallint");
b.Property<byte>("Ugyesseg")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("OwnerUserId");
b.ToTable("Karakterek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsTolvajKepzettseg")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<int>("Kepzettseg")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("KarakterKepzettsegek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("FegyverSpecializacio")
.HasColumnType("text");
b.Property<byte>("HpRoll")
.HasColumnType("smallint");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<byte>("KarakterSzint")
.HasColumnType("smallint");
b.Property<byte?>("TulajdonsagNoveles")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Szintlepesek");
});
modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("FriendlyName")
.HasColumnType("text");
b.Property<string>("Xml")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("DataProtectionKeys");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Felszereles")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", "OwnerUser")
.WithMany()
.HasForeignKey("OwnerUserId");
b.Navigation("OwnerUser");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("KarakterKepzettsegek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Szintlepesek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Navigation("Felszereles");
b.Navigation("KarakterKepzettsegek");
b.Navigation("Szintlepesek");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,36 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
/// <inheritdoc />
public partial class AddDataProtectionKeys : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DataProtectionKeys",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
FriendlyName = table.Column<string>(type: "text", nullable: true),
Xml = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DataProtectionKeys", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DataProtectionKeys");
}
}
}
@@ -0,0 +1,690 @@
// <auto-generated />
using System;
using Kemkas.Web.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20240214163223_AddSecondEditionModels")]
partial class AddSecondEditionModels
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsFegyver")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Felszerelesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<byte>("Bolcsesseg")
.HasColumnType("smallint");
b.Property<byte>("Egeszseg")
.HasColumnType("smallint");
b.Property<byte>("Ero")
.HasColumnType("smallint");
b.Property<int>("Faj")
.HasColumnType("integer");
b.Property<byte>("Intelligencia")
.HasColumnType("smallint");
b.Property<bool>("IsPublic")
.HasColumnType("boolean");
b.Property<string>("Isten")
.HasColumnType("text");
b.Property<byte>("Jellem")
.HasColumnType("smallint");
b.Property<byte>("Karizma")
.HasColumnType("smallint");
b.Property<double?>("Kor")
.HasColumnType("double precision");
b.Property<string>("Nem")
.HasColumnType("text");
b.Property<string>("Nev")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Osztaly")
.HasColumnType("integer");
b.Property<int?>("OwnerUserId")
.HasColumnType("integer");
b.Property<string>("Pajzs")
.HasColumnType("text");
b.Property<string>("Pancel")
.HasColumnType("text");
b.Property<byte>("Szint")
.HasColumnType("smallint");
b.Property<byte>("Ugyesseg")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("OwnerUserId");
b.ToTable("Karakterek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsTolvajKepzettseg")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<int>("Kepzettseg")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("KarakterKepzettsegek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("FegyverSpecializacio")
.HasColumnType("text");
b.Property<byte>("HpRoll")
.HasColumnType("smallint");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<byte>("KarakterSzint")
.HasColumnType("smallint");
b.Property<byte?>("TulajdonsagNoveles")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Szintlepesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Felszereles", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsFegyver")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<string>("TargyId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Felszerelesek2E");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Karakter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<byte>("Bolcsesseg")
.HasColumnType("smallint");
b.Property<byte>("Egeszseg")
.HasColumnType("smallint");
b.Property<byte>("Ero")
.HasColumnType("smallint");
b.Property<int>("Faj")
.HasColumnType("integer");
b.Property<byte>("Intelligencia")
.HasColumnType("smallint");
b.Property<bool>("IsPublic")
.HasColumnType("boolean");
b.Property<string>("Isten")
.HasColumnType("text");
b.Property<byte>("Jellem")
.HasColumnType("smallint");
b.Property<byte>("Karizma")
.HasColumnType("smallint");
b.Property<double?>("Kor")
.HasColumnType("double precision");
b.Property<string>("Nem")
.HasColumnType("text");
b.Property<string>("Nev")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("OwnerUserId")
.HasColumnType("integer");
b.Property<string>("Pajzs")
.HasColumnType("text");
b.Property<string>("Pancel")
.HasColumnType("text");
b.Property<byte>("Szint")
.HasColumnType("smallint");
b.Property<byte>("Ugyesseg")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("OwnerUserId");
b.ToTable("Karakterek2E");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2KarakterKepzettseg", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsTolvajKepzettseg")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<int>("Kepzettseg")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("KarakterKepzettsegek2E");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Szintlepes", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("FegyverSpecializacio")
.HasColumnType("text");
b.Property<byte>("HpRoll")
.HasColumnType("smallint");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<byte>("KarakterSzint")
.HasColumnType("smallint");
b.Property<int>("Osztaly")
.HasColumnType("integer");
b.Property<int?>("TolvajExtraKepzettseg")
.HasColumnType("integer");
b.Property<byte?>("TulajdonsagNoveles")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Szintlepesek2E");
});
modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("FriendlyName")
.HasColumnType("text");
b.Property<string>("Xml")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("DataProtectionKeys");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Felszereles")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", "OwnerUser")
.WithMany()
.HasForeignKey("OwnerUserId");
b.Navigation("OwnerUser");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("KarakterKepzettsegek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Szintlepesek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Felszereles", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V2Karakter", "Karakter")
.WithMany("Felszereles")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Karakter", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", "OwnerUser")
.WithMany()
.HasForeignKey("OwnerUserId");
b.Navigation("OwnerUser");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2KarakterKepzettseg", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V2Karakter", "Karakter")
.WithMany("KarakterKepzettsegek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Szintlepes", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V2Karakter", "Karakter")
.WithMany("Szintlepesek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Navigation("Felszereles");
b.Navigation("KarakterKepzettsegek");
b.Navigation("Szintlepesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Karakter", b =>
{
b.Navigation("Felszereles");
b.Navigation("KarakterKepzettsegek");
b.Navigation("Szintlepesek");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,148 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
/// <inheritdoc />
public partial class AddSecondEditionModels : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Karakterek2E",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
IsPublic = table.Column<bool>(type: "boolean", nullable: false),
OwnerUserId = table.Column<int>(type: "integer", nullable: true),
Nev = table.Column<string>(type: "text", nullable: false),
Nem = table.Column<string>(type: "text", nullable: true),
Kor = table.Column<double>(type: "double precision", nullable: true),
Jellem = table.Column<byte>(type: "smallint", nullable: false),
Isten = table.Column<string>(type: "text", nullable: true),
Faj = table.Column<int>(type: "integer", nullable: false),
Ero = table.Column<byte>(type: "smallint", nullable: false),
Ugyesseg = table.Column<byte>(type: "smallint", nullable: false),
Egeszseg = table.Column<byte>(type: "smallint", nullable: false),
Intelligencia = table.Column<byte>(type: "smallint", nullable: false),
Bolcsesseg = table.Column<byte>(type: "smallint", nullable: false),
Karizma = table.Column<byte>(type: "smallint", nullable: false),
Szint = table.Column<byte>(type: "smallint", nullable: false),
Pancel = table.Column<string>(type: "text", nullable: true),
Pajzs = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Karakterek2E", x => x.Id);
table.ForeignKey(
name: "FK_Karakterek2E_AspNetUsers_OwnerUserId",
column: x => x.OwnerUserId,
principalTable: "AspNetUsers",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Felszerelesek2E",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
KarakterId = table.Column<Guid>(type: "uuid", nullable: false),
TargyId = table.Column<string>(type: "text", nullable: false),
IsFegyver = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Felszerelesek2E", x => x.Id);
table.ForeignKey(
name: "FK_Felszerelesek2E_Karakterek2E_KarakterId",
column: x => x.KarakterId,
principalTable: "Karakterek2E",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "KarakterKepzettsegek2E",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
KarakterId = table.Column<Guid>(type: "uuid", nullable: false),
Kepzettseg = table.Column<int>(type: "integer", nullable: false),
IsTolvajKepzettseg = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_KarakterKepzettsegek2E", x => x.Id);
table.ForeignKey(
name: "FK_KarakterKepzettsegek2E_Karakterek2E_KarakterId",
column: x => x.KarakterId,
principalTable: "Karakterek2E",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Szintlepesek2E",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
KarakterId = table.Column<Guid>(type: "uuid", nullable: false),
KarakterSzint = table.Column<byte>(type: "smallint", nullable: false),
Osztaly = table.Column<int>(type: "integer", nullable: false),
HpRoll = table.Column<byte>(type: "smallint", nullable: false),
TulajdonsagNoveles = table.Column<byte>(type: "smallint", nullable: true),
FegyverSpecializacio = table.Column<string>(type: "text", nullable: true),
TolvajExtraKepzettseg = table.Column<int>(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Szintlepesek2E", x => x.Id);
table.ForeignKey(
name: "FK_Szintlepesek2E_Karakterek2E_KarakterId",
column: x => x.KarakterId,
principalTable: "Karakterek2E",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Felszerelesek2E_KarakterId",
table: "Felszerelesek2E",
column: "KarakterId");
migrationBuilder.CreateIndex(
name: "IX_Karakterek2E_OwnerUserId",
table: "Karakterek2E",
column: "OwnerUserId");
migrationBuilder.CreateIndex(
name: "IX_KarakterKepzettsegek2E_KarakterId",
table: "KarakterKepzettsegek2E",
column: "KarakterId");
migrationBuilder.CreateIndex(
name: "IX_Szintlepesek2E_KarakterId",
table: "Szintlepesek2E",
column: "KarakterId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Felszerelesek2E");
migrationBuilder.DropTable(
name: "KarakterKepzettsegek2E");
migrationBuilder.DropTable(
name: "Szintlepesek2E");
migrationBuilder.DropTable(
name: "Karakterek2E");
}
}
}
@@ -0,0 +1,687 @@
// <auto-generated />
using System;
using Kemkas.Web.Db;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Kemkas.Web.Db.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationRole", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasDatabaseName("RoleNameIndex");
b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.ApplicationUser", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AccessFailedCount")
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("NormalizedEmail")
.HasDatabaseName("EmailIndex");
b.HasIndex("NormalizedUserName")
.IsUnique()
.HasDatabaseName("UserNameIndex");
b.ToTable("AspNetUsers", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsFegyver")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Felszerelesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<byte>("Bolcsesseg")
.HasColumnType("smallint");
b.Property<byte>("Egeszseg")
.HasColumnType("smallint");
b.Property<byte>("Ero")
.HasColumnType("smallint");
b.Property<int>("Faj")
.HasColumnType("integer");
b.Property<byte>("Intelligencia")
.HasColumnType("smallint");
b.Property<bool>("IsPublic")
.HasColumnType("boolean");
b.Property<string>("Isten")
.HasColumnType("text");
b.Property<byte>("Jellem")
.HasColumnType("smallint");
b.Property<byte>("Karizma")
.HasColumnType("smallint");
b.Property<double?>("Kor")
.HasColumnType("double precision");
b.Property<string>("Nem")
.HasColumnType("text");
b.Property<string>("Nev")
.IsRequired()
.HasColumnType("text");
b.Property<int>("Osztaly")
.HasColumnType("integer");
b.Property<int?>("OwnerUserId")
.HasColumnType("integer");
b.Property<string>("Pajzs")
.HasColumnType("text");
b.Property<string>("Pancel")
.HasColumnType("text");
b.Property<byte>("Szint")
.HasColumnType("smallint");
b.Property<byte>("Ugyesseg")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("OwnerUserId");
b.ToTable("Karakterek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsTolvajKepzettseg")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<int>("Kepzettseg")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("KarakterKepzettsegek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("FegyverSpecializacio")
.HasColumnType("text");
b.Property<byte>("HpRoll")
.HasColumnType("smallint");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<byte>("KarakterSzint")
.HasColumnType("smallint");
b.Property<byte?>("TulajdonsagNoveles")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Szintlepesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Felszereles", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsFegyver")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<string>("TargyId")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Felszerelesek2E");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Karakter", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<byte>("Bolcsesseg")
.HasColumnType("smallint");
b.Property<byte>("Egeszseg")
.HasColumnType("smallint");
b.Property<byte>("Ero")
.HasColumnType("smallint");
b.Property<int>("Faj")
.HasColumnType("integer");
b.Property<byte>("Intelligencia")
.HasColumnType("smallint");
b.Property<bool>("IsPublic")
.HasColumnType("boolean");
b.Property<string>("Isten")
.HasColumnType("text");
b.Property<byte>("Jellem")
.HasColumnType("smallint");
b.Property<byte>("Karizma")
.HasColumnType("smallint");
b.Property<double?>("Kor")
.HasColumnType("double precision");
b.Property<string>("Nem")
.HasColumnType("text");
b.Property<string>("Nev")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("OwnerUserId")
.HasColumnType("integer");
b.Property<string>("Pajzs")
.HasColumnType("text");
b.Property<string>("Pancel")
.HasColumnType("text");
b.Property<byte>("Szint")
.HasColumnType("smallint");
b.Property<byte>("Ugyesseg")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("OwnerUserId");
b.ToTable("Karakterek2E");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2KarakterKepzettseg", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<bool>("IsTolvajKepzettseg")
.HasColumnType("boolean");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<int>("Kepzettseg")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("KarakterKepzettsegek2E");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Szintlepes", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("FegyverSpecializacio")
.HasColumnType("text");
b.Property<byte>("HpRoll")
.HasColumnType("smallint");
b.Property<Guid>("KarakterId")
.HasColumnType("uuid");
b.Property<byte>("KarakterSzint")
.HasColumnType("smallint");
b.Property<int>("Osztaly")
.HasColumnType("integer");
b.Property<int?>("TolvajExtraKepzettseg")
.HasColumnType("integer");
b.Property<byte?>("TulajdonsagNoveles")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("KarakterId");
b.ToTable("Szintlepesek2E");
});
modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("FriendlyName")
.HasColumnType("text");
b.Property<string>("Xml")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("DataProtectionKeys");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("AspNetUserClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderDisplayName")
.HasColumnType("text");
b.Property<int>("UserId")
.HasColumnType("integer");
b.HasKey("LoginProvider", "ProviderKey");
b.HasIndex("UserId");
b.ToTable("AspNetUserLogins", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<int>("RoleId")
.HasColumnType("integer");
b.HasKey("UserId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("AspNetUserRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.Property<int>("UserId")
.HasColumnType("integer");
b.Property<string>("LoginProvider")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Name")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Value")
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Felszereles", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Felszereles")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", "OwnerUser")
.WithMany()
.HasForeignKey("OwnerUserId");
b.Navigation("OwnerUser");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1KarakterKepzettseg", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("KarakterKepzettsegek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Szintlepes", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V1Karakter", "Karakter")
.WithMany("Szintlepesek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Felszereles", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V2Karakter", "Karakter")
.WithMany("Felszereles")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Karakter", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", "OwnerUser")
.WithMany()
.HasForeignKey("OwnerUserId");
b.Navigation("OwnerUser");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2KarakterKepzettseg", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V2Karakter", "Karakter")
.WithMany("KarakterKepzettsegek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Szintlepes", b =>
{
b.HasOne("Kemkas.Web.Db.Models.V2Karakter", "Karakter")
.WithMany("Szintlepesek")
.HasForeignKey("KarakterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Karakter");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationRole", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<int>", b =>
{
b.HasOne("Kemkas.Web.Db.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V1Karakter", b =>
{
b.Navigation("Felszereles");
b.Navigation("KarakterKepzettsegek");
b.Navigation("Szintlepesek");
});
modelBuilder.Entity("Kemkas.Web.Db.Models.V2Karakter", b =>
{
b.Navigation("Felszereles");
b.Navigation("KarakterKepzettsegek");
b.Navigation("Szintlepesek");
});
#pragma warning restore 612, 618
}
}
}
+8
View File
@@ -0,0 +1,8 @@
using Microsoft.AspNetCore.Identity;
namespace Kemkas.Web.Db.Models;
public class ApplicationRole : IdentityRole<int>
{
}
+7
View File
@@ -0,0 +1,7 @@
using Microsoft.AspNetCore.Identity;
namespace Kemkas.Web.Db.Models;
public class ApplicationUser : IdentityUser<int>
{
}
+17
View File
@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Kemkas.Web.Db.Models;
public class V1Felszereles
{
[Key]
public Guid Id { get; set; }
public Guid KarakterId { get; set; }
public string Name { get; set; }
public bool IsFegyver { get; set; } = true;
[ForeignKey(nameof(KarakterId))]
public virtual V1Karakter Karakter { get; set; }
}
+45
View File
@@ -0,0 +1,45 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Kemkas.Web.Db.Enums;
namespace Kemkas.Web.Db.Models;
/// <summary>
/// 1st edition character sheet
/// </summary>
public class V1Karakter
{
[Key] public Guid Id { get; set; }
public bool IsPublic { get; set; } = false;
public int? OwnerUserId { get; set; }
public string Nev { get; set; }
public string? Nem { get; set; }
public double? Kor { get; set; }
public Jellem Jellem { get; set; } = Jellem.Semleges;
public string? Isten { get; set; }
public Faj1E Faj { get; set; } = Faj1E.Ember;
public Osztaly1E Osztaly { get; set; }
public byte Ero { get; set; }
public byte Ugyesseg { get; set; }
public byte Egeszseg { get; set; }
public byte Intelligencia { get; set; }
public byte Bolcsesseg { get; set; }
public byte Karizma { get; set; }
public byte Szint { get; set; } = 1;
public string? Pancel { get; set; }
public string? Pajzs { get; set; }
[ForeignKey(nameof(OwnerUserId))]
public ApplicationUser? OwnerUser { get; set; }
[InverseProperty(nameof(V1KarakterKepzettseg.Karakter))]
public virtual IEnumerable<V1KarakterKepzettseg> KarakterKepzettsegek { get; set; }
[InverseProperty(nameof(V1Szintlepes.Karakter))]
public virtual IEnumerable<V1Szintlepes> Szintlepesek { get; set; }
[InverseProperty(nameof(V1Felszereles.Karakter))]
public virtual IEnumerable<V1Felszereles> Felszereles { get; set; }
}
@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Kemkas.Web.Db.Enums;
namespace Kemkas.Web.Db.Models;
public class V1KarakterKepzettseg
{
[Key]
public Guid Id { get; set; }
public Guid KarakterId { get; set; }
public Kepzettseg1E Kepzettseg { get; set; }
public bool IsTolvajKepzettseg { get; set; } = false;
[ForeignKey(nameof(KarakterId))]
public virtual V1Karakter Karakter { get; set; }
}
+28
View File
@@ -0,0 +1,28 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Kemkas.Web.Db.Enums;
namespace Kemkas.Web.Db.Models;
public class V1Szintlepes
{
[Key]
public Guid Id { get; set; }
public Guid KarakterId { get; set; }
public byte KarakterSzint { get; set; }
// for multiclass characters
// public Osztaly Osztaly { get; set; }
//
// public byte OsztalySzint { get; set; }
public byte HpRoll { get; set; }
public Tulajdonsag? TulajdonsagNoveles { get; set; }
// used for both Kaloz/Tengeresz and Harcos
public string? FegyverSpecializacio { get; set; }
[ForeignKey(nameof(KarakterId))]
public virtual V1Karakter Karakter { get; set; }
}
+17
View File
@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Kemkas.Web.Db.Models;
public class V2Felszereles
{
[Key]
public Guid Id { get; set; }
public Guid KarakterId { get; set; }
public string TargyId { get; set; }
public bool IsFegyver { get; set; } = true;
[ForeignKey(nameof(KarakterId))]
public virtual V2Karakter Karakter { get; set; }
}
+44
View File
@@ -0,0 +1,44 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Kemkas.Web.Db.Enums;
namespace Kemkas.Web.Db.Models;
/// <summary>
/// 2nd edition character sheet
/// </summary>
public class V2Karakter
{
[Key] public Guid Id { get; set; }
public bool IsPublic { get; set; } = false;
public int? OwnerUserId { get; set; }
public string Nev { get; set; }
public string? Nem { get; set; }
public double? Kor { get; set; }
public Jellem Jellem { get; set; } = Jellem.Semleges;
public string? Isten { get; set; }
public Faj2E Faj { get; set; } = Faj2E.Ember;
public byte Ero { get; set; }
public byte Ugyesseg { get; set; }
public byte Egeszseg { get; set; }
public byte Intelligencia { get; set; }
public byte Bolcsesseg { get; set; }
public byte Karizma { get; set; }
public byte Szint { get; set; } = 1;
public string? Pancel { get; set; }
public string? Pajzs { get; set; }
[ForeignKey(nameof(OwnerUserId))]
public ApplicationUser? OwnerUser { get; set; }
[InverseProperty(nameof(V2KarakterKepzettseg.Karakter))]
public virtual IEnumerable<V2KarakterKepzettseg> KarakterKepzettsegek { get; set; }
[InverseProperty(nameof(V2Szintlepes.Karakter))]
public virtual IEnumerable<V2Szintlepes> Szintlepesek { get; set; }
[InverseProperty(nameof(V2Felszereles.Karakter))]
public virtual IEnumerable<V2Felszereles> Felszereles { get; set; }
}
@@ -0,0 +1,17 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Kemkas.Web.Db.Enums;
namespace Kemkas.Web.Db.Models;
public class V2KarakterKepzettseg
{
[Key]
public Guid Id { get; set; }
public Guid KarakterId { get; set; }
public Kepzettseg2E Kepzettseg { get; set; }
public bool IsTolvajKepzettseg { get; set; } = false;
[ForeignKey(nameof(KarakterId))]
public virtual V2Karakter Karakter { get; set; }
}
+29
View File
@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Kemkas.Web.Db.Enums;
namespace Kemkas.Web.Db.Models;
public class V2Szintlepes
{
[Key]
public Guid Id { get; set; }
public Guid KarakterId { get; set; }
// this is also used for ordering the level ups
public byte KarakterSzint { get; set; }
public Osztaly2E Osztaly { get; set; }
public byte HpRoll { get; set; }
public Tulajdonsag? TulajdonsagNoveles { get; set; }
// used for both Kaloz/Tengeresz and Harcos
public string? FegyverSpecializacio { get; set; }
// for the 9th level Tolvaj specialty
public Kepzettseg2E? TolvajExtraKepzettseg { get; set; }
[ForeignKey(nameof(KarakterId))]
public virtual V2Karakter Karakter { get; set; }
}