From 85a394660cd0ccae5c57d5045ac6ecfa75f6ea61 Mon Sep 17 00:00:00 2001 From: Reimar Date: Mon, 12 Aug 2024 16:48:44 +0200 Subject: [PATCH] Add missing migration files --- .gitignore | 4 ++ .../20240812084720_CreateUser.Designer.cs | 44 +++++++++++++++++++ API/Migrations/20240812084720_CreateUser.cs | 36 +++++++++++++++ API/Migrations/AppDBContextModelSnapshot.cs | 41 +++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 .gitignore create mode 100644 API/Migrations/20240812084720_CreateUser.Designer.cs create mode 100644 API/Migrations/20240812084720_CreateUser.cs create mode 100644 API/Migrations/AppDBContextModelSnapshot.cs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e3c5b1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +API/bin +API/obj +.idea + diff --git a/API/Migrations/20240812084720_CreateUser.Designer.cs b/API/Migrations/20240812084720_CreateUser.Designer.cs new file mode 100644 index 0000000..44f332b --- /dev/null +++ b/API/Migrations/20240812084720_CreateUser.Designer.cs @@ -0,0 +1,44 @@ +// +using API; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace API.Migrations +{ + [DbContext(typeof(AppDBContext))] + [Migration("20240812084720_CreateUser")] + partial class CreateUser + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "9.0.0-preview.6.24327.4"); + + modelBuilder.Entity("API.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Email") + .HasColumnType("TEXT"); + + b.Property("Password") + .HasColumnType("TEXT"); + + b.Property("Username") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/API/Migrations/20240812084720_CreateUser.cs b/API/Migrations/20240812084720_CreateUser.cs new file mode 100644 index 0000000..7277c11 --- /dev/null +++ b/API/Migrations/20240812084720_CreateUser.cs @@ -0,0 +1,36 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace API.Migrations +{ + /// + public partial class CreateUser : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Email = table.Column(type: "TEXT", nullable: true), + Username = table.Column(type: "TEXT", nullable: true), + Password = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Users"); + } + } +} diff --git a/API/Migrations/AppDBContextModelSnapshot.cs b/API/Migrations/AppDBContextModelSnapshot.cs new file mode 100644 index 0000000..3107901 --- /dev/null +++ b/API/Migrations/AppDBContextModelSnapshot.cs @@ -0,0 +1,41 @@ +// +using API; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace API.Migrations +{ + [DbContext(typeof(AppDBContext))] + partial class AppDBContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "9.0.0-preview.6.24327.4"); + + modelBuilder.Entity("API.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Email") + .HasColumnType("TEXT"); + + b.Property("Password") + .HasColumnType("TEXT"); + + b.Property("Username") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Users"); + }); +#pragma warning restore 612, 618 + } + } +}