diff --git a/DatabaseTest/Migrations/20240712130909_Initial.Designer.cs b/DatabaseTest/Migrations/20240712130909_Initial.Designer.cs deleted file mode 100644 index 385c9d8..0000000 --- a/DatabaseTest/Migrations/20240712130909_Initial.Designer.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -using System; -using DatabaseTest; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DatabaseTest.Migrations -{ - [DbContext(typeof(DatabaseContext))] - [Migration("20240712130909_Initial")] - partial class Initial - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("HopFrame.Database.Models.PermissionEntry", b => - { - b.Property("RecordId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GrantedAt") - .HasColumnType("TEXT"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("PermissionText") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.HasKey("RecordId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("HopFrame.Database.Models.UserEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property("Username") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DatabaseTest/Migrations/20240712130909_Initial.cs b/DatabaseTest/Migrations/20240712130909_Initial.cs deleted file mode 100644 index 7cedbde..0000000 --- a/DatabaseTest/Migrations/20240712130909_Initial.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DatabaseTest.Migrations -{ - /// - public partial class Initial : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Permissions", - columns: table => new - { - RecordId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - PermissionText = table.Column(type: "TEXT", maxLength: 255, nullable: false), - OwnerId = table.Column(type: "INTEGER", nullable: false), - GrantedAt = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Permissions", x => x.RecordId); - }); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Username = table.Column(type: "TEXT", maxLength: 50, nullable: true), - Email = table.Column(type: "TEXT", maxLength: 50, nullable: false), - Password = table.Column(type: "TEXT", maxLength: 255, nullable: false), - CreatedAt = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Permissions"); - - migrationBuilder.DropTable( - name: "Users"); - } - } -} diff --git a/DatabaseTest/Migrations/20240712143345_Tokens.Designer.cs b/DatabaseTest/Migrations/20240712143345_Tokens.Designer.cs deleted file mode 100644 index 334bd32..0000000 --- a/DatabaseTest/Migrations/20240712143345_Tokens.Designer.cs +++ /dev/null @@ -1,101 +0,0 @@ -// -using System; -using DatabaseTest; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DatabaseTest.Migrations -{ - [DbContext(typeof(DatabaseContext))] - [Migration("20240712143345_Tokens")] - partial class Tokens - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.20"); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.PermissionEntry", b => - { - b.Property("RecordId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GrantedAt") - .HasColumnType("TEXT"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("PermissionText") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.HasKey("RecordId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.UserEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property("Username") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("HopFrame.Security.Models.TokenEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Token") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.Property("Type") - .HasMaxLength(1) - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Tokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DatabaseTest/Migrations/20240712143345_Tokens.cs b/DatabaseTest/Migrations/20240712143345_Tokens.cs deleted file mode 100644 index 4aaf872..0000000 --- a/DatabaseTest/Migrations/20240712143345_Tokens.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DatabaseTest.Migrations -{ - /// - public partial class Tokens : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Tokens", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Type = table.Column(type: "INTEGER", maxLength: 1, nullable: false), - Token = table.Column(type: "TEXT", maxLength: 36, nullable: false), - UserId = table.Column(type: "INTEGER", nullable: false), - CreatedAt = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Tokens", x => x.Id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Tokens"); - } - } -} diff --git a/DatabaseTest/Migrations/20240713083821_Security.Designer.cs b/DatabaseTest/Migrations/20240713083821_Security.Designer.cs deleted file mode 100644 index de4bfa3..0000000 --- a/DatabaseTest/Migrations/20240713083821_Security.Designer.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -using System; -using DatabaseTest; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DatabaseTest.Migrations -{ - [DbContext(typeof(DatabaseContext))] - [Migration("20240713083821_Security")] - partial class Security - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.PermissionEntry", b => - { - b.Property("RecordId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GrantedAt") - .HasColumnType("TEXT"); - - b.Property("PermissionText") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.HasKey("RecordId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.TokenEntry", b => - { - b.Property("Token") - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasMaxLength(1) - .HasColumnType("INTEGER"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.HasKey("Token"); - - b.ToTable("Tokens"); - }); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.UserEntry", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property("Username") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/DatabaseTest/Migrations/20240713083821_Security.cs b/DatabaseTest/Migrations/20240713083821_Security.cs deleted file mode 100644 index 9e581d8..0000000 --- a/DatabaseTest/Migrations/20240713083821_Security.cs +++ /dev/null @@ -1,109 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace DatabaseTest.Migrations -{ - /// - public partial class Security : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_Tokens", - table: "Tokens"); - - migrationBuilder.DropColumn( - name: "Id", - table: "Tokens"); - - migrationBuilder.DropColumn( - name: "OwnerId", - table: "Permissions"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "Users", - type: "TEXT", - maxLength: 36, - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER") - .OldAnnotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "UserId", - table: "Tokens", - type: "TEXT", - maxLength: 36, - nullable: false, - oldClrType: typeof(long), - oldType: "INTEGER"); - - migrationBuilder.AddColumn( - name: "UserId", - table: "Permissions", - type: "TEXT", - maxLength: 36, - nullable: false, - defaultValue: ""); - - migrationBuilder.AddPrimaryKey( - name: "PK_Tokens", - table: "Tokens", - column: "Token"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_Tokens", - table: "Tokens"); - - migrationBuilder.DropColumn( - name: "UserId", - table: "Permissions"); - - migrationBuilder.AlterColumn( - name: "Id", - table: "Users", - type: "INTEGER", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 36) - .Annotation("Sqlite:Autoincrement", true); - - migrationBuilder.AlterColumn( - name: "UserId", - table: "Tokens", - type: "INTEGER", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 36); - - migrationBuilder.AddColumn( - name: "Id", - table: "Tokens", - type: "INTEGER", - nullable: false, - defaultValue: 0L) - .Annotation("Sqlite:Autoincrement", true); - - migrationBuilder.AddColumn( - name: "OwnerId", - table: "Permissions", - type: "INTEGER", - nullable: false, - defaultValue: 0L); - - migrationBuilder.AddPrimaryKey( - name: "PK_Tokens", - table: "Tokens", - column: "Id"); - } - } -} diff --git a/DatabaseTest/Migrations/DatabaseContextModelSnapshot.cs b/DatabaseTest/Migrations/DatabaseContextModelSnapshot.cs deleted file mode 100644 index d4c5d10..0000000 --- a/DatabaseTest/Migrations/DatabaseContextModelSnapshot.cs +++ /dev/null @@ -1,97 +0,0 @@ -// -using System; -using DatabaseTest; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace DatabaseTest.Migrations -{ - [DbContext(typeof(DatabaseContext))] - partial class DatabaseContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.PermissionEntry", b => - { - b.Property("RecordId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GrantedAt") - .HasColumnType("TEXT"); - - b.Property("PermissionText") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.HasKey("RecordId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.TokenEntry", b => - { - b.Property("Token") - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasMaxLength(1) - .HasColumnType("INTEGER"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.HasKey("Token"); - - b.ToTable("Tokens"); - }); - - modelBuilder.Entity("HopFrame.Database.Models.Entries.UserEntry", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("TEXT"); - - b.Property("CreatedAt") - .HasColumnType("TEXT"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property("Username") - .HasMaxLength(50) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -}