diff --git a/Watcher/Migrations/20250613215617_ModelsAdded.Designer.cs b/Watcher/Migrations/20250613215617_ModelsAdded.Designer.cs new file mode 100644 index 0000000..cd3d6b3 --- /dev/null +++ b/Watcher/Migrations/20250613215617_ModelsAdded.Designer.cs @@ -0,0 +1,57 @@ +// +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("20250613215617_ModelsAdded")] + partial class ModelsAdded + { + /// + 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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime(6)"); + + b.Property("Hostname") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Name") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Status") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("Containers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Watcher/Migrations/20250613215617_ModelsAdded.cs b/Watcher/Migrations/20250613215617_ModelsAdded.cs new file mode 100644 index 0000000..95e1fde --- /dev/null +++ b/Watcher/Migrations/20250613215617_ModelsAdded.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Watcher.Migrations +{ + /// + public partial class ModelsAdded : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/Watcher/Models/Server.cs b/Watcher/Models/Server.cs new file mode 100644 index 0000000..c325177 --- /dev/null +++ b/Watcher/Models/Server.cs @@ -0,0 +1,17 @@ +namespace Watcher.Models; + +public class Server +{ + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Status { get; set; } = string.Empty; + + public DateTime CreatedAt { get; set; } = DateTime.UtcNow; + + public string Hostname { get; set; } = string.Empty; + + // z.B. "VPS", "standalone", "VM", etc. + public string Type { get; set; } = "VPS"; +}