// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Watcher.Data;

#nullable disable

namespace Watcher.Migrations
{
    [DbContext(typeof(AppDbContext))]
    [Migration("20250617153602_InitialMigration")]
    partial class InitialMigration
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.6")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            modelBuilder.Entity("Watcher.Models.Container", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Hostname")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<int?>("ImageId")
                        .HasColumnType("int");

                    b.Property<bool>("IsRunning")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<int?>("TagId")
                        .HasColumnType("int");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("ImageId");

                    b.HasIndex("TagId");

                    b.ToTable("Containers");
                });

            modelBuilder.Entity("Watcher.Models.Image", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.Property<string>("Tag")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("Images");
                });

            modelBuilder.Entity("Watcher.Models.LogEvent", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int?>("ContainerId")
                        .HasColumnType("int");

                    b.Property<string>("Level")
                        .HasColumnType("longtext");

                    b.Property<string>("Message")
                        .HasColumnType("longtext");

                    b.Property<int?>("ServerId")
                        .HasColumnType("int");

                    b.Property<DateTime>("Timestamp")
                        .HasColumnType("datetime(6)");

                    b.HasKey("Id");

                    b.HasIndex("ContainerId");

                    b.HasIndex("ServerId");

                    b.ToTable("LogEvents");
                });

            modelBuilder.Entity("Watcher.Models.Metric", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int?>("ContainerId")
                        .HasColumnType("int");

                    b.Property<int?>("ServerId")
                        .HasColumnType("int");

                    b.Property<DateTime>("Timestamp")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Type")
                        .HasColumnType("longtext");

                    b.Property<double>("Value")
                        .HasColumnType("double");

                    b.HasKey("Id");

                    b.HasIndex("ContainerId");

                    b.HasIndex("ServerId");

                    b.ToTable("Metrics");
                });

            modelBuilder.Entity("Watcher.Models.Server", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<int>("CpuCores")
                        .HasColumnType("int");

                    b.Property<string>("CpuType")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Description")
                        .HasColumnType("longtext");

                    b.Property<string>("GpuType")
                        .HasColumnType("longtext");

                    b.Property<string>("IPAddress")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<bool>("IsOnline")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTime>("LastSeen")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<double>("RamSize")
                        .HasColumnType("double");

                    b.Property<int?>("TagId")
                        .HasColumnType("int");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.HasIndex("TagId");

                    b.ToTable("Servers");
                });

            modelBuilder.Entity("Watcher.Models.Tag", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("Name")
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("Tags");
                });

            modelBuilder.Entity("Watcher.Models.User", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("Email")
                        .HasColumnType("longtext");

                    b.Property<DateTime>("LastLogin")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("PocketId")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.Property<string>("PreferredUsername")
                        .IsRequired()
                        .HasColumnType("longtext");

                    b.HasKey("Id");

                    b.ToTable("Users");
                });

            modelBuilder.Entity("Watcher.Models.Container", b =>
                {
                    b.HasOne("Watcher.Models.Image", "Image")
                        .WithMany("Containers")
                        .HasForeignKey("ImageId");

                    b.HasOne("Watcher.Models.Tag", null)
                        .WithMany("Containers")
                        .HasForeignKey("TagId");

                    b.Navigation("Image");
                });

            modelBuilder.Entity("Watcher.Models.LogEvent", b =>
                {
                    b.HasOne("Watcher.Models.Container", "Container")
                        .WithMany()
                        .HasForeignKey("ContainerId");

                    b.HasOne("Watcher.Models.Server", "Server")
                        .WithMany()
                        .HasForeignKey("ServerId");

                    b.Navigation("Container");

                    b.Navigation("Server");
                });

            modelBuilder.Entity("Watcher.Models.Metric", b =>
                {
                    b.HasOne("Watcher.Models.Container", "Container")
                        .WithMany()
                        .HasForeignKey("ContainerId");

                    b.HasOne("Watcher.Models.Server", "Server")
                        .WithMany()
                        .HasForeignKey("ServerId");

                    b.Navigation("Container");

                    b.Navigation("Server");
                });

            modelBuilder.Entity("Watcher.Models.Server", b =>
                {
                    b.HasOne("Watcher.Models.Tag", null)
                        .WithMany("Servers")
                        .HasForeignKey("TagId");
                });

            modelBuilder.Entity("Watcher.Models.Image", b =>
                {
                    b.Navigation("Containers");
                });

            modelBuilder.Entity("Watcher.Models.Tag", b =>
                {
                    b.Navigation("Containers");

                    b.Navigation("Servers");
                });
#pragma warning restore 612, 618
        }
    }
}
