From 771b949618bb4e07c09c2fb94a7f92e13f471b9e Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 25 Dec 2025 19:59:26 +0100 Subject: Initial commit --- .../Migrations/20251222192008_Init.Designer.cs | 50 ++++++++++++++++++++++ ShareGuard.Web/Migrations/20251222192008_Init.cs | 37 ++++++++++++++++ ShareGuard.Web/Migrations/DatabaseModelSnapshot.cs | 47 ++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 ShareGuard.Web/Migrations/20251222192008_Init.Designer.cs create mode 100644 ShareGuard.Web/Migrations/20251222192008_Init.cs create mode 100644 ShareGuard.Web/Migrations/DatabaseModelSnapshot.cs (limited to 'ShareGuard.Web/Migrations') diff --git a/ShareGuard.Web/Migrations/20251222192008_Init.Designer.cs b/ShareGuard.Web/Migrations/20251222192008_Init.Designer.cs new file mode 100644 index 0000000..a0151ac --- /dev/null +++ b/ShareGuard.Web/Migrations/20251222192008_Init.Designer.cs @@ -0,0 +1,50 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using ShareGuard.Web; + +#nullable disable + +namespace ShareGuard.Web.Migrations +{ + [DbContext(typeof(Database))] + [Migration("20251222192008_Init")] + partial class Init + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.1"); + + modelBuilder.Entity("ShareGuard.Web.DbModels.Link", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("IpAddress") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PeerPublicKey") + .HasColumnType("TEXT"); + + b.Property("Token") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Links"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ShareGuard.Web/Migrations/20251222192008_Init.cs b/ShareGuard.Web/Migrations/20251222192008_Init.cs new file mode 100644 index 0000000..d301a33 --- /dev/null +++ b/ShareGuard.Web/Migrations/20251222192008_Init.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace ShareGuard.Web.Migrations +{ + /// + public partial class Init : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Links", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Token = table.Column(type: "TEXT", nullable: false), + Name = table.Column(type: "TEXT", nullable: false), + IpAddress = table.Column(type: "TEXT", nullable: false), + PeerPublicKey = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Links", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Links"); + } + } +} diff --git a/ShareGuard.Web/Migrations/DatabaseModelSnapshot.cs b/ShareGuard.Web/Migrations/DatabaseModelSnapshot.cs new file mode 100644 index 0000000..6f3c5df --- /dev/null +++ b/ShareGuard.Web/Migrations/DatabaseModelSnapshot.cs @@ -0,0 +1,47 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using ShareGuard.Web; + +#nullable disable + +namespace ShareGuard.Web.Migrations +{ + [DbContext(typeof(Database))] + partial class DatabaseModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "10.0.1"); + + modelBuilder.Entity("ShareGuard.Web.DbModels.Link", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("IpAddress") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Name") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("PeerPublicKey") + .HasColumnType("TEXT"); + + b.Property("Token") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Links"); + }); +#pragma warning restore 612, 618 + } + } +} -- cgit v1.2.3