mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Started layout editor implementation
Rearranged VMs/Views Updated RGB.NET
This commit is contained in:
1 parent
390dcc6ae1
commit
6e23c079b1
52 files changed
+741
-185
No files matched your search
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Artemis.Storage.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SQLitePCL;
|
||||
|
||||
namespace Artemis.Storage
|
||||
{
|
||||
@@ -10,23 +10,26 @@ namespace Artemis.Storage
|
||||
{
|
||||
public DbSet<ProfileEntity> Profiles { get; set; }
|
||||
public DbSet<SettingEntity> Settings { get; set; }
|
||||
public DbSet<PluginSettingEntity> PluginSettings { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
#if DEBUG
|
||||
// var dbLocation = @"C:\Repos\Artemis\src\Artemis.Storage\Storage.db";
|
||||
#if DEBUG
|
||||
var dbLocation = Path.GetFullPath(Path.Combine(Assembly.GetEntryAssembly().Location, @"..\..\..\..\Artemis.Storage\Storage.db"));
|
||||
#else
|
||||
#else
|
||||
var dbLocation = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\Artemis\\Storage.db";
|
||||
#endif
|
||||
#endif
|
||||
optionsBuilder.UseSqlite("Data Source=" + dbLocation);
|
||||
|
||||
// Requires Microsoft.Data.Sqlite in the startup project
|
||||
SQLitePCL.Batteries.Init();
|
||||
Batteries.Init();
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.Entity<SettingEntity>().HasKey(s => new {s.Name, s.PluginGuid});
|
||||
modelBuilder.Entity<SettingEntity>().HasKey(s => s.Name);
|
||||
modelBuilder.Entity<PluginSettingEntity>().HasKey(s => new {s.Name, s.PluginGuid});
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user