Add project files.
This commit is contained in:
148
Gready_Poang.DataLayer/DataClasses/CombinedRepository.cs
Normal file
148
Gready_Poang.DataLayer/DataClasses/CombinedRepository.cs
Normal file
@ -0,0 +1,148 @@
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using GreadyPoang.EntityLayer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GreadyPoang.DataLayer;
|
||||
|
||||
public class CombinedRepository : ICombinedRepository
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
|
||||
public CombinedRepository(DataContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
|
||||
public IEnumerable<RoundBuilderElement> roundBuilderElements()
|
||||
{
|
||||
var latestGamePoints = _context.GamePoints
|
||||
.AsEnumerable()
|
||||
.GroupBy(gp => new { gp.GameRoundId, gp.ParticipantId })
|
||||
.Select(g => g.OrderByDescending(gp => gp.GamePointId).First())
|
||||
.ToList();
|
||||
|
||||
var gamerounds = _context.GameRounds.AsEnumerable();
|
||||
var participants = _context.Participants.AsEnumerable();
|
||||
|
||||
var result = (from gameRound in gamerounds
|
||||
join gamePoint in latestGamePoints on gameRound.GameRoundId equals gamePoint.GameRoundId
|
||||
join participant in participants on gamePoint.ParticipantId equals participant.ParticipantId
|
||||
orderby gameRound.GameRoundStartDate descending, participant.LastName, participant.FirstName, gamePoint.GameRoundRegNr
|
||||
select new RoundBuilderElement
|
||||
{
|
||||
ParticipantId = participant.ParticipantId,
|
||||
ParticipantName = participant.LastNameFirstName,
|
||||
GamePointId = gamePoint.GamePointId,
|
||||
GameRoundRegNr = gamePoint.GameRoundRegNr,
|
||||
GameRegPoints = gamePoint.GameRegPoints,
|
||||
GameRoundId = gameRound.GameRoundId,
|
||||
GameRoundStartDate = gameRound.GameRoundStartDate,
|
||||
Status = gameRound.GameStatus
|
||||
}).ToList();
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
public IEnumerable<RoundBuilderElement> roundBuilderElementsDb()
|
||||
{
|
||||
var result = _context.RoundBuilderElements
|
||||
.FromSqlRaw(@"
|
||||
SELECT
|
||||
gp.GamePointId,
|
||||
gp.GameRoundId,
|
||||
gp.GameRoundRegNr,
|
||||
latest.totPoints as GameRegPoints,
|
||||
gr.GameRoundStartDate,
|
||||
gr.GameStatus AS Status,
|
||||
p.ParticipantId,
|
||||
(p.LastName || ' ' || p.FirstName) AS ParticipantName
|
||||
FROM GamePoints gp
|
||||
INNER JOIN (
|
||||
SELECT ParticipantId, GameRoundId, MAX(GamePointId) AS MaxGamePointId , sum(GameRegPoints) AS totPoints
|
||||
FROM GamePoints
|
||||
GROUP BY ParticipantId, GameRoundId
|
||||
) latest ON gp.GamePointId = latest.MaxGamePointId
|
||||
INNER JOIN GameRounds gr ON gp.GameRoundId = gr.GameRoundId
|
||||
INNER JOIN Participants p ON gp.ParticipantId = p.ParticipantId
|
||||
ORDER BY gr.GameRoundStartDate DESC, p.LastName, p.FirstName, gp.GameRoundRegNr
|
||||
")
|
||||
.ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
public IEnumerable<RoundBuilderElement> roundBuilderElementsDbById(int GameId)
|
||||
{
|
||||
var result = _context.RoundBuilderElements
|
||||
.FromSql($@"
|
||||
SELECT
|
||||
gp.GamePointId,
|
||||
gp.GameRoundId,
|
||||
gp.GameRoundRegNr,
|
||||
gp.GameRegPoints,
|
||||
gr.GameRoundStartDate,
|
||||
gr.GameStatus AS Status,
|
||||
p.ParticipantId,
|
||||
(p.LastName || ' ' || p.FirstName) AS ParticipantName
|
||||
FROM GamePoints gp
|
||||
INNER JOIN (
|
||||
SELECT ParticipantId, GameRoundId, MAX(GamePointId) AS MaxGamePointId
|
||||
FROM GamePoints
|
||||
GROUP BY ParticipantId, GameRoundId
|
||||
) latest ON gp.GamePointId = latest.MaxGamePointId
|
||||
INNER JOIN GameRounds gr ON gp.GameRoundId = gr.GameRoundId
|
||||
INNER JOIN Participants p ON gp.ParticipantId = p.ParticipantId
|
||||
WHERE gp.GameRoundId = {GameId.ToString()}
|
||||
ORDER BY gr.GameRoundStartDate DESC, p.LastName, p.FirstName, gp.GameRoundRegNr
|
||||
")
|
||||
.ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
public IEnumerable<RoundBuilderElement> roundBuilderElementsTotal()
|
||||
{
|
||||
|
||||
var result = (from gameRound in _context.GameRounds
|
||||
join gamePoint in _context.GamePoints on gameRound.GameRoundId equals gamePoint.GameRoundId
|
||||
join participant in _context.Participants on gamePoint.ParticipantId equals participant.ParticipantId
|
||||
orderby gameRound.GameRoundStartDate descending, participant.LastName, participant.FirstName, gamePoint.GameRoundRegNr
|
||||
select new RoundBuilderElement
|
||||
{
|
||||
ParticipantId = participant.ParticipantId,
|
||||
ParticipantName = participant.LastNameFirstName,
|
||||
GamePointId = gamePoint.GamePointId,
|
||||
GameRoundRegNr = gamePoint.GameRoundRegNr,
|
||||
GameRegPoints = gamePoint.GameRegPoints,
|
||||
GameRoundId = gameRound.GameRoundId,
|
||||
GameRoundStartDate = gameRound.GameRoundStartDate,
|
||||
Status = gameRound.GameStatus
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public IEnumerable<RoundBuilderElement> roundBuilderElementsTotalById(int roundId)
|
||||
{
|
||||
|
||||
var result = (from gameRound in _context.GameRounds
|
||||
join gamePoint in _context.GamePoints on gameRound.GameRoundId equals gamePoint.GameRoundId
|
||||
join participant in _context.Participants on gamePoint.ParticipantId equals participant.ParticipantId
|
||||
where gameRound.GameRoundId == roundId
|
||||
orderby gameRound.GameRoundStartDate descending, participant.LastName, participant.FirstName, gamePoint.GameRoundRegNr
|
||||
select new RoundBuilderElement
|
||||
{
|
||||
ParticipantId = participant.ParticipantId,
|
||||
ParticipantName = participant.LastNameFirstName,
|
||||
GamePointId = gamePoint.GamePointId,
|
||||
GameRoundRegNr = gamePoint.GameRoundRegNr,
|
||||
GameRegPoints = gamePoint.GameRegPoints,
|
||||
GameRoundId = gameRound.GameRoundId,
|
||||
GameRoundStartDate = gameRound.GameRoundStartDate,
|
||||
Status = gameRound.GameStatus
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
83
Gready_Poang.DataLayer/DataClasses/GamePointRepository.cs
Normal file
83
Gready_Poang.DataLayer/DataClasses/GamePointRepository.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using Common.Library;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using GreadyPoang.EntityLayer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GreadyPoang.DataLayer;
|
||||
|
||||
public class GamePointRepository : IRepository<GamePoint>
|
||||
{
|
||||
private readonly DataContext _dataContext;
|
||||
|
||||
public GamePointRepository(DataContext dataContext)
|
||||
{
|
||||
_dataContext = dataContext;
|
||||
}
|
||||
public async Task<IEnumerable<GamePoint>> Get()
|
||||
{
|
||||
return await _dataContext.GamePoints.ToListAsync();
|
||||
}
|
||||
public async Task<GamePoint?> Get(int id)
|
||||
{
|
||||
return await _dataContext.GamePoints.FindAsync(id);
|
||||
}
|
||||
public async Task<int> Save(GamePoint entity)
|
||||
{
|
||||
var res = -1;
|
||||
if ((entity.GameRoundRegNr == 0)
|
||||
&& (entity.GameRegPoints == 0))
|
||||
{
|
||||
return res; // Validation failed
|
||||
}
|
||||
|
||||
if (entity.GamePointId == 0)
|
||||
{
|
||||
_dataContext.GamePoints.Add(entity);
|
||||
await _dataContext.SaveChangesAsync();
|
||||
res = entity.GamePointId;
|
||||
}
|
||||
else
|
||||
{
|
||||
_dataContext.GamePoints.Update(entity);
|
||||
await _dataContext.SaveChangesAsync();
|
||||
res = entity.GamePointId;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public bool Delete(GamePoint entity)
|
||||
{
|
||||
var res = false;
|
||||
try
|
||||
{
|
||||
_dataContext.GamePoints.Remove(entity);
|
||||
_dataContext.SaveChangesAsync();
|
||||
res = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Error deleting participant: {ex.Message}");
|
||||
res = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteById(int Id)
|
||||
{
|
||||
var ok = false;
|
||||
var delObject = await this.Get(Id);
|
||||
if (delObject != null)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
ok = this.Delete(delObject);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("Unsuccessful remove of GamePoint: " + ex.Message);
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
81
Gready_Poang.DataLayer/DataClasses/GameRoundRepository.cs
Normal file
81
Gready_Poang.DataLayer/DataClasses/GameRoundRepository.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using Common.Library;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using GreadyPoang.EntityLayer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GreadyPoang.DataLayer;
|
||||
|
||||
public class GameRoundRepository : IRepository<GameRound>
|
||||
{
|
||||
private readonly DataContext _dataContext;
|
||||
|
||||
public GameRoundRepository(DataContext dataContext)
|
||||
{
|
||||
_dataContext = dataContext;
|
||||
}
|
||||
|
||||
public bool Delete(GameRound entity)
|
||||
{
|
||||
var res = false;
|
||||
try
|
||||
{
|
||||
_dataContext.GameRounds.Remove(entity);
|
||||
_dataContext.SaveChanges();
|
||||
res = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Error deleting GameRound: {ex.Message}");
|
||||
res = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<GameRound>> Get()
|
||||
{
|
||||
return await _dataContext.GameRounds.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<GameRound?> Get(int id)
|
||||
{
|
||||
return await _dataContext.GameRounds.FindAsync(id);
|
||||
}
|
||||
|
||||
public async Task<int> Save(GameRound entity)
|
||||
{
|
||||
var res = -1;
|
||||
if (entity.GameRoundId == 0)
|
||||
{
|
||||
_dataContext.GameRounds.Add(entity);
|
||||
await _dataContext.SaveChangesAsync();
|
||||
res = entity.GameRoundId;
|
||||
}
|
||||
else
|
||||
{
|
||||
_dataContext.GameRounds.Update(entity);
|
||||
await _dataContext.SaveChangesAsync();
|
||||
res = entity.GameRoundId;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteById(int Id)
|
||||
{
|
||||
var ok = false;
|
||||
var delObject = await this.Get(Id);
|
||||
if (delObject != null)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
ok = this.Delete(delObject);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("Unsuccessful remove of GameRound: " + ex.Message);
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
||||
46
Gready_Poang.DataLayer/DataClasses/LocalDbService.cs
Normal file
46
Gready_Poang.DataLayer/DataClasses/LocalDbService.cs
Normal file
@ -0,0 +1,46 @@
|
||||
using GreadyPoang.EntityLayer;
|
||||
using SQLite;
|
||||
|
||||
namespace GreadyPoang.DataLayer;
|
||||
|
||||
public class LocalDbService
|
||||
{
|
||||
private const string DB_NAME = "PoangDB";
|
||||
private readonly SQLiteAsyncConnection _connection;
|
||||
|
||||
public LocalDbService()
|
||||
{
|
||||
//string dbPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), DB_NAME);
|
||||
string dbPath = Path.Combine(FileSystem.Current.AppDataDirectory, DB_NAME);
|
||||
_connection = new SQLiteAsyncConnection(dbPath);
|
||||
_connection.CreateTableAsync<Participant>().Wait();
|
||||
}
|
||||
|
||||
public async Task<List<Participant>> GetParticipantsAsync()
|
||||
{
|
||||
return await _connection.Table<Participant>().ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<Participant?> GetParticipantAsync(int id)
|
||||
{
|
||||
return await _connection.Table<Participant>().Where(p => p.ParticipantId == id).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<int> SaveParticipantAsync(Participant participant)
|
||||
{
|
||||
if (participant.ParticipantId != 0)
|
||||
{
|
||||
return await _connection.UpdateAsync(participant);
|
||||
}
|
||||
else
|
||||
{
|
||||
return await _connection.InsertAsync(participant);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> DeleteParticipantAsync(Participant participant)
|
||||
{
|
||||
return await _connection.DeleteAsync(participant);
|
||||
}
|
||||
|
||||
}
|
||||
84
Gready_Poang.DataLayer/DataClasses/ParticipantRepository.cs
Normal file
84
Gready_Poang.DataLayer/DataClasses/ParticipantRepository.cs
Normal file
@ -0,0 +1,84 @@
|
||||
using Common.Library;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using GreadyPoang.EntityLayer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GreadyPoang.DataLayer;
|
||||
|
||||
public class ParticipantRepository : IRepository<Participant>
|
||||
{
|
||||
private readonly DataContext _dataContext;
|
||||
|
||||
public ParticipantRepository(DataContext dataContext)
|
||||
{
|
||||
_dataContext = dataContext;
|
||||
}
|
||||
public async Task<IEnumerable<Participant>> Get()
|
||||
{
|
||||
return await _dataContext.Participants.ToListAsync();
|
||||
}
|
||||
public async Task<Participant?> Get(int id)
|
||||
{
|
||||
// Fix: Use FindAsync with key value array, not a predicate
|
||||
return await _dataContext.Participants.FindAsync(id);
|
||||
}
|
||||
public async Task<int> Save(Participant entity)
|
||||
{
|
||||
var res = -1;
|
||||
if (string.IsNullOrEmpty(entity.FirstName)
|
||||
|| string.IsNullOrEmpty(entity.LastName))
|
||||
{
|
||||
return res; // Validation failed
|
||||
}
|
||||
|
||||
if (entity.ParticipantId == 0)
|
||||
{
|
||||
_dataContext.Participants.Add(entity);
|
||||
await _dataContext.SaveChangesAsync();
|
||||
res = entity.ParticipantId;
|
||||
}
|
||||
else
|
||||
{
|
||||
_dataContext.Participants.Update(entity);
|
||||
await _dataContext.SaveChangesAsync();
|
||||
res = entity.ParticipantId;
|
||||
}
|
||||
return res;
|
||||
|
||||
}
|
||||
public bool Delete(Participant entity)
|
||||
{
|
||||
var res = false;
|
||||
try
|
||||
{
|
||||
_dataContext.Participants.Remove(entity);
|
||||
_dataContext.SaveChanges();
|
||||
res = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"Error deleting participant: {ex.Message}");
|
||||
res = false;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteById(int Id)
|
||||
{
|
||||
var ok = false;
|
||||
var delObject = await this.Get(Id);
|
||||
if (delObject != null)
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
ok = this.Delete(delObject);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception("Unsuccessful remove of Participant: " + ex.Message);
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
}
|
||||
41
Gready_Poang.DataLayer/Database/DataContext.cs
Normal file
41
Gready_Poang.DataLayer/Database/DataContext.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using GreadyPoang.EntityLayer;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace GreadyPoang.DataLayer.Database;
|
||||
|
||||
public class DataContext : DbContext
|
||||
{
|
||||
public DataContext(DbContextOptions<DataContext> options) : base(options)
|
||||
{
|
||||
|
||||
}
|
||||
//public DbSet<User> Users => Set<User>();
|
||||
public DbSet<Participant> Participants { get; set; }
|
||||
public DbSet<GamePoint> GamePoints { get; set; }
|
||||
public DbSet<GameRound> GameRounds { get; set; }
|
||||
|
||||
public DbSet<RoundBuilderElement> RoundBuilderElements { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
modelBuilder.Entity<Participant>().HasData(
|
||||
new Participant { ParticipantId = 1, FirstName = "John", LastName = "Doe", Email = "John.Doe@gmail.com" },
|
||||
new Participant { ParticipantId = 2, FirstName = "Jane", LastName = "Black", Email = "jb@gmail.com" },
|
||||
new Participant { ParticipantId = 3, FirstName = "Mary", LastName = "White", Email = "mw@gmail.com" }
|
||||
);
|
||||
modelBuilder.Entity<GameRound>().HasData(
|
||||
new GameRound { GameRoundId = 1, GameRoundStartDate = new DateTime(2025, 10, 15, 19, 10, 15), GameRoundFinished = DateTime.MinValue, GameStatus = GamePointStatus.New },
|
||||
new GameRound { GameRoundId = 2, GameRoundStartDate = new DateTime(2025, 09, 15, 19, 10, 15), GameRoundFinished = DateTime.MinValue, GameStatus = GamePointStatus.New },
|
||||
new GameRound { GameRoundId = 3, GameRoundStartDate = new DateTime(2025, 09, 20, 19, 10, 15), GameRoundFinished = DateTime.MinValue, GameStatus = GamePointStatus.New }
|
||||
);
|
||||
modelBuilder.Entity<GamePoint>().HasData(
|
||||
new GamePoint { GamePointId = 1, ParticipantId = 1, GameRoundId = 2, GameDate = new DateTime(2025, 10, 15, 20, 10, 15), GameRoundRegNr = 1, GameRegPoints = 1050 },
|
||||
new GamePoint { GamePointId = 2, ParticipantId = 1, GameRoundId = 2, GameDate = new DateTime(2025, 10, 15, 20, 15, 15), GameRoundRegNr = 3, GameRegPoints = 350 },
|
||||
new GamePoint { GamePointId = 3, ParticipantId = 3, GameRoundId = 2, GameDate = new DateTime(2025, 10, 15, 20, 12, 15), GameRoundRegNr = 2, GameRegPoints = 1000 },
|
||||
new GamePoint { GamePointId = 4, ParticipantId = 3, GameRoundId = 2, GameDate = new DateTime(2025, 10, 15, 20, 20, 15), GameRoundRegNr = 4, GameRegPoints = 400 }
|
||||
);
|
||||
modelBuilder.Entity<RoundBuilderElement>().HasNoKey();
|
||||
}
|
||||
}
|
||||
|
||||
34
Gready_Poang.DataLayer/Gready_Poang.DataLayer.csproj
Normal file
34
Gready_Poang.DataLayer/Gready_Poang.DataLayer.csproj
Normal file
@ -0,0 +1,34 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>
|
||||
net9.0-android;
|
||||
net9.0-ios;
|
||||
net9.0-maccatalyst;
|
||||
net9.0-windows10.0.19041
|
||||
</TargetFrameworks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="DataClasses\LocalDbService.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.8" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.100" />
|
||||
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="2.1.11" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common.Library\Common.Library.csproj" />
|
||||
<ProjectReference Include="..\Gready_Poang.EntityLayer\Gready_Poang.EntityLayer.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -0,0 +1,13 @@
|
||||
|
||||
using GreadyPoang.EntityLayer;
|
||||
|
||||
namespace GreadyPoang.DataLayer;
|
||||
|
||||
public interface ICombinedRepository
|
||||
{
|
||||
IEnumerable<RoundBuilderElement> roundBuilderElements();
|
||||
IEnumerable<RoundBuilderElement> roundBuilderElementsDb();
|
||||
IEnumerable<RoundBuilderElement> roundBuilderElementsDbById(int GameId);
|
||||
IEnumerable<RoundBuilderElement> roundBuilderElementsTotal();
|
||||
IEnumerable<RoundBuilderElement> roundBuilderElementsTotalById(int roundId);
|
||||
}
|
||||
70
Gready_Poang.DataLayer/Migrations/20250901152226_initialCreate.Designer.cs
generated
Normal file
70
Gready_Poang.DataLayer/Migrations/20250901152226_initialCreate.Designer.cs
generated
Normal file
@ -0,0 +1,70 @@
|
||||
// <auto-generated />
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250901152226_initialCreate")]
|
||||
partial class initialCreate
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class initialCreate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Participants",
|
||||
columns: table => new
|
||||
{
|
||||
ParticipantId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
FirstName = table.Column<string>(type: "TEXT", nullable: false),
|
||||
LastName = table.Column<string>(type: "TEXT", nullable: false),
|
||||
Email = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Participants", x => x.ParticipantId);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Participants",
|
||||
columns: new[] { "ParticipantId", "Email", "FirstName", "LastName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "John.Doe@gmail.com", "John", "Doe" },
|
||||
{ 2, "jb@gmail.com", "Jane", "Black" },
|
||||
{ 3, "mw@gmail.com", "Mary", "White" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Participants");
|
||||
}
|
||||
}
|
||||
}
|
||||
135
Gready_Poang.DataLayer/Migrations/20250902115700_GamePointsTable.Designer.cs
generated
Normal file
135
Gready_Poang.DataLayer/Migrations/20250902115700_GamePointsTable.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250902115700_GamePointsTable")]
|
||||
partial class GamePointsTable
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameHeatId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameHeatRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8341),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 1,
|
||||
GameRegPoints = 1050,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8923),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 3,
|
||||
GameRegPoints = 350,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8927),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 2,
|
||||
GameRegPoints = 1000,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8929),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 4,
|
||||
GameRegPoints = 400,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class GamePointsTable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GamePoints",
|
||||
columns: table => new
|
||||
{
|
||||
GamePointId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
ParticipantId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
GameHeatId = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
GameDate = table.Column<DateTime>(type: "TEXT", nullable: false),
|
||||
GameHeatRegNr = table.Column<int>(type: "INTEGER", nullable: false),
|
||||
GameRegPoints = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GamePoints", x => x.GamePointId);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "GamePoints",
|
||||
columns: new[] { "GamePointId", "GameDate", "GameHeatId", "GameHeatRegNr", "GameRegPoints", "ParticipantId" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8341), 0, 1, 1050, 1 },
|
||||
{ 2, new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8923), 0, 3, 350, 1 },
|
||||
{ 3, new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8927), 0, 2, 1000, 3 },
|
||||
{ 4, new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8929), 0, 4, 400, 3 }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GamePoints");
|
||||
}
|
||||
}
|
||||
}
|
||||
135
Gready_Poang.DataLayer/Migrations/20250902120934_GamePointsTableStaticSeed.Designer.cs
generated
Normal file
135
Gready_Poang.DataLayer/Migrations/20250902120934_GamePointsTableStaticSeed.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250902120934_GamePointsTableStaticSeed")]
|
||||
partial class GamePointsTableStaticSeed
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameHeatId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameHeatRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(5394),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 1,
|
||||
GameRegPoints = 1050,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6081),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 3,
|
||||
GameRegPoints = 350,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6085),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 2,
|
||||
GameRegPoints = 1000,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6088),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 4,
|
||||
GameRegPoints = 400,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class GamePointsTableStaticSeed : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 1,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(5394));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 2,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6081));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 3,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6085));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 4,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6088));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 1,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8341));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 2,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8923));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 3,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8927));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 4,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 13, 56, 59, 539, DateTimeKind.Local).AddTicks(8929));
|
||||
}
|
||||
}
|
||||
}
|
||||
135
Gready_Poang.DataLayer/Migrations/20250902122130_FixDateTimeSeed.Designer.cs
generated
Normal file
135
Gready_Poang.DataLayer/Migrations/20250902122130_FixDateTimeSeed.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250902122130_FixDateTimeSeed")]
|
||||
partial class FixDateTimeSeed
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameHeatId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameHeatRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 1,
|
||||
GameRegPoints = 1050,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 3,
|
||||
GameRegPoints = 350,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 2,
|
||||
GameRegPoints = 1000,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 4,
|
||||
GameRegPoints = 400,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixDateTimeSeed : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 1,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 2,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 3,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 4,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 1,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(5394));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 2,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6081));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 3,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6085));
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 4,
|
||||
column: "GameDate",
|
||||
value: new DateTime(2025, 9, 2, 14, 9, 34, 269, DateTimeKind.Local).AddTicks(6088));
|
||||
}
|
||||
}
|
||||
}
|
||||
135
Gready_Poang.DataLayer/Migrations/20250903062957_FixHeatToRoundParameter.Designer.cs
generated
Normal file
135
Gready_Poang.DataLayer/Migrations/20250903062957_FixHeatToRoundParameter.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250903062957_FixHeatToRoundParameter")]
|
||||
partial class FixHeatToRoundParameter
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameHeatId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameHeatRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 1,
|
||||
GameRegPoints = 1050,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 3,
|
||||
GameRegPoints = 350,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 2,
|
||||
GameRegPoints = 1000,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameHeatId = 0,
|
||||
GameHeatRegNr = 4,
|
||||
GameRegPoints = 400,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixHeatToRoundParameter : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
135
Gready_Poang.DataLayer/Migrations/20250903070200_FixHeatToRoundParams.Designer.cs
generated
Normal file
135
Gready_Poang.DataLayer/Migrations/20250903070200_FixHeatToRoundParams.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250903070200_FixHeatToRoundParams")]
|
||||
partial class FixHeatToRoundParams
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1050,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 1,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 350,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 3,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1000,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 2,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 400,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 4,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class FixHeatToRoundParams : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "GameHeatRegNr",
|
||||
table: "GamePoints",
|
||||
newName: "GameRoundRegNr");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "GameHeatId",
|
||||
table: "GamePoints",
|
||||
newName: "GameRoundId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "GameRoundRegNr",
|
||||
table: "GamePoints",
|
||||
newName: "GameHeatRegNr");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "GameRoundId",
|
||||
table: "GamePoints",
|
||||
newName: "GameHeatId");
|
||||
}
|
||||
}
|
||||
}
|
||||
135
Gready_Poang.DataLayer/Migrations/20250903074537_AddedStatusEnum.Designer.cs
generated
Normal file
135
Gready_Poang.DataLayer/Migrations/20250903074537_AddedStatusEnum.Designer.cs
generated
Normal file
@ -0,0 +1,135 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250903074537_AddedStatusEnum")]
|
||||
partial class AddedStatusEnum
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1050,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 1,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 350,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 3,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1000,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 2,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 400,
|
||||
GameRoundId = 0,
|
||||
GameRoundRegNr = 4,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddedStatusEnum : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
179
Gready_Poang.DataLayer/Migrations/20250903195147_AddedTableGameRounds.Designer.cs
generated
Normal file
179
Gready_Poang.DataLayer/Migrations/20250903195147_AddedTableGameRounds.Designer.cs
generated
Normal file
@ -0,0 +1,179 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250903195147_AddedTableGameRounds")]
|
||||
partial class AddedTableGameRounds
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PointStatus")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1050,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 1,
|
||||
ParticipantId = 1,
|
||||
PointStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 350,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 3,
|
||||
ParticipantId = 1,
|
||||
PointStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1000,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 2,
|
||||
ParticipantId = 3,
|
||||
PointStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 400,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 4,
|
||||
ParticipantId = 3,
|
||||
PointStatus = 0
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GameRound", b =>
|
||||
{
|
||||
b.Property<int>("GameRoundId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("GameRoundFinished")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("GameRoundStartDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GameRoundId");
|
||||
|
||||
b.ToTable("GameRounds");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GameRoundId = 1,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 10, 15, 19, 10, 15, 0, DateTimeKind.Unspecified)
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 2,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 15, 19, 10, 15, 0, DateTimeKind.Unspecified)
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 3,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 20, 19, 10, 15, 0, DateTimeKind.Unspecified)
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddedTableGameRounds : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PointStatus",
|
||||
table: "GamePoints",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GameRounds",
|
||||
columns: table => new
|
||||
{
|
||||
GameRoundId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
GameRoundFinished = table.Column<DateTime>(type: "TEXT", nullable: true),
|
||||
GameRoundStartDate = table.Column<DateTime>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GameRounds", x => x.GameRoundId);
|
||||
});
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 1,
|
||||
columns: new[] { "GameRoundId", "PointStatus" },
|
||||
values: new object[] { 2, 0 });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 2,
|
||||
columns: new[] { "GameRoundId", "PointStatus" },
|
||||
values: new object[] { 2, 0 });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 3,
|
||||
columns: new[] { "GameRoundId", "PointStatus" },
|
||||
values: new object[] { 2, 0 });
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 4,
|
||||
columns: new[] { "GameRoundId", "PointStatus" },
|
||||
values: new object[] { 2, 0 });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "GameRounds",
|
||||
columns: new[] { "GameRoundId", "GameRoundFinished", "GameRoundStartDate" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new DateTime(2025, 10, 15, 19, 10, 15, 0, DateTimeKind.Unspecified) },
|
||||
{ 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new DateTime(2025, 9, 15, 19, 10, 15, 0, DateTimeKind.Unspecified) },
|
||||
{ 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new DateTime(2025, 9, 20, 19, 10, 15, 0, DateTimeKind.Unspecified) }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GameRounds");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PointStatus",
|
||||
table: "GamePoints");
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 1,
|
||||
column: "GameRoundId",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 2,
|
||||
column: "GameRoundId",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 3,
|
||||
column: "GameRoundId",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 4,
|
||||
column: "GameRoundId",
|
||||
value: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
179
Gready_Poang.DataLayer/Migrations/20250903195935_ChangedUpdateOrderInSeeding.Designer.cs
generated
Normal file
179
Gready_Poang.DataLayer/Migrations/20250903195935_ChangedUpdateOrderInSeeding.Designer.cs
generated
Normal file
@ -0,0 +1,179 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250903195935_ChangedUpdateOrderInSeeding")]
|
||||
partial class ChangedUpdateOrderInSeeding
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("PointStatus")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1050,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 1,
|
||||
ParticipantId = 1,
|
||||
PointStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 350,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 3,
|
||||
ParticipantId = 1,
|
||||
PointStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1000,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 2,
|
||||
ParticipantId = 3,
|
||||
PointStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 400,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 4,
|
||||
ParticipantId = 3,
|
||||
PointStatus = 0
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GameRound", b =>
|
||||
{
|
||||
b.Property<int>("GameRoundId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("GameRoundFinished")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("GameRoundStartDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("GameRoundId");
|
||||
|
||||
b.ToTable("GameRounds");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GameRoundId = 1,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 10, 15, 19, 10, 15, 0, DateTimeKind.Unspecified)
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 2,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 15, 19, 10, 15, 0, DateTimeKind.Unspecified)
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 3,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 20, 19, 10, 15, 0, DateTimeKind.Unspecified)
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ChangedUpdateOrderInSeeding : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
178
Gready_Poang.DataLayer/Migrations/20250914064850_statusfieldmove.Designer.cs
generated
Normal file
178
Gready_Poang.DataLayer/Migrations/20250914064850_statusfieldmove.Designer.cs
generated
Normal file
@ -0,0 +1,178 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
[Migration("20250914064850_statusfieldmove")]
|
||||
partial class statusfieldmove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1050,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 1,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 350,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 3,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1000,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 2,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 400,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 4,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GameRound", b =>
|
||||
{
|
||||
b.Property<int>("GameRoundId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("GameRoundFinished")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("GameRoundStartDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameStatus")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GameRoundId");
|
||||
|
||||
b.ToTable("GameRounds");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GameRoundId = 1,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 10, 15, 19, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 2,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 15, 19, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 3,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 20, 19, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameStatus = 0
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class statusfieldmove : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PointStatus",
|
||||
table: "GamePoints");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "GameStatus",
|
||||
table: "GameRounds",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GameRounds",
|
||||
keyColumn: "GameRoundId",
|
||||
keyValue: 1,
|
||||
column: "GameStatus",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GameRounds",
|
||||
keyColumn: "GameRoundId",
|
||||
keyValue: 2,
|
||||
column: "GameStatus",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GameRounds",
|
||||
keyColumn: "GameRoundId",
|
||||
keyValue: 3,
|
||||
column: "GameStatus",
|
||||
value: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "GameStatus",
|
||||
table: "GameRounds");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "PointStatus",
|
||||
table: "GamePoints",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 1,
|
||||
column: "PointStatus",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 2,
|
||||
column: "PointStatus",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 3,
|
||||
column: "PointStatus",
|
||||
value: 0);
|
||||
|
||||
migrationBuilder.UpdateData(
|
||||
table: "GamePoints",
|
||||
keyColumn: "GamePointId",
|
||||
keyValue: 4,
|
||||
column: "PointStatus",
|
||||
value: 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
175
Gready_Poang.DataLayer/Migrations/DataContextModelSnapshot.cs
Normal file
175
Gready_Poang.DataLayer/Migrations/DataContextModelSnapshot.cs
Normal file
@ -0,0 +1,175 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using GreadyPoang.DataLayer.Database;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace GreadyPoang.DataLayer.Migrations
|
||||
{
|
||||
[DbContext(typeof(DataContext))]
|
||||
partial class DataContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.8");
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GamePoint", b =>
|
||||
{
|
||||
b.Property<int>("GamePointId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("GameDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameRegPoints")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GameRoundRegNr")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("ParticipantId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GamePointId");
|
||||
|
||||
b.ToTable("GamePoints");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GamePointId = 1,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1050,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 1,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 2,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 15, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 350,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 3,
|
||||
ParticipantId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 3,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 12, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 1000,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 2,
|
||||
ParticipantId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
GamePointId = 4,
|
||||
GameDate = new DateTime(2025, 10, 15, 20, 20, 15, 0, DateTimeKind.Unspecified),
|
||||
GameRegPoints = 400,
|
||||
GameRoundId = 2,
|
||||
GameRoundRegNr = 4,
|
||||
ParticipantId = 3
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.GameRound", b =>
|
||||
{
|
||||
b.Property<int>("GameRoundId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("GameRoundFinished")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("GameRoundStartDate")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("GameStatus")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GameRoundId");
|
||||
|
||||
b.ToTable("GameRounds");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
GameRoundId = 1,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 10, 15, 19, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 2,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 15, 19, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameStatus = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
GameRoundId = 3,
|
||||
GameRoundFinished = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
GameRoundStartDate = new DateTime(2025, 9, 20, 19, 10, 15, 0, DateTimeKind.Unspecified),
|
||||
GameStatus = 0
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("GreadyPoang.EntityLayer.Participant", b =>
|
||||
{
|
||||
b.Property<int>("ParticipantId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("ParticipantId");
|
||||
|
||||
b.ToTable("Participants");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
ParticipantId = 1,
|
||||
Email = "John.Doe@gmail.com",
|
||||
FirstName = "John",
|
||||
LastName = "Doe"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 2,
|
||||
Email = "jb@gmail.com",
|
||||
FirstName = "Jane",
|
||||
LastName = "Black"
|
||||
},
|
||||
new
|
||||
{
|
||||
ParticipantId = 3,
|
||||
Email = "mw@gmail.com",
|
||||
FirstName = "Mary",
|
||||
LastName = "White"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user