Use the configuration depending on the selected database provider #13

Merged
Wesser merged 33 commits from feat/database-persistence into feat/add-setup 2024-06-01 05:45:18 +03:00
10 changed files with 12 additions and 12 deletions
Showing only changes of commit 4c93ed282d - Show all commits

View File

@ -2,13 +2,13 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class CampusConfiguration : IEntityTypeConfiguration<Campus> public sealed class CampusConfiguration : IEntityTypeConfiguration<Campus>
{ {
public void Configure(EntityTypeBuilder<Campus> builder) public void Configure(EntityTypeBuilder<Campus> builder)
{ {
builder.ToTable(nameof(Campus)); builder.ToTable("MyCampusName");
builder.HasKey(c => c.Id); builder.HasKey(c => c.Id);
builder.HasIndex(c => c.Id).IsUnique(); builder.HasIndex(c => c.Id).IsUnique();
builder.Property(c => c.Id).HasColumnType("INTEGER").IsRequired().ValueGeneratedOnAdd(); builder.Property(c => c.Id).HasColumnType("INTEGER").IsRequired().ValueGeneratedOnAdd();

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class DisciplineConfiguration : IEntityTypeConfiguration<Discipline> public class DisciplineConfiguration : IEntityTypeConfiguration<Discipline>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class FacultyConfiguration : IEntityTypeConfiguration<Faculty> public class FacultyConfiguration : IEntityTypeConfiguration<Faculty>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class GroupConfiguration : IEntityTypeConfiguration<Group> public class GroupConfiguration : IEntityTypeConfiguration<Group>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class LectureHallConfiguration : IEntityTypeConfiguration<LectureHall> public class LectureHallConfiguration : IEntityTypeConfiguration<LectureHall>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class LessonAssociationConfiguration : IEntityTypeConfiguration<LessonAssociation> public class LessonAssociationConfiguration : IEntityTypeConfiguration<LessonAssociation>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class LessonConfiguration : IEntityTypeConfiguration<Lesson> public class LessonConfiguration : IEntityTypeConfiguration<Lesson>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class ProfessorConfiguration : IEntityTypeConfiguration<Professor> public class ProfessorConfiguration : IEntityTypeConfiguration<Professor>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class SpecificWeekConfiguration : IEntityTypeConfiguration<SpecificWeek> public class SpecificWeekConfiguration : IEntityTypeConfiguration<SpecificWeek>
{ {

View File

@ -2,7 +2,7 @@
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Mirea.Api.DataAccess.Domain.Schedule; using Mirea.Api.DataAccess.Domain.Schedule;
namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Schedule; namespace Mirea.Api.DataAccess.Persistence.EntityTypeConfigurations.Sqlite.Schedule;
public class TypeOfOccupationConfiguration : IEntityTypeConfiguration<TypeOfOccupation> public class TypeOfOccupationConfiguration : IEntityTypeConfiguration<TypeOfOccupation>
{ {