324 lines
11 KiB
C#
324 lines
11 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using GymLogAI.Persistence;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace GymLogAI.Persistence.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
partial class AppDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.4")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.Exercise", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("character varying(2000)");
|
|
|
|
b.PrimitiveCollection<float[]>("Embedding")
|
|
.HasColumnType("real[]");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("exercises", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.ExerciseSet", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("DistanceMeters")
|
|
.HasPrecision(10, 2)
|
|
.HasColumnType("numeric(10,2)");
|
|
|
|
b.Property<int?>("DurationSeconds")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("character varying(1000)");
|
|
|
|
b.Property<int>("Order")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("Repetitions")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<decimal?>("WeightKg")
|
|
.HasPrecision(8, 2)
|
|
.HasColumnType("numeric(8,2)");
|
|
|
|
b.Property<Guid>("WorkoutExerciseId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("WorkoutExerciseId", "Order")
|
|
.IsUnique();
|
|
|
|
b.ToTable("exercise_sets", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.TelegramMessage", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("ImportedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime?>("ParsedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("ParsingError")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("character varying(2000)");
|
|
|
|
b.Property<int>("ParsingStatus")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("SentAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<long>("TelegramChatId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("TelegramMessageId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Text")
|
|
.IsRequired()
|
|
.HasMaxLength(4000)
|
|
.HasColumnType("character varying(4000)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("WorkoutId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TelegramChatId", "TelegramMessageId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserId", "ParsingStatus");
|
|
|
|
b.ToTable("telegram_messages", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.User", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("FirstName")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("LastName")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<long>("TelegramUserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("Username")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TelegramUserId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("users", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.Workout", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasMaxLength(4000)
|
|
.HasColumnType("character varying(4000)");
|
|
|
|
b.Property<DateTime>("PerformedAtUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid?>("SourceTelegramMessageId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("SourceType")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Title")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("SourceTelegramMessageId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserId", "PerformedAtUtc");
|
|
|
|
b.ToTable("workouts", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.WorkoutExercise", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("ExerciseId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("character varying(2000)");
|
|
|
|
b.Property<int>("Order")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("WorkoutId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ExerciseId");
|
|
|
|
b.HasIndex("WorkoutId", "Order")
|
|
.IsUnique();
|
|
|
|
b.ToTable("workout_exercises", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.ExerciseSet", b =>
|
|
{
|
|
b.HasOne("GymLogAI.Core.Entities.WorkoutExercise", "WorkoutExercise")
|
|
.WithMany("Sets")
|
|
.HasForeignKey("WorkoutExerciseId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("WorkoutExercise");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.TelegramMessage", b =>
|
|
{
|
|
b.HasOne("GymLogAI.Core.Entities.User", "User")
|
|
.WithMany("TelegramMessages")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.Workout", b =>
|
|
{
|
|
b.HasOne("GymLogAI.Core.Entities.TelegramMessage", "SourceTelegramMessage")
|
|
.WithOne("Workout")
|
|
.HasForeignKey("GymLogAI.Core.Entities.Workout", "SourceTelegramMessageId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("GymLogAI.Core.Entities.User", "User")
|
|
.WithMany("Workouts")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("SourceTelegramMessage");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.WorkoutExercise", b =>
|
|
{
|
|
b.HasOne("GymLogAI.Core.Entities.Exercise", "Exercise")
|
|
.WithMany("WorkoutExercises")
|
|
.HasForeignKey("ExerciseId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("GymLogAI.Core.Entities.Workout", "Workout")
|
|
.WithMany("WorkoutExercises")
|
|
.HasForeignKey("WorkoutId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Exercise");
|
|
|
|
b.Navigation("Workout");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.Exercise", b =>
|
|
{
|
|
b.Navigation("WorkoutExercises");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.TelegramMessage", b =>
|
|
{
|
|
b.Navigation("Workout");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.User", b =>
|
|
{
|
|
b.Navigation("TelegramMessages");
|
|
|
|
b.Navigation("Workouts");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.Workout", b =>
|
|
{
|
|
b.Navigation("WorkoutExercises");
|
|
});
|
|
|
|
modelBuilder.Entity("GymLogAI.Core.Entities.WorkoutExercise", b =>
|
|
{
|
|
b.Navigation("Sets");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|