tsk-76: Added model and context for AccessLevel #108

Merged
kdeng00 merged 14 commits from tsk-76 into master 2025-03-11 21:45:32 -04:00
3 changed files with 40 additions and 0 deletions
Showing only changes of commit 16eec3e9e2 - Show all commits
@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore;
using Icarus.Models;
namespace Icarus.Database.Contexts;
public class AccessLevelContext : DbContext {
public DbSet<AccessLevel> AccessLevels { get; set; }
public AccessLevelContext(string connString) : base(new DbContextOptionsBuilder<AccessLevelContext>()
.UseMySQL(connString).Options)
{
}
#region Methods
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
}
#endregion
}
+14
View File
@@ -0,0 +1,14 @@
using System.ComponentModel.DataAnnotations.Schema;
namespace Icarus.Models;
public class AccessLevel {
#region Properties
[Newtonsoft.Json.JsonProperty("id")]
public int Id { get; set; }
[Newtonsoft.Json.JsonProperty("level")]
public string Level { get; set; }
[Newtonsoft.Json.JsonProperty("song_id")]
public int SongId { get; set; }
#endregion
}
+4
View File
@@ -12,6 +12,8 @@ echo "Adding Cover art migration"
dotnet dotnet-ef migrations add CoverArt --context CoverArtContext
echo "Adding Song migration"
dotnet dotnet-ef migrations add Song --context SongContext
echo "Adding AccessLevel migration"
dotnet dotnet-ef migrations add AccessLevel --context AccessLevelContext
echo "Updating migrations.."
echo "Updating User migration"
@@ -26,4 +28,6 @@ echo "Updating Cover art migration"
dotnet dotnet-ef database update --context CoverArtContext
echo "Updating Song migration"
dotnet dotnet-ef database update --context SongContext
echo "Updating AccessLevel migration"
dotnet dotnet-ef database update --context AccessLevelContext