//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using TimetableDesigner.API.Services.Authentication.Database;
#nullable disable
namespace TimetableDesigner.API.Services.Authentication.Database.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20250924120541_Initial")]
partial class Initial
{
///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "9.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("TimetableDesigner.API.Services.Authentication.Database.Model.Account", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
NpgsqlPropertyBuilderExtensions.UseIdentityAlwaysColumn(b.Property("Id"));
b.Property("Email")
.IsRequired()
.HasMaxLength(320)
.HasColumnType("character varying(320)");
b.Property("Password")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("bytea");
b.Property("PasswordSaltLeft")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("PasswordSaltRight")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("character varying(20)");
b.Property("Version")
.IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("xid")
.HasColumnName("xmin");
b.HasKey("Id");
b.HasIndex("Id")
.IsUnique();
b.ToTable("Accounts");
});
modelBuilder.Entity("TimetableDesigner.API.Services.Authentication.Database.Model.RefreshToken", b =>
{
b.Property("Token")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property("AccountId")
.HasColumnType("bigint");
b.Property("ExpirationDate")
.HasColumnType("timestamp with time zone");
b.Property("IsExtendable")
.HasColumnType("boolean");
b.Property("Version")
.IsConcurrencyToken()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("xid")
.HasColumnName("xmin");
b.HasKey("Token");
b.HasIndex("AccountId");
b.HasIndex("Token")
.IsUnique();
b.ToTable("RefreshTokens");
});
modelBuilder.Entity("TimetableDesigner.API.Services.Authentication.Database.Model.RefreshToken", b =>
{
b.HasOne("TimetableDesigner.API.Services.Authentication.Database.Model.Account", "Account")
.WithMany("RefreshTokens")
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Account");
});
modelBuilder.Entity("TimetableDesigner.API.Services.Authentication.Database.Model.Account", b =>
{
b.Navigation("RefreshTokens");
});
#pragma warning restore 612, 618
}
}
}