//
using System;
using FlowAPI.Infrastructure.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace FlowAPI.Infrastructure.Migrations
{
[DbContext(typeof(AppDbContext))]
partial class AppDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "10.0.8");
modelBuilder.Entity("FlowAPI.Domain.Entities.Achievement", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Category")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property("IconUrl")
.IsRequired()
.HasColumnType("TEXT");
b.Property("RewardPoints")
.HasColumnType("INTEGER");
b.Property("TargetValue")
.HasColumnType("INTEGER");
b.Property("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property("TriggerEventName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Achievements");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.CustomTemplate", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Category")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("ContentJson")
.IsRequired()
.HasMaxLength(10000000)
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("Description")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property("Icon")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("CustomTemplates");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.Edge", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Condition")
.IsRequired()
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property("FromNodeId")
.HasColumnType("TEXT");
b.Property("GraphId")
.HasColumnType("TEXT");
b.Property("ToNodeId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("FromNodeId");
b.HasIndex("GraphId");
b.HasIndex("ToNodeId");
b.ToTable("Edges");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.Graph", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("Description")
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property("Title")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property("UpdatedAt")
.HasColumnType("TEXT");
b.Property("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Graphs");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.HabitRecord", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CheckedDate")
.HasColumnType("TEXT");
b.Property("HabitName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("StreakCount")
.HasColumnType("INTEGER");
b.Property("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("HabitRecords");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.SharedGraph", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("GraphId")
.HasColumnType("TEXT");
b.Property("Permission")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasDefaultValue("Read");
b.Property("SharedWithUserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SharedWithUserId");
b.HasIndex("GraphId", "SharedWithUserId")
.IsUnique();
b.ToTable("SharedGraphs");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.TaskNode", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("Color")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("Data")
.HasMaxLength(10000000)
.HasColumnType("TEXT");
b.Property("Decision")
.HasMaxLength(1000000)
.HasColumnType("TEXT");
b.Property("Description")
.HasMaxLength(10000)
.HasColumnType("TEXT");
b.Property("GraphId")
.HasColumnType("TEXT");
b.Property("Height")
.HasColumnType("REAL");
b.Property("IsPinned")
.HasColumnType("INTEGER");
b.Property("Label")
.IsRequired()
.HasMaxLength(1000)
.HasColumnType("TEXT");
b.Property("PosX")
.HasColumnType("REAL");
b.Property("PosY")
.HasColumnType("REAL");
b.Property("State")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasDefaultValue("Pending");
b.Property("Type")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(100)
.HasColumnType("TEXT")
.HasDefaultValue("sketch");
b.Property("Width")
.HasColumnType("REAL");
b.HasKey("Id");
b.HasIndex("GraphId");
b.ToTable("TaskNodes");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.User", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("AvatarUrl")
.HasColumnType("TEXT");
b.Property("CreatedAt")
.HasColumnType("TEXT");
b.Property("DailyAiGenerationsCount")
.HasColumnType("INTEGER");
b.Property("DisplayName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property("Email")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("TEXT");
b.Property("IsPremium")
.HasColumnType("INTEGER");
b.Property("LastAiGenerationDate")
.HasColumnType("TEXT");
b.Property("PasswordHash")
.IsRequired()
.HasColumnType("TEXT");
b.Property("SubscriptionTier")
.IsRequired()
.ValueGeneratedOnAdd()
.HasMaxLength(50)
.HasColumnType("TEXT")
.HasDefaultValue("Free");
b.HasKey("Id");
b.HasIndex("Email")
.IsUnique();
b.ToTable("Users");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.UserAchievement", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property("AchievementId")
.HasColumnType("TEXT");
b.Property("CurrentValue")
.HasColumnType("INTEGER");
b.Property("IsUnlocked")
.HasColumnType("INTEGER");
b.Property("UnlockedAt")
.HasColumnType("TEXT");
b.Property("UserId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("AchievementId");
b.HasIndex("UserId");
b.ToTable("UserAchievements");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.CustomTemplate", b =>
{
b.HasOne("FlowAPI.Domain.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.Edge", b =>
{
b.HasOne("FlowAPI.Domain.Entities.TaskNode", "FromNode")
.WithMany("OutgoingEdges")
.HasForeignKey("FromNodeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FlowAPI.Domain.Entities.Graph", "Graph")
.WithMany("Edges")
.HasForeignKey("GraphId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FlowAPI.Domain.Entities.TaskNode", "ToNode")
.WithMany("IncomingEdges")
.HasForeignKey("ToNodeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FromNode");
b.Navigation("Graph");
b.Navigation("ToNode");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.Graph", b =>
{
b.HasOne("FlowAPI.Domain.Entities.User", "User")
.WithMany("Graphs")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.HabitRecord", b =>
{
b.HasOne("FlowAPI.Domain.Entities.User", "User")
.WithMany("HabitRecords")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.SharedGraph", b =>
{
b.HasOne("FlowAPI.Domain.Entities.Graph", "Graph")
.WithMany("SharedGraphs")
.HasForeignKey("GraphId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FlowAPI.Domain.Entities.User", "SharedWithUser")
.WithMany("SharedGraphs")
.HasForeignKey("SharedWithUserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Graph");
b.Navigation("SharedWithUser");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.TaskNode", b =>
{
b.HasOne("FlowAPI.Domain.Entities.Graph", "Graph")
.WithMany("Nodes")
.HasForeignKey("GraphId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Graph");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.UserAchievement", b =>
{
b.HasOne("FlowAPI.Domain.Entities.Achievement", "Achievement")
.WithMany()
.HasForeignKey("AchievementId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FlowAPI.Domain.Entities.User", "User")
.WithMany("UserAchievements")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Achievement");
b.Navigation("User");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.Graph", b =>
{
b.Navigation("Edges");
b.Navigation("Nodes");
b.Navigation("SharedGraphs");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.TaskNode", b =>
{
b.Navigation("IncomingEdges");
b.Navigation("OutgoingEdges");
});
modelBuilder.Entity("FlowAPI.Domain.Entities.User", b =>
{
b.Navigation("Graphs");
b.Navigation("HabitRecords");
b.Navigation("SharedGraphs");
b.Navigation("UserAchievements");
});
#pragma warning restore 612, 618
}
}
}