From 4b2ad030fa381662f4b0c2464e97b0d2c5f6a716 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 18 Apr 2025 12:25:59 +0200 Subject: Initial commit --- VPNAuth.Server/Migrations/20250418102156_DbInit.cs | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 VPNAuth.Server/Migrations/20250418102156_DbInit.cs (limited to 'VPNAuth.Server/Migrations/20250418102156_DbInit.cs') diff --git a/VPNAuth.Server/Migrations/20250418102156_DbInit.cs b/VPNAuth.Server/Migrations/20250418102156_DbInit.cs new file mode 100644 index 0000000..70967ca --- /dev/null +++ b/VPNAuth.Server/Migrations/20250418102156_DbInit.cs @@ -0,0 +1,61 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace VPNAuth.Server.Migrations +{ + /// + public partial class DbInit : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "AccessTokens", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Token = table.Column(type: "TEXT", nullable: false), + ClientId = table.Column(type: "TEXT", nullable: false), + CreationTime = table.Column(type: "TEXT", nullable: false), + Scopes = table.Column(type: "TEXT", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AccessTokens", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "AuthRequests", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + InitTime = table.Column(type: "TEXT", nullable: false), + Code = table.Column(type: "TEXT", nullable: false), + State = table.Column(type: "TEXT", nullable: true), + ClientId = table.Column(type: "TEXT", nullable: false), + Scopes = table.Column(type: "TEXT", nullable: false), + CodeChallenge = table.Column(type: "TEXT", nullable: false), + CodeChallengeMethod = table.Column(type: "TEXT", nullable: false), + Accepted = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AuthRequests", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AccessTokens"); + + migrationBuilder.DropTable( + name: "AuthRequests"); + } + } +} -- cgit v1.2.3