// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using TrackQrApi.Data; #nullable disable namespace TrackQrApi.Migrations { [DbContext(typeof(AppDbContext))] [Migration("20260127192536_InitialCreate")] partial class InitialCreate { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.2") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Api.Models.Domain", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("Hostname") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)"); b.Property("Status") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("VerificationToken") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)"); b.Property("WorkspaceId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("Hostname") .IsUnique(); b.HasIndex("WorkspaceId"); b.ToTable("Domains"); }); modelBuilder.Entity("Api.Models.Project", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("WorkspaceId") .HasColumnType("uuid"); b.HasKey("Id"); b.HasIndex("WorkspaceId"); b.ToTable("Projects"); }); modelBuilder.Entity("Api.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("Email") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)"); b.Property("PasswordHash") .IsRequired() .HasMaxLength(255) .HasColumnType("character varying(255)"); b.Property("VerifiedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("Email") .IsUnique(); b.ToTable("Users"); }); modelBuilder.Entity("Api.Models.Workspace", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CreatedAt") .ValueGeneratedOnAdd() .HasColumnType("timestamp with time zone") .HasDefaultValueSql("CURRENT_TIMESTAMP"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("OwnerUserId") .HasColumnType("uuid"); b.Property("Plan") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.HasKey("Id"); b.HasIndex("OwnerUserId"); b.ToTable("Workspaces"); }); modelBuilder.Entity("Api.Models.Domain", b => { b.HasOne("Api.Models.Workspace", "Workspace") .WithMany("Domains") .HasForeignKey("WorkspaceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Workspace"); }); modelBuilder.Entity("Api.Models.Project", b => { b.HasOne("Api.Models.Workspace", "Workspace") .WithMany("Projects") .HasForeignKey("WorkspaceId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Workspace"); }); modelBuilder.Entity("Api.Models.Workspace", b => { b.HasOne("Api.Models.User", "Owner") .WithMany("Workspaces") .HasForeignKey("OwnerUserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Owner"); }); modelBuilder.Entity("Api.Models.User", b => { b.Navigation("Workspaces"); }); modelBuilder.Entity("Api.Models.Workspace", b => { b.Navigation("Domains"); b.Navigation("Projects"); }); #pragma warning restore 612, 618 } } }