diff --git a/Icarus/Database/Contexts/AccessLevelContext.cs b/Icarus/Database/Contexts/AccessLevelContext.cs new file mode 100644 index 0000000..44412cd --- /dev/null +++ b/Icarus/Database/Contexts/AccessLevelContext.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore; + +using Icarus.Models; + +namespace Icarus.Database.Contexts; + + +public class AccessLevelContext : DbContext { + public DbSet AccessLevels { get; set; } + + public AccessLevelContext(string connString) : base(new DbContextOptionsBuilder() + .UseMySQL(connString).Options) + { + + } + + #region Methods + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + } + #endregion +} \ No newline at end of file diff --git a/Models/AccessLevel.cs b/Models/AccessLevel.cs new file mode 100644 index 0000000..0980895 --- /dev/null +++ b/Models/AccessLevel.cs @@ -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 +} \ No newline at end of file diff --git a/Scripts/Migrations/Linux/AddUpdate.sh b/Scripts/Migrations/Linux/AddUpdate.sh index ed4ba7b..6c8f01a 100755 --- a/Scripts/Migrations/Linux/AddUpdate.sh +++ b/Scripts/Migrations/Linux/AddUpdate.sh @@ -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