diff --git a/SCHALE.Common/Database/SCHALEContext.cs b/SCHALE.Common/Database/SCHALEContext.cs index f6aff9e..8b13cef 100644 --- a/SCHALE.Common/Database/SCHALEContext.cs +++ b/SCHALE.Common/Database/SCHALEContext.cs @@ -11,25 +11,29 @@ namespace SCHALE.Common.Database public DbSet GuestAccounts { get; set; } public DbSet Accounts { get; set; } public DbSet MissionProgresses { get; set; } - + public DbSet Items { get; set; } public DbSet Characters { get; set; } public DbSet Equipment { get; set; } public DbSet Weapons { get; set; } public DbSet Gears { get; set; } - + public DbSet MemoryLobbies { get; set; } public DbSet Scenarios { get; set; } public DbSet Echelons { get; set; } public DbSet AccountTutorials { get; set; } - + public static SCHALEContext Create(string connectionString) => new(new DbContextOptionsBuilder() .UseSqlServer(connectionString) .Options); - public SCHALEContext(DbContextOptions options) : base(options) + public SCHALEContext() + { + } + + public SCHALEContext(DbContextOptions options) : base(options) { } @@ -100,6 +104,24 @@ namespace SCHALE.Common.Database } } + public class SCHALESqliteContext : SCHALEContext + { + public SCHALESqliteContext() { } + + public SCHALESqliteContext(DbContextOptions options) : base(options) + { + } + + public static SCHALESqliteContext Create(string connectionString) => + new(new DbContextOptionsBuilder() + .UseSqlite(connectionString).Options); + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseSqlite("Data Source=schale.sqlite3"); + } + } + public static class PropertyBuilderExtensions { public static PropertyBuilder HasJsonConversion(this PropertyBuilder propertyBuilder) where T : class, new() diff --git a/SCHALE.Common/Database/ServicesExtesions.cs b/SCHALE.Common/Database/ServicesExtesions.cs deleted file mode 100644 index bfe04f3..0000000 --- a/SCHALE.Common/Database/ServicesExtesions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; - -namespace SCHALE.Common.Database -{ - public static class ServicesExtesions - { - public static void AddSQLServerProvider(this IServiceCollection services, string connectionString) - { - services.AddDbContext(o => - { - o.UseSqlServer(connectionString, b => - { - b.EnableRetryOnFailure(5, TimeSpan.FromSeconds(10), null); - }) - .UseLazyLoadingProxies(); - }, ServiceLifetime.Singleton, ServiceLifetime.Singleton); - } - } -} diff --git a/SCHALE.Common/Database/dbs.cs b/SCHALE.Common/Database/dbs.cs index 4294923..be4147b 100644 --- a/SCHALE.Common/Database/dbs.cs +++ b/SCHALE.Common/Database/dbs.cs @@ -323,7 +323,7 @@ namespace SCHALE.Common.Database { [JsonIgnore] public virtual ICollection Items { get; } - + [JsonIgnore] public virtual ICollection Characters { get; } @@ -351,9 +351,19 @@ namespace SCHALE.Common.Database [JsonIgnore] public virtual RaidInfo RaidInfo { get; set; } - public AccountDB() { } + public AccountDB() { + Items = new List(); + Characters = new List(); + MissionProgresses = new List(); + Echelons = new List(); + Equipment = new List(); + Weapons = new List(); + Gears = new List(); + MemoryLobbies = new List(); + Scenarios = new List(); + } - public AccountDB(long publisherAccountId) + public AccountDB(long publisherAccountId) : this() { PublisherAccountId = publisherAccountId; State = AccountState.Normal; diff --git a/SCHALE.Common/Migrations/20240501053823_Init.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501053823_Init.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240501053823_Init.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501053823_Init.Designer.cs index e882550..2ebb0a4 100644 --- a/SCHALE.Common/Migrations/20240501053823_Init.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501053823_Init.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240501053823_Init")] diff --git a/SCHALE.Common/Migrations/20240501053823_Init.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501053823_Init.cs similarity index 99% rename from SCHALE.Common/Migrations/20240501053823_Init.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501053823_Init.cs index d4892d1..11f3b19 100644 --- a/SCHALE.Common/Migrations/20240501053823_Init.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501053823_Init.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class Init : Migration diff --git a/SCHALE.Common/Migrations/20240501071717_CharacterAndRelations.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501071717_CharacterAndRelations.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240501071717_CharacterAndRelations.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501071717_CharacterAndRelations.Designer.cs index 6743cb0..4a7f1e4 100644 --- a/SCHALE.Common/Migrations/20240501071717_CharacterAndRelations.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501071717_CharacterAndRelations.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240501071717_CharacterAndRelations")] diff --git a/SCHALE.Common/Migrations/20240501071717_CharacterAndRelations.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501071717_CharacterAndRelations.cs similarity index 98% rename from SCHALE.Common/Migrations/20240501071717_CharacterAndRelations.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501071717_CharacterAndRelations.cs index 2951d03..b761ba8 100644 --- a/SCHALE.Common/Migrations/20240501071717_CharacterAndRelations.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501071717_CharacterAndRelations.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class CharacterAndRelations : Migration diff --git a/SCHALE.Common/Migrations/20240501081158_UnMapIsNew.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501081158_UnMapIsNew.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240501081158_UnMapIsNew.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501081158_UnMapIsNew.Designer.cs index 7aecfbd..d62b8c4 100644 --- a/SCHALE.Common/Migrations/20240501081158_UnMapIsNew.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501081158_UnMapIsNew.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240501081158_UnMapIsNew")] diff --git a/SCHALE.Common/Migrations/20240501081158_UnMapIsNew.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501081158_UnMapIsNew.cs similarity index 92% rename from SCHALE.Common/Migrations/20240501081158_UnMapIsNew.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501081158_UnMapIsNew.cs index 9d0dc9c..561593d 100644 --- a/SCHALE.Common/Migrations/20240501081158_UnMapIsNew.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501081158_UnMapIsNew.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class UnMapIsNew : Migration diff --git a/SCHALE.Common/Migrations/20240501090227_Echelons.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501090227_Echelons.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240501090227_Echelons.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501090227_Echelons.Designer.cs index b235b9d..7fb51e7 100644 --- a/SCHALE.Common/Migrations/20240501090227_Echelons.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501090227_Echelons.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240501090227_Echelons")] diff --git a/SCHALE.Common/Migrations/20240501090227_Echelons.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240501090227_Echelons.cs similarity index 97% rename from SCHALE.Common/Migrations/20240501090227_Echelons.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240501090227_Echelons.cs index caf953b..bfe4faf 100644 --- a/SCHALE.Common/Migrations/20240501090227_Echelons.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240501090227_Echelons.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class Echelons : Migration diff --git a/SCHALE.Common/Migrations/20240510003553_Equipment.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240510003553_Equipment.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240510003553_Equipment.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240510003553_Equipment.Designer.cs index 83fbeb0..60505db 100644 --- a/SCHALE.Common/Migrations/20240510003553_Equipment.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240510003553_Equipment.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240510003553_Equipment")] diff --git a/SCHALE.Common/Migrations/20240510003553_Equipment.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240510003553_Equipment.cs similarity index 97% rename from SCHALE.Common/Migrations/20240510003553_Equipment.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240510003553_Equipment.cs index 00a5861..bf9032a 100644 --- a/SCHALE.Common/Migrations/20240510003553_Equipment.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240510003553_Equipment.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class Equipment : Migration diff --git a/SCHALE.Common/Migrations/20240510093842_Weapons.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240510093842_Weapons.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240510093842_Weapons.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240510093842_Weapons.Designer.cs index 9b5a4be..43758d2 100644 --- a/SCHALE.Common/Migrations/20240510093842_Weapons.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240510093842_Weapons.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240510093842_Weapons")] diff --git a/SCHALE.Common/Migrations/20240510093842_Weapons.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240510093842_Weapons.cs similarity index 97% rename from SCHALE.Common/Migrations/20240510093842_Weapons.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240510093842_Weapons.cs index 4987e51..696a489 100644 --- a/SCHALE.Common/Migrations/20240510093842_Weapons.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240510093842_Weapons.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class Weapons : Migration diff --git a/SCHALE.Common/Migrations/20240511074956_Account_RaidSeasonId.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240511074956_Account_RaidSeasonId.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240511074956_Account_RaidSeasonId.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240511074956_Account_RaidSeasonId.Designer.cs index 0434d57..5bff5cc 100644 --- a/SCHALE.Common/Migrations/20240511074956_Account_RaidSeasonId.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240511074956_Account_RaidSeasonId.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240511074956_Account_RaidSeasonId")] diff --git a/SCHALE.Common/Migrations/20240511074956_Account_RaidSeasonId.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240511074956_Account_RaidSeasonId.cs similarity index 93% rename from SCHALE.Common/Migrations/20240511074956_Account_RaidSeasonId.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240511074956_Account_RaidSeasonId.cs index 4a71b0e..04b709a 100644 --- a/SCHALE.Common/Migrations/20240511074956_Account_RaidSeasonId.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240511074956_Account_RaidSeasonId.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class Account_RaidSeasonId : Migration diff --git a/SCHALE.Common/Migrations/20240518014039_Gears.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240518014039_Gears.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240518014039_Gears.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240518014039_Gears.Designer.cs index 1fd7446..2bc4356 100644 --- a/SCHALE.Common/Migrations/20240518014039_Gears.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240518014039_Gears.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240518014039_Gears")] diff --git a/SCHALE.Common/Migrations/20240518014039_Gears.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240518014039_Gears.cs similarity index 97% rename from SCHALE.Common/Migrations/20240518014039_Gears.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240518014039_Gears.cs index 264b4d4..90f577d 100644 --- a/SCHALE.Common/Migrations/20240518014039_Gears.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240518014039_Gears.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class Gears : Migration diff --git a/SCHALE.Common/Migrations/20240519215605_AccountDB_RaidInfo.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240519215605_AccountDB_RaidInfo.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240519215605_AccountDB_RaidInfo.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240519215605_AccountDB_RaidInfo.Designer.cs index 07a03e1..f038c58 100644 --- a/SCHALE.Common/Migrations/20240519215605_AccountDB_RaidInfo.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240519215605_AccountDB_RaidInfo.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240519215605_AccountDB_RaidInfo")] diff --git a/SCHALE.Common/Migrations/20240519215605_AccountDB_RaidInfo.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240519215605_AccountDB_RaidInfo.cs similarity index 95% rename from SCHALE.Common/Migrations/20240519215605_AccountDB_RaidInfo.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240519215605_AccountDB_RaidInfo.cs index 7bb4ea0..a424ac4 100644 --- a/SCHALE.Common/Migrations/20240519215605_AccountDB_RaidInfo.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240519215605_AccountDB_RaidInfo.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class AccountDB_RaidInfo : Migration diff --git a/SCHALE.Common/Migrations/20240522122813_EchelonDB_CombatStyleIndex.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240522122813_EchelonDB_CombatStyleIndex.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240522122813_EchelonDB_CombatStyleIndex.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240522122813_EchelonDB_CombatStyleIndex.Designer.cs index 35cf28d..5515868 100644 --- a/SCHALE.Common/Migrations/20240522122813_EchelonDB_CombatStyleIndex.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240522122813_EchelonDB_CombatStyleIndex.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240522122813_EchelonDB_CombatStyleIndex")] diff --git a/SCHALE.Common/Migrations/20240522122813_EchelonDB_CombatStyleIndex.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240522122813_EchelonDB_CombatStyleIndex.cs similarity index 93% rename from SCHALE.Common/Migrations/20240522122813_EchelonDB_CombatStyleIndex.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240522122813_EchelonDB_CombatStyleIndex.cs index 28e27d9..0cb6ddc 100644 --- a/SCHALE.Common/Migrations/20240522122813_EchelonDB_CombatStyleIndex.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240522122813_EchelonDB_CombatStyleIndex.cs @@ -2,7 +2,7 @@ #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class EchelonDB_CombatStyleIndex : Migration diff --git a/SCHALE.Common/Migrations/20240530042248_MemoryLobby_and_Scenario.Designer.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240530042248_MemoryLobby_and_Scenario.Designer.cs similarity index 99% rename from SCHALE.Common/Migrations/20240530042248_MemoryLobby_and_Scenario.Designer.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240530042248_MemoryLobby_and_Scenario.Designer.cs index 4fd8785..192db83 100644 --- a/SCHALE.Common/Migrations/20240530042248_MemoryLobby_and_Scenario.Designer.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240530042248_MemoryLobby_and_Scenario.Designer.cs @@ -9,7 +9,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] [Migration("20240530042248_MemoryLobby_and_Scenario")] diff --git a/SCHALE.Common/Migrations/20240530042248_MemoryLobby_and_Scenario.cs b/SCHALE.Common/Migrations/SqlServerMigrations/20240530042248_MemoryLobby_and_Scenario.cs similarity index 98% rename from SCHALE.Common/Migrations/20240530042248_MemoryLobby_and_Scenario.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/20240530042248_MemoryLobby_and_Scenario.cs index ad454b7..b236b06 100644 --- a/SCHALE.Common/Migrations/20240530042248_MemoryLobby_and_Scenario.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/20240530042248_MemoryLobby_and_Scenario.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class MemoryLobby_and_Scenario : Migration diff --git a/SCHALE.Common/Migrations/SCHALEContextModelSnapshot.cs b/SCHALE.Common/Migrations/SqlServerMigrations/SCHALEContextModelSnapshot.cs similarity index 99% rename from SCHALE.Common/Migrations/SCHALEContextModelSnapshot.cs rename to SCHALE.Common/Migrations/SqlServerMigrations/SCHALEContextModelSnapshot.cs index 81ede21..c3741a4 100644 --- a/SCHALE.Common/Migrations/SCHALEContextModelSnapshot.cs +++ b/SCHALE.Common/Migrations/SqlServerMigrations/SCHALEContextModelSnapshot.cs @@ -8,7 +8,7 @@ using SCHALE.Common.Database; #nullable disable -namespace SCHALE.Common.Migrations +namespace SCHALE.Common.Migrations.SqlServerMigrations { [DbContext(typeof(SCHALEContext))] partial class SCHALEContextModelSnapshot : ModelSnapshot diff --git a/SCHALE.Common/Migrations/SqliteMigrations/20240601161847_InitialMigration.Designer.cs b/SCHALE.Common/Migrations/SqliteMigrations/20240601161847_InitialMigration.Designer.cs new file mode 100644 index 0000000..2949668 --- /dev/null +++ b/SCHALE.Common/Migrations/SqliteMigrations/20240601161847_InitialMigration.Designer.cs @@ -0,0 +1,567 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SCHALE.Common.Database; + +#nullable disable + +namespace SCHALE.Common.Migrations.SqliteMigrations +{ + [DbContext(typeof(SCHALESqliteContext))] + [Migration("20240601161847_InitialMigration")] + partial class InitialMigration + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "8.0.6"); + + modelBuilder.Entity("SCHALE.Common.Database.AccountDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BirthDay") + .HasColumnType("TEXT"); + + b.Property("CallName") + .HasColumnType("TEXT"); + + b.Property("CallNameUpdateTime") + .HasColumnType("TEXT"); + + b.Property("Comment") + .HasColumnType("TEXT"); + + b.Property("CreateDate") + .HasColumnType("TEXT"); + + b.Property("DevId") + .HasColumnType("TEXT"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("LastConnectTime") + .HasColumnType("TEXT"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("LinkRewardDate") + .HasColumnType("TEXT"); + + b.Property("LobbyMode") + .HasColumnType("INTEGER"); + + b.Property("MemoryLobbyUniqueId") + .HasColumnType("INTEGER"); + + b.Property("Nickname") + .HasColumnType("TEXT"); + + b.Property("PublisherAccountId") + .HasColumnType("INTEGER"); + + b.Property("RaidInfo") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("RepresentCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("RetentionDays") + .HasColumnType("INTEGER"); + + b.Property("State") + .HasColumnType("INTEGER"); + + b.Property("UnReadMailCount") + .HasColumnType("INTEGER"); + + b.Property("VIPLevel") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.ToTable("Accounts"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.CharacterDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("EquipmentServerIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("EquipmentSlotAndDBIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ExSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("ExtraPassiveSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("FavorExp") + .HasColumnType("INTEGER"); + + b.Property("FavorRank") + .HasColumnType("INTEGER"); + + b.Property("IsFavorite") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("LeaderSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("PassiveSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("PotentialStats") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PublicSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("StarGrade") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EchelonDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("CombatStyleIndex") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("EchelonNumber") + .HasColumnType("INTEGER"); + + b.Property("EchelonType") + .HasColumnType("INTEGER"); + + b.Property("ExtensionType") + .HasColumnType("INTEGER"); + + b.Property("LeaderServerId") + .HasColumnType("INTEGER"); + + b.Property("MainSlotServerIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SkillCardMulliganCharacterIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SupportSlotServerIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TSSInteractionServerId") + .HasColumnType("INTEGER"); + + b.Property("UsingFlag") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Echelons"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EquipmentDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("BoundCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("StackCount") + .HasColumnType("INTEGER"); + + b.Property("Tier") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Equipment"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.GearDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("BoundCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("SlotIndex") + .HasColumnType("INTEGER"); + + b.Property("Tier") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Gears"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ItemDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("StackCount") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Items"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MemoryLobbyDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("MemoryLobbyUniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("MemoryLobbies"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MissionProgressDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("Complete") + .HasColumnType("INTEGER"); + + b.Property("MissionUniqueId") + .HasColumnType("INTEGER"); + + b.Property("ProgressParameters") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("StartTime") + .HasColumnType("TEXT"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("MissionProgresses"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.Models.AccountTutorial", b => + { + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("TutorialIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("AccountServerId"); + + b.ToTable("AccountTutorials"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.Models.GuestAccount", b => + { + b.Property("Uid") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DeviceId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Token") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Uid"); + + b.ToTable("GuestAccounts"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ScenarioHistoryDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("ClearDateTime") + .HasColumnType("TEXT"); + + b.Property("ScenarioUniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Scenarios"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.WeaponDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("BoundCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("StarGrade") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Weapons"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.CharacterDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Characters") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EchelonDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Echelons") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EquipmentDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Equipment") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.GearDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Gears") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ItemDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Items") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MemoryLobbyDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("MemoryLobbies") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MissionProgressDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("MissionProgresses") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ScenarioHistoryDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Scenarios") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.WeaponDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Weapons") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.AccountDB", b => + { + b.Navigation("Characters"); + + b.Navigation("Echelons"); + + b.Navigation("Equipment"); + + b.Navigation("Gears"); + + b.Navigation("Items"); + + b.Navigation("MemoryLobbies"); + + b.Navigation("MissionProgresses"); + + b.Navigation("Scenarios"); + + b.Navigation("Weapons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SCHALE.Common/Migrations/SqliteMigrations/20240601161847_InitialMigration.cs b/SCHALE.Common/Migrations/SqliteMigrations/20240601161847_InitialMigration.cs new file mode 100644 index 0000000..db9d42e --- /dev/null +++ b/SCHALE.Common/Migrations/SqliteMigrations/20240601161847_InitialMigration.cs @@ -0,0 +1,384 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SCHALE.Common.Migrations.SqliteMigrations +{ + /// + public partial class InitialMigration : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Accounts", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + RaidInfo = table.Column(type: "TEXT", nullable: false), + Nickname = table.Column(type: "TEXT", nullable: true), + CallName = table.Column(type: "TEXT", nullable: true), + DevId = table.Column(type: "TEXT", nullable: true), + State = table.Column(type: "INTEGER", nullable: false), + Level = table.Column(type: "INTEGER", nullable: false), + Exp = table.Column(type: "INTEGER", nullable: false), + Comment = table.Column(type: "TEXT", nullable: true), + LobbyMode = table.Column(type: "INTEGER", nullable: false), + RepresentCharacterServerId = table.Column(type: "INTEGER", nullable: false), + MemoryLobbyUniqueId = table.Column(type: "INTEGER", nullable: false), + LastConnectTime = table.Column(type: "TEXT", nullable: false), + BirthDay = table.Column(type: "TEXT", nullable: true), + CallNameUpdateTime = table.Column(type: "TEXT", nullable: false), + PublisherAccountId = table.Column(type: "INTEGER", nullable: false), + RetentionDays = table.Column(type: "INTEGER", nullable: true), + VIPLevel = table.Column(type: "INTEGER", nullable: true), + CreateDate = table.Column(type: "TEXT", nullable: false), + UnReadMailCount = table.Column(type: "INTEGER", nullable: true), + LinkRewardDate = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Accounts", x => x.ServerId); + }); + + migrationBuilder.CreateTable( + name: "AccountTutorials", + columns: table => new + { + AccountServerId = table.Column(type: "INTEGER", nullable: false), + TutorialIds = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AccountTutorials", x => x.AccountServerId); + }); + + migrationBuilder.CreateTable( + name: "GuestAccounts", + columns: table => new + { + Uid = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + DeviceId = table.Column(type: "TEXT", nullable: false), + Token = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_GuestAccounts", x => x.Uid); + }); + + migrationBuilder.CreateTable( + name: "Characters", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + UniqueId = table.Column(type: "INTEGER", nullable: false), + StarGrade = table.Column(type: "INTEGER", nullable: false), + Level = table.Column(type: "INTEGER", nullable: false), + Exp = table.Column(type: "INTEGER", nullable: false), + FavorRank = table.Column(type: "INTEGER", nullable: false), + FavorExp = table.Column(type: "INTEGER", nullable: false), + PublicSkillLevel = table.Column(type: "INTEGER", nullable: false), + ExSkillLevel = table.Column(type: "INTEGER", nullable: false), + PassiveSkillLevel = table.Column(type: "INTEGER", nullable: false), + ExtraPassiveSkillLevel = table.Column(type: "INTEGER", nullable: false), + LeaderSkillLevel = table.Column(type: "INTEGER", nullable: false), + IsLocked = table.Column(type: "INTEGER", nullable: false), + IsFavorite = table.Column(type: "INTEGER", nullable: false), + EquipmentServerIds = table.Column(type: "TEXT", nullable: false), + PotentialStats = table.Column(type: "TEXT", nullable: false), + EquipmentSlotAndDBIds = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Characters", x => x.ServerId); + table.ForeignKey( + name: "FK_Characters_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Echelons", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + EchelonType = table.Column(type: "INTEGER", nullable: false), + EchelonNumber = table.Column(type: "INTEGER", nullable: false), + ExtensionType = table.Column(type: "INTEGER", nullable: false), + LeaderServerId = table.Column(type: "INTEGER", nullable: false), + MainSlotServerIds = table.Column(type: "TEXT", nullable: false), + SupportSlotServerIds = table.Column(type: "TEXT", nullable: false), + TSSInteractionServerId = table.Column(type: "INTEGER", nullable: false), + UsingFlag = table.Column(type: "INTEGER", nullable: false), + SkillCardMulliganCharacterIds = table.Column(type: "TEXT", nullable: false), + CombatStyleIndex = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Echelons", x => x.ServerId); + table.ForeignKey( + name: "FK_Echelons_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Equipment", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Level = table.Column(type: "INTEGER", nullable: false), + Exp = table.Column(type: "INTEGER", nullable: false), + Tier = table.Column(type: "INTEGER", nullable: false), + BoundCharacterServerId = table.Column(type: "INTEGER", nullable: false), + IsLocked = table.Column(type: "INTEGER", nullable: false), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + UniqueId = table.Column(type: "INTEGER", nullable: false), + StackCount = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Equipment", x => x.ServerId); + table.ForeignKey( + name: "FK_Equipment_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Gears", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + UniqueId = table.Column(type: "INTEGER", nullable: false), + Level = table.Column(type: "INTEGER", nullable: false), + Exp = table.Column(type: "INTEGER", nullable: false), + Tier = table.Column(type: "INTEGER", nullable: false), + SlotIndex = table.Column(type: "INTEGER", nullable: false), + BoundCharacterServerId = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Gears", x => x.ServerId); + table.ForeignKey( + name: "FK_Gears_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Items", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + IsLocked = table.Column(type: "INTEGER", nullable: false), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + UniqueId = table.Column(type: "INTEGER", nullable: false), + StackCount = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Items", x => x.ServerId); + table.ForeignKey( + name: "FK_Items_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "MemoryLobbies", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + MemoryLobbyUniqueId = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_MemoryLobbies", x => x.ServerId); + table.ForeignKey( + name: "FK_MemoryLobbies_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "MissionProgresses", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + MissionUniqueId = table.Column(type: "INTEGER", nullable: false), + Complete = table.Column(type: "INTEGER", nullable: false), + StartTime = table.Column(type: "TEXT", nullable: false), + ProgressParameters = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_MissionProgresses", x => x.ServerId); + table.ForeignKey( + name: "FK_MissionProgresses_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Scenarios", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + ScenarioUniqueId = table.Column(type: "INTEGER", nullable: false), + ClearDateTime = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Scenarios", x => x.ServerId); + table.ForeignKey( + name: "FK_Scenarios_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Weapons", + columns: table => new + { + ServerId = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + AccountServerId = table.Column(type: "INTEGER", nullable: false), + UniqueId = table.Column(type: "INTEGER", nullable: false), + Level = table.Column(type: "INTEGER", nullable: false), + Exp = table.Column(type: "INTEGER", nullable: false), + StarGrade = table.Column(type: "INTEGER", nullable: false), + BoundCharacterServerId = table.Column(type: "INTEGER", nullable: false), + IsLocked = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Weapons", x => x.ServerId); + table.ForeignKey( + name: "FK_Weapons_Accounts_AccountServerId", + column: x => x.AccountServerId, + principalTable: "Accounts", + principalColumn: "ServerId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Characters_AccountServerId", + table: "Characters", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_Echelons_AccountServerId", + table: "Echelons", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_Equipment_AccountServerId", + table: "Equipment", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_Gears_AccountServerId", + table: "Gears", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_Items_AccountServerId", + table: "Items", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_MemoryLobbies_AccountServerId", + table: "MemoryLobbies", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_MissionProgresses_AccountServerId", + table: "MissionProgresses", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_Scenarios_AccountServerId", + table: "Scenarios", + column: "AccountServerId"); + + migrationBuilder.CreateIndex( + name: "IX_Weapons_AccountServerId", + table: "Weapons", + column: "AccountServerId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AccountTutorials"); + + migrationBuilder.DropTable( + name: "Characters"); + + migrationBuilder.DropTable( + name: "Echelons"); + + migrationBuilder.DropTable( + name: "Equipment"); + + migrationBuilder.DropTable( + name: "Gears"); + + migrationBuilder.DropTable( + name: "GuestAccounts"); + + migrationBuilder.DropTable( + name: "Items"); + + migrationBuilder.DropTable( + name: "MemoryLobbies"); + + migrationBuilder.DropTable( + name: "MissionProgresses"); + + migrationBuilder.DropTable( + name: "Scenarios"); + + migrationBuilder.DropTable( + name: "Weapons"); + + migrationBuilder.DropTable( + name: "Accounts"); + } + } +} diff --git a/SCHALE.Common/Migrations/SqliteMigrations/SCHALESqliteContextModelSnapshot.cs b/SCHALE.Common/Migrations/SqliteMigrations/SCHALESqliteContextModelSnapshot.cs new file mode 100644 index 0000000..6586679 --- /dev/null +++ b/SCHALE.Common/Migrations/SqliteMigrations/SCHALESqliteContextModelSnapshot.cs @@ -0,0 +1,564 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SCHALE.Common.Database; + +#nullable disable + +namespace SCHALE.Common.Migrations.SqliteMigrations +{ + [DbContext(typeof(SCHALESqliteContext))] + partial class SCHALESqliteContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "8.0.6"); + + modelBuilder.Entity("SCHALE.Common.Database.AccountDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("BirthDay") + .HasColumnType("TEXT"); + + b.Property("CallName") + .HasColumnType("TEXT"); + + b.Property("CallNameUpdateTime") + .HasColumnType("TEXT"); + + b.Property("Comment") + .HasColumnType("TEXT"); + + b.Property("CreateDate") + .HasColumnType("TEXT"); + + b.Property("DevId") + .HasColumnType("TEXT"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("LastConnectTime") + .HasColumnType("TEXT"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("LinkRewardDate") + .HasColumnType("TEXT"); + + b.Property("LobbyMode") + .HasColumnType("INTEGER"); + + b.Property("MemoryLobbyUniqueId") + .HasColumnType("INTEGER"); + + b.Property("Nickname") + .HasColumnType("TEXT"); + + b.Property("PublisherAccountId") + .HasColumnType("INTEGER"); + + b.Property("RaidInfo") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("RepresentCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("RetentionDays") + .HasColumnType("INTEGER"); + + b.Property("State") + .HasColumnType("INTEGER"); + + b.Property("UnReadMailCount") + .HasColumnType("INTEGER"); + + b.Property("VIPLevel") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.ToTable("Accounts"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.CharacterDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("EquipmentServerIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("EquipmentSlotAndDBIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("ExSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("ExtraPassiveSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("FavorExp") + .HasColumnType("INTEGER"); + + b.Property("FavorRank") + .HasColumnType("INTEGER"); + + b.Property("IsFavorite") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("LeaderSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("PassiveSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("PotentialStats") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PublicSkillLevel") + .HasColumnType("INTEGER"); + + b.Property("StarGrade") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EchelonDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("CombatStyleIndex") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("EchelonNumber") + .HasColumnType("INTEGER"); + + b.Property("EchelonType") + .HasColumnType("INTEGER"); + + b.Property("ExtensionType") + .HasColumnType("INTEGER"); + + b.Property("LeaderServerId") + .HasColumnType("INTEGER"); + + b.Property("MainSlotServerIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SkillCardMulliganCharacterIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("SupportSlotServerIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("TSSInteractionServerId") + .HasColumnType("INTEGER"); + + b.Property("UsingFlag") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Echelons"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EquipmentDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("BoundCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("StackCount") + .HasColumnType("INTEGER"); + + b.Property("Tier") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Equipment"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.GearDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("BoundCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("SlotIndex") + .HasColumnType("INTEGER"); + + b.Property("Tier") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Gears"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ItemDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("StackCount") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Items"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MemoryLobbyDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("MemoryLobbyUniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("MemoryLobbies"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MissionProgressDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("Complete") + .HasColumnType("INTEGER"); + + b.Property("MissionUniqueId") + .HasColumnType("INTEGER"); + + b.Property("ProgressParameters") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("StartTime") + .HasColumnType("TEXT"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("MissionProgresses"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.Models.AccountTutorial", b => + { + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("TutorialIds") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("AccountServerId"); + + b.ToTable("AccountTutorials"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.Models.GuestAccount", b => + { + b.Property("Uid") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("DeviceId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Token") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Uid"); + + b.ToTable("GuestAccounts"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ScenarioHistoryDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("ClearDateTime") + .HasColumnType("TEXT"); + + b.Property("ScenarioUniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Scenarios"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.WeaponDB", b => + { + b.Property("ServerId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AccountServerId") + .HasColumnType("INTEGER"); + + b.Property("BoundCharacterServerId") + .HasColumnType("INTEGER"); + + b.Property("Exp") + .HasColumnType("INTEGER"); + + b.Property("IsLocked") + .HasColumnType("INTEGER"); + + b.Property("Level") + .HasColumnType("INTEGER"); + + b.Property("StarGrade") + .HasColumnType("INTEGER"); + + b.Property("UniqueId") + .HasColumnType("INTEGER"); + + b.HasKey("ServerId"); + + b.HasIndex("AccountServerId"); + + b.ToTable("Weapons"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.CharacterDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Characters") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EchelonDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Echelons") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.EquipmentDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Equipment") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.GearDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Gears") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ItemDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Items") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MemoryLobbyDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("MemoryLobbies") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.MissionProgressDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("MissionProgresses") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.ScenarioHistoryDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Scenarios") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.WeaponDB", b => + { + b.HasOne("SCHALE.Common.Database.AccountDB", "Account") + .WithMany("Weapons") + .HasForeignKey("AccountServerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Account"); + }); + + modelBuilder.Entity("SCHALE.Common.Database.AccountDB", b => + { + b.Navigation("Characters"); + + b.Navigation("Echelons"); + + b.Navigation("Equipment"); + + b.Navigation("Gears"); + + b.Navigation("Items"); + + b.Navigation("MemoryLobbies"); + + b.Navigation("MissionProgresses"); + + b.Navigation("Scenarios"); + + b.Navigation("Weapons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SCHALE.Common/SCHALE.Common.csproj b/SCHALE.Common/SCHALE.Common.csproj index 05b2b83..492cb67 100644 --- a/SCHALE.Common/SCHALE.Common.csproj +++ b/SCHALE.Common/SCHALE.Common.csproj @@ -14,6 +14,7 @@ all + diff --git a/SCHALE.GameServer.sln b/SCHALE.GameServer.sln index f973c9e..ee9bd08 100644 --- a/SCHALE.GameServer.sln +++ b/SCHALE.GameServer.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34309.116 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCHALE.GameServer", "SCHALE.GameServer\SCHALE.GameServer.csproj", "{FA808FE1-3F81-4AFC-9FBE-8662B9781EF8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCHALE.GameServer", "SCHALE.GameServer\SCHALE.GameServer.csproj", "{FA808FE1-3F81-4AFC-9FBE-8662B9781EF8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCHALE.Common", "SCHALE.Common\SCHALE.Common.csproj", "{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SCHALE.Common", "SCHALE.Common\SCHALE.Common.csproj", "{D8ED8CB5-EA39-46BE-9236-7FC1F46FE15B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/SCHALE.GameServer/.gitignore b/SCHALE.GameServer/.gitignore new file mode 100644 index 0000000..eb0c65a --- /dev/null +++ b/SCHALE.GameServer/.gitignore @@ -0,0 +1 @@ +schale.sqlite3* diff --git a/SCHALE.GameServer/GameServer.cs b/SCHALE.GameServer/GameServer.cs index 27944e7..99a54c4 100644 --- a/SCHALE.GameServer/GameServer.cs +++ b/SCHALE.GameServer/GameServer.cs @@ -81,12 +81,7 @@ namespace SCHALE.GameServer builder.Host.UseSerilog(); // Add services to the container. - builder.Services.AddSQLServerProvider( - config.GetConnectionString("SQLServer") - ?? throw new ArgumentNullException( - "ConnectionStrings/SQLServer in appsettings is missing" - ) - ); + builder.Services.AddDbProvider(config); builder.Services.AddControllers(); builder.Services.AddProtocolHandlerFactory(); builder.Services.AddMemorySessionKeyService(); diff --git a/SCHALE.GameServer/Utils/ServiceExtensions.cs b/SCHALE.GameServer/Utils/ServiceExtensions.cs new file mode 100644 index 0000000..bb071f0 --- /dev/null +++ b/SCHALE.GameServer/Utils/ServiceExtensions.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore; +using SCHALE.Common.Database; + +namespace SCHALE.GameServer.Utils +{ + public static class ServicesExtesions + { + public static Exception NoConnectionStringException = new ArgumentNullException($"ConnectionString in appsettings is missing"); + + public static void AddDbProvider(this IServiceCollection services, IConfiguration conf) + { + var sqlProvider = conf.GetValue("SQL Provider"); + switch (sqlProvider) + { + case "SQLite3": + services.AddDbContext(opt => + opt + .UseSqlite(conf.GetConnectionString("SQLite3") ?? throw NoConnectionStringException) + .UseLazyLoadingProxies() + , ServiceLifetime.Singleton, ServiceLifetime.Singleton); + break; + case "SQLServer": + services.AddDbContext(opt => + opt + .UseSqlServer(conf.GetConnectionString("SQLServer") ?? throw NoConnectionStringException, + actions => + { + actions.EnableRetryOnFailure(5, TimeSpan.FromSeconds(10), null); + }) + .UseLazyLoadingProxies() + , ServiceLifetime.Singleton, ServiceLifetime.Singleton); + break; + default: throw new ArgumentException($"SQL Provider '{sqlProvider}' is not valid"); + } + } + } +} \ No newline at end of file diff --git a/SCHALE.GameServer/appsettings.Docker.json b/SCHALE.GameServer/appsettings.Docker.json index 0d673bb..71df955 100644 --- a/SCHALE.GameServer/appsettings.Docker.json +++ b/SCHALE.GameServer/appsettings.Docker.json @@ -1,5 +1,7 @@ { + "SQL Provider": "SQLServer", "ConnectionStrings": { + "SQLite3": "Data Source=schale.sqlite3", "SQLServer": "data source=db;User=sa;Password=5CH41364M353rV3r;initial catalog=schale;trusted_connection=false;TrustServerCertificate=True" } } diff --git a/SCHALE.GameServer/appsettings.json b/SCHALE.GameServer/appsettings.json index 5d0385f..28bd5bf 100644 --- a/SCHALE.GameServer/appsettings.json +++ b/SCHALE.GameServer/appsettings.json @@ -15,7 +15,9 @@ } } }, + "SQL Provider": "SQLServer", "ConnectionStrings": { + "SQLite3": "Data Source=schale.sqlite3", "SQLServer": "data source=localhost\\SQLEXPRESS;initial catalog=schale;trusted_connection=true;TrustServerCertificate=True" }, "AllowedHosts": "*"