diff options
author | Tim <contact@bytim.eu> | 2025-04-19 19:33:04 +0200 |
---|---|---|
committer | Tim <contact@bytim.eu> | 2025-04-19 19:33:04 +0200 |
commit | 6a9657a10dc5ef3c4dfddf222284eec6c933ac83 (patch) | |
tree | a2b939a2e51ad04dd2635126be27d66c781666dd /VPNAuth.Server/Migrations | |
parent | ff9b1e112ed14746ed74dfff1fb4c19efd5502d4 (diff) | |
download | VPNAuth-master.tar.xz VPNAuth-master.zip |
Diffstat (limited to 'VPNAuth.Server/Migrations')
3 files changed, 179 insertions, 0 deletions
diff --git a/VPNAuth.Server/Migrations/20250419123149_AddUsernameFields.Designer.cs b/VPNAuth.Server/Migrations/20250419123149_AddUsernameFields.Designer.cs new file mode 100644 index 0000000..8409c25 --- /dev/null +++ b/VPNAuth.Server/Migrations/20250419123149_AddUsernameFields.Designer.cs @@ -0,0 +1,131 @@ +// <auto-generated /> +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using VPNAuth.Server.Database; + +#nullable disable + +namespace VPNAuth.Server.Migrations +{ + [DbContext(typeof(Database.Database))] + [Migration("20250419123149_AddUsernameFields")] + partial class AddUsernameFields + { + /// <inheritdoc /> + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "9.0.4"); + + modelBuilder.Entity("VPNAuth.Server.Database.AccessToken", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property<string>("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<DateTime>("CreationTime") + .HasColumnType("TEXT"); + + b.PrimitiveCollection<string>("Scopes") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<string>("Token") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<string>("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("AccessTokens"); + }); + + modelBuilder.Entity("VPNAuth.Server.Database.AuthRequest", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property<bool>("Accepted") + .HasColumnType("INTEGER"); + + b.Property<string>("ClientId") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<string>("Code") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<string>("CodeChallenge") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<string>("CodeChallengeMethod") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<DateTime>("InitTime") + .HasColumnType("TEXT"); + + b.PrimitiveCollection<string>("Scopes") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property<string>("State") + .HasColumnType("TEXT"); + + b.Property<string>("Username") + .IsRequired() + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("AuthRequests"); + }); + + modelBuilder.Entity("VPNAuth.Server.Database.UserInformation", b => + { + b.Property<int>("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property<string>("Email") + .HasColumnType("TEXT"); + + b.Property<string>("FamilyName") + .HasColumnType("TEXT"); + + b.Property<string>("GivenName") + .HasColumnType("TEXT"); + + b.Property<string>("Name") + .HasColumnType("TEXT"); + + b.Property<string>("Picture") + .HasColumnType("TEXT"); + + b.Property<string>("PreferredUsername") + .HasColumnType("TEXT"); + + b.Property<string>("Sub") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("UserInformation"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/VPNAuth.Server/Migrations/20250419123149_AddUsernameFields.cs b/VPNAuth.Server/Migrations/20250419123149_AddUsernameFields.cs new file mode 100644 index 0000000..3d649bb --- /dev/null +++ b/VPNAuth.Server/Migrations/20250419123149_AddUsernameFields.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace VPNAuth.Server.Migrations +{ + /// <inheritdoc /> + public partial class AddUsernameFields : Migration + { + /// <inheritdoc /> + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn<string>( + name: "Username", + table: "AuthRequests", + type: "TEXT", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn<string>( + name: "Username", + table: "AccessTokens", + type: "TEXT", + nullable: false, + defaultValue: ""); + } + + /// <inheritdoc /> + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Username", + table: "AuthRequests"); + + migrationBuilder.DropColumn( + name: "Username", + table: "AccessTokens"); + } + } +} diff --git a/VPNAuth.Server/Migrations/DatabaseModelSnapshot.cs b/VPNAuth.Server/Migrations/DatabaseModelSnapshot.cs index e4643df..4dcce6b 100644 --- a/VPNAuth.Server/Migrations/DatabaseModelSnapshot.cs +++ b/VPNAuth.Server/Migrations/DatabaseModelSnapshot.cs @@ -38,6 +38,10 @@ namespace VPNAuth.Server.Migrations .IsRequired() .HasColumnType("TEXT"); + b.Property<string>("Username") + .IsRequired() + .HasColumnType("TEXT"); + b.HasKey("Id"); b.ToTable("AccessTokens"); @@ -78,6 +82,10 @@ namespace VPNAuth.Server.Migrations b.Property<string>("State") .HasColumnType("TEXT"); + b.Property<string>("Username") + .IsRequired() + .HasColumnType("TEXT"); + b.HasKey("Id"); b.ToTable("AuthRequests"); |