From feafdc08e2c2d32e8e3543c445e041c26c1e59aa Mon Sep 17 00:00:00 2001 From: AlanMoonbase Date: Sun, 6 Jul 2025 15:54:33 -0700 Subject: [PATCH] Remove Migrations As I've Moved To A "Database First" Updating Model --- .../20250605232504_InitialData.Designer.cs | 133 ----------- .../Migrations/20250605232504_InitialData.cs | 100 -------- .../20250606000415_AddExtraStatus.Designer.cs | 136 ----------- .../20250606000415_AddExtraStatus.cs | 39 --- ...203855_RefreshTokensForeignKey.Designer.cs | 160 ------------- .../20250608203855_RefreshTokensForeignKey.cs | 226 ------------------ ...08204114_AddRemainingRelations.Designer.cs | 181 -------------- .../20250608204114_AddRemainingRelations.cs | 37 --- ...50608204625_ValidRefreshTokens.Designer.cs | 181 -------------- .../20250608204625_ValidRefreshTokens.cs | 224 ----------------- .../Migrations/DataContextModelSnapshot.cs | 178 -------------- 11 files changed, 1595 deletions(-) delete mode 100644 qtc-net-server/Migrations/20250605232504_InitialData.Designer.cs delete mode 100644 qtc-net-server/Migrations/20250605232504_InitialData.cs delete mode 100644 qtc-net-server/Migrations/20250606000415_AddExtraStatus.Designer.cs delete mode 100644 qtc-net-server/Migrations/20250606000415_AddExtraStatus.cs delete mode 100644 qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.Designer.cs delete mode 100644 qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.cs delete mode 100644 qtc-net-server/Migrations/20250608204114_AddRemainingRelations.Designer.cs delete mode 100644 qtc-net-server/Migrations/20250608204114_AddRemainingRelations.cs delete mode 100644 qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.Designer.cs delete mode 100644 qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.cs delete mode 100644 qtc-net-server/Migrations/DataContextModelSnapshot.cs diff --git a/qtc-net-server/Migrations/20250605232504_InitialData.Designer.cs b/qtc-net-server/Migrations/20250605232504_InitialData.Designer.cs deleted file mode 100644 index cb877b3..0000000 --- a/qtc-net-server/Migrations/20250605232504_InitialData.Designer.cs +++ /dev/null @@ -1,133 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using qtc_api.Data; - -#nullable disable - -namespace qtc_api.Migrations -{ - [DbContext(typeof(DataContext))] - [Migration("20250605232504_InitialData")] - partial class InitialData - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.Property("ID") - .HasColumnType("varchar(255)"); - - b.Property("Expires") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserID") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ID"); - - b.ToTable("ValidRefreshTokens"); - }); - - modelBuilder.Entity("qtc_api.Models.Room", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatorId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Rooms"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Bio") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("DateOfBirth") - .HasColumnType("datetime(6)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Username") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/qtc-net-server/Migrations/20250605232504_InitialData.cs b/qtc-net-server/Migrations/20250605232504_InitialData.cs deleted file mode 100644 index c3c3e44..0000000 --- a/qtc-net-server/Migrations/20250605232504_InitialData.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace qtc_api.Migrations -{ - /// - public partial class InitialData : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterDatabase() - .Annotation("MySQL:Charset", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Contacts", - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false), - OwnerId = table.Column(type: "longtext", nullable: false), - UserId = table.Column(type: "longtext", nullable: false), - Status = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Contacts", x => x.Id); - }) - .Annotation("MySQL:Charset", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Rooms", - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false), - Name = table.Column(type: "longtext", nullable: false), - CreatorId = table.Column(type: "longtext", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Rooms", x => x.Id); - }) - .Annotation("MySQL:Charset", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "Users", - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false), - Username = table.Column(type: "longtext", nullable: false), - ProfilePicture = table.Column(type: "longtext", nullable: false), - Bio = table.Column(type: "longtext", nullable: false), - Role = table.Column(type: "longtext", nullable: false), - PasswordHash = table.Column(type: "longtext", nullable: false), - Email = table.Column(type: "longtext", nullable: false), - DateOfBirth = table.Column(type: "datetime(6)", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - Status = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }) - .Annotation("MySQL:Charset", "utf8mb4"); - - migrationBuilder.CreateTable( - name: "ValidRefreshTokens", - columns: table => new - { - ID = table.Column(type: "varchar(255)", nullable: false), - UserID = table.Column(type: "longtext", nullable: false), - Token = table.Column(type: "longtext", nullable: false), - Expires = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ValidRefreshTokens", x => x.ID); - }) - .Annotation("MySQL:Charset", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Contacts"); - - migrationBuilder.DropTable( - name: "Rooms"); - - migrationBuilder.DropTable( - name: "Users"); - - migrationBuilder.DropTable( - name: "ValidRefreshTokens"); - } - } -} diff --git a/qtc-net-server/Migrations/20250606000415_AddExtraStatus.Designer.cs b/qtc-net-server/Migrations/20250606000415_AddExtraStatus.Designer.cs deleted file mode 100644 index 8d655b0..0000000 --- a/qtc-net-server/Migrations/20250606000415_AddExtraStatus.Designer.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using qtc_api.Data; - -#nullable disable - -namespace qtc_api.Migrations -{ - [DbContext(typeof(DataContext))] - [Migration("20250606000415_AddExtraStatus")] - partial class AddExtraStatus - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("OwnerStatus") - .HasColumnType("int"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserStatus") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.Property("ID") - .HasColumnType("varchar(255)"); - - b.Property("Expires") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserID") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("ID"); - - b.ToTable("ValidRefreshTokens"); - }); - - modelBuilder.Entity("qtc_api.Models.Room", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatorId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Rooms"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Bio") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("DateOfBirth") - .HasColumnType("datetime(6)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Username") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/qtc-net-server/Migrations/20250606000415_AddExtraStatus.cs b/qtc-net-server/Migrations/20250606000415_AddExtraStatus.cs deleted file mode 100644 index edd5c4f..0000000 --- a/qtc-net-server/Migrations/20250606000415_AddExtraStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace qtc_api.Migrations -{ - /// - public partial class AddExtraStatus : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Status", - table: "Contacts", - newName: "UserStatus"); - - migrationBuilder.AddColumn( - name: "OwnerStatus", - table: "Contacts", - type: "int", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "OwnerStatus", - table: "Contacts"); - - migrationBuilder.RenameColumn( - name: "UserStatus", - table: "Contacts", - newName: "Status"); - } - } -} diff --git a/qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.Designer.cs b/qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.Designer.cs deleted file mode 100644 index 5162924..0000000 --- a/qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.Designer.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using qtc_api.Data; - -#nullable disable - -namespace qtc_api.Migrations -{ - [DbContext(typeof(DataContext))] - [Migration("20250608203855_RefreshTokensForeignKey")] - partial class RefreshTokensForeignKey - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("OwnerStatus") - .HasColumnType("int"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("UserStatus") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.HasIndex("UserId"); - - b.ToTable("Contact"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.Property("ID") - .HasColumnType("varchar(255)"); - - b.Property("Expires") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserID") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("ID"); - - b.HasIndex("UserID"); - - b.ToTable("RefreshToken"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Bio") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("DateOfBirth") - .HasColumnType("datetime(6)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Username") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("User"); - }); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.HasOne("qtc_api.Models.User", "Owner") - .WithMany("ContactsMade") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("qtc_api.Models.User", "User") - .WithMany("ContactsList") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.HasOne("qtc_api.Models.User", "User") - .WithMany("RefreshTokens") - .HasForeignKey("UserID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Navigation("ContactsList"); - - b.Navigation("ContactsMade"); - - b.Navigation("RefreshTokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.cs b/qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.cs deleted file mode 100644 index 34926cb..0000000 --- a/qtc-net-server/Migrations/20250608203855_RefreshTokensForeignKey.cs +++ /dev/null @@ -1,226 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace qtc_api.Migrations -{ - /// - public partial class RefreshTokensForeignKey : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Rooms"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ValidRefreshTokens", - table: "ValidRefreshTokens"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Users", - table: "Users"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Contacts", - table: "Contacts"); - - migrationBuilder.RenameTable( - name: "ValidRefreshTokens", - newName: "RefreshToken"); - - migrationBuilder.RenameTable( - name: "Users", - newName: "User"); - - migrationBuilder.RenameTable( - name: "Contacts", - newName: "Contact"); - - migrationBuilder.AlterColumn( - name: "UserID", - table: "RefreshToken", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext"); - - migrationBuilder.AlterColumn( - name: "UserId", - table: "Contact", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext"); - - migrationBuilder.AlterColumn( - name: "OwnerId", - table: "Contact", - type: "varchar(255)", - nullable: false, - oldClrType: typeof(string), - oldType: "longtext"); - - migrationBuilder.AddPrimaryKey( - name: "PK_RefreshToken", - table: "RefreshToken", - column: "ID"); - - migrationBuilder.AddPrimaryKey( - name: "PK_User", - table: "User", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Contact", - table: "Contact", - column: "Id"); - - migrationBuilder.CreateIndex( - name: "IX_RefreshToken_UserID", - table: "RefreshToken", - column: "UserID"); - - migrationBuilder.CreateIndex( - name: "IX_Contact_OwnerId", - table: "Contact", - column: "OwnerId"); - - migrationBuilder.CreateIndex( - name: "IX_Contact_UserId", - table: "Contact", - column: "UserId"); - - migrationBuilder.AddForeignKey( - name: "FK_Contact_User_OwnerId", - table: "Contact", - column: "OwnerId", - principalTable: "User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Contact_User_UserId", - table: "Contact", - column: "UserId", - principalTable: "User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RefreshToken_User_UserID", - table: "RefreshToken", - column: "UserID", - principalTable: "User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Contact_User_OwnerId", - table: "Contact"); - - migrationBuilder.DropForeignKey( - name: "FK_Contact_User_UserId", - table: "Contact"); - - migrationBuilder.DropForeignKey( - name: "FK_RefreshToken_User_UserID", - table: "RefreshToken"); - - migrationBuilder.DropPrimaryKey( - name: "PK_User", - table: "User"); - - migrationBuilder.DropPrimaryKey( - name: "PK_RefreshToken", - table: "RefreshToken"); - - migrationBuilder.DropIndex( - name: "IX_RefreshToken_UserID", - table: "RefreshToken"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Contact", - table: "Contact"); - - migrationBuilder.DropIndex( - name: "IX_Contact_OwnerId", - table: "Contact"); - - migrationBuilder.DropIndex( - name: "IX_Contact_UserId", - table: "Contact"); - - migrationBuilder.RenameTable( - name: "User", - newName: "Users"); - - migrationBuilder.RenameTable( - name: "RefreshToken", - newName: "ValidRefreshTokens"); - - migrationBuilder.RenameTable( - name: "Contact", - newName: "Contacts"); - - migrationBuilder.AlterColumn( - name: "UserID", - table: "ValidRefreshTokens", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)"); - - migrationBuilder.AlterColumn( - name: "UserId", - table: "Contacts", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)"); - - migrationBuilder.AlterColumn( - name: "OwnerId", - table: "Contacts", - type: "longtext", - nullable: false, - oldClrType: typeof(string), - oldType: "varchar(255)"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Users", - table: "Users", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_ValidRefreshTokens", - table: "ValidRefreshTokens", - column: "ID"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Contacts", - table: "Contacts", - column: "Id"); - - migrationBuilder.CreateTable( - name: "Rooms", - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false), - CreatorId = table.Column(type: "longtext", nullable: false), - Name = table.Column(type: "longtext", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Rooms", x => x.Id); - }) - .Annotation("MySQL:Charset", "utf8mb4"); - } - } -} diff --git a/qtc-net-server/Migrations/20250608204114_AddRemainingRelations.Designer.cs b/qtc-net-server/Migrations/20250608204114_AddRemainingRelations.Designer.cs deleted file mode 100644 index 21d0297..0000000 --- a/qtc-net-server/Migrations/20250608204114_AddRemainingRelations.Designer.cs +++ /dev/null @@ -1,181 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using qtc_api.Data; - -#nullable disable - -namespace qtc_api.Migrations -{ - [DbContext(typeof(DataContext))] - [Migration("20250608204114_AddRemainingRelations")] - partial class AddRemainingRelations - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("OwnerStatus") - .HasColumnType("int"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("UserStatus") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.HasIndex("UserId"); - - b.ToTable("Contact"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.Property("ID") - .HasColumnType("varchar(255)"); - - b.Property("Expires") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserID") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("ID"); - - b.HasIndex("UserID"); - - b.ToTable("RefreshToken"); - }); - - modelBuilder.Entity("qtc_api.Models.Room", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatorId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Room"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Bio") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("DateOfBirth") - .HasColumnType("datetime(6)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Username") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("User"); - }); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.HasOne("qtc_api.Models.User", "Owner") - .WithMany("ContactsMade") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("qtc_api.Models.User", "User") - .WithMany("ContactsList") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.HasOne("qtc_api.Models.User", "User") - .WithMany("RefreshTokens") - .HasForeignKey("UserID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Navigation("ContactsList"); - - b.Navigation("ContactsMade"); - - b.Navigation("RefreshTokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/qtc-net-server/Migrations/20250608204114_AddRemainingRelations.cs b/qtc-net-server/Migrations/20250608204114_AddRemainingRelations.cs deleted file mode 100644 index 8497ef0..0000000 --- a/qtc-net-server/Migrations/20250608204114_AddRemainingRelations.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace qtc_api.Migrations -{ - /// - public partial class AddRemainingRelations : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Room", - columns: table => new - { - Id = table.Column(type: "varchar(255)", nullable: false), - Name = table.Column(type: "longtext", nullable: false), - CreatorId = table.Column(type: "longtext", nullable: false), - CreatedAt = table.Column(type: "datetime(6)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Room", x => x.Id); - }) - .Annotation("MySQL:Charset", "utf8mb4"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Room"); - } - } -} diff --git a/qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.Designer.cs b/qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.Designer.cs deleted file mode 100644 index 4fd845e..0000000 --- a/qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.Designer.cs +++ /dev/null @@ -1,181 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using qtc_api.Data; - -#nullable disable - -namespace qtc_api.Migrations -{ - [DbContext(typeof(DataContext))] - [Migration("20250608204625_ValidRefreshTokens")] - partial class ValidRefreshTokens - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("OwnerStatus") - .HasColumnType("int"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("UserStatus") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.HasIndex("UserId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.Property("ID") - .HasColumnType("varchar(255)"); - - b.Property("Expires") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserID") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("ID"); - - b.HasIndex("UserID"); - - b.ToTable("ValidRefreshTokens"); - }); - - modelBuilder.Entity("qtc_api.Models.Room", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatorId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Rooms"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Bio") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("DateOfBirth") - .HasColumnType("datetime(6)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Username") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.HasOne("qtc_api.Models.User", "Owner") - .WithMany("ContactsMade") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("qtc_api.Models.User", "User") - .WithMany("ContactsList") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.HasOne("qtc_api.Models.User", "User") - .WithMany("RefreshTokens") - .HasForeignKey("UserID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Navigation("ContactsList"); - - b.Navigation("ContactsMade"); - - b.Navigation("RefreshTokens"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.cs b/qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.cs deleted file mode 100644 index 9c4ae5a..0000000 --- a/qtc-net-server/Migrations/20250608204625_ValidRefreshTokens.cs +++ /dev/null @@ -1,224 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace qtc_api.Migrations -{ - /// - public partial class ValidRefreshTokens : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Contact_User_OwnerId", - table: "Contact"); - - migrationBuilder.DropForeignKey( - name: "FK_Contact_User_UserId", - table: "Contact"); - - migrationBuilder.DropForeignKey( - name: "FK_RefreshToken_User_UserID", - table: "RefreshToken"); - - migrationBuilder.DropPrimaryKey( - name: "PK_User", - table: "User"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Room", - table: "Room"); - - migrationBuilder.DropPrimaryKey( - name: "PK_RefreshToken", - table: "RefreshToken"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Contact", - table: "Contact"); - - migrationBuilder.RenameTable( - name: "User", - newName: "Users"); - - migrationBuilder.RenameTable( - name: "Room", - newName: "Rooms"); - - migrationBuilder.RenameTable( - name: "RefreshToken", - newName: "ValidRefreshTokens"); - - migrationBuilder.RenameTable( - name: "Contact", - newName: "Contacts"); - - migrationBuilder.RenameIndex( - name: "IX_RefreshToken_UserID", - table: "ValidRefreshTokens", - newName: "IX_ValidRefreshTokens_UserID"); - - migrationBuilder.RenameIndex( - name: "IX_Contact_UserId", - table: "Contacts", - newName: "IX_Contacts_UserId"); - - migrationBuilder.RenameIndex( - name: "IX_Contact_OwnerId", - table: "Contacts", - newName: "IX_Contacts_OwnerId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Users", - table: "Users", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Rooms", - table: "Rooms", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_ValidRefreshTokens", - table: "ValidRefreshTokens", - column: "ID"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Contacts", - table: "Contacts", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_Contacts_Users_OwnerId", - table: "Contacts", - column: "OwnerId", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Contacts_Users_UserId", - table: "Contacts", - column: "UserId", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_ValidRefreshTokens_Users_UserID", - table: "ValidRefreshTokens", - column: "UserID", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Contacts_Users_OwnerId", - table: "Contacts"); - - migrationBuilder.DropForeignKey( - name: "FK_Contacts_Users_UserId", - table: "Contacts"); - - migrationBuilder.DropForeignKey( - name: "FK_ValidRefreshTokens_Users_UserID", - table: "ValidRefreshTokens"); - - migrationBuilder.DropPrimaryKey( - name: "PK_ValidRefreshTokens", - table: "ValidRefreshTokens"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Users", - table: "Users"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Rooms", - table: "Rooms"); - - migrationBuilder.DropPrimaryKey( - name: "PK_Contacts", - table: "Contacts"); - - migrationBuilder.RenameTable( - name: "ValidRefreshTokens", - newName: "RefreshToken"); - - migrationBuilder.RenameTable( - name: "Users", - newName: "User"); - - migrationBuilder.RenameTable( - name: "Rooms", - newName: "Room"); - - migrationBuilder.RenameTable( - name: "Contacts", - newName: "Contact"); - - migrationBuilder.RenameIndex( - name: "IX_ValidRefreshTokens_UserID", - table: "RefreshToken", - newName: "IX_RefreshToken_UserID"); - - migrationBuilder.RenameIndex( - name: "IX_Contacts_UserId", - table: "Contact", - newName: "IX_Contact_UserId"); - - migrationBuilder.RenameIndex( - name: "IX_Contacts_OwnerId", - table: "Contact", - newName: "IX_Contact_OwnerId"); - - migrationBuilder.AddPrimaryKey( - name: "PK_RefreshToken", - table: "RefreshToken", - column: "ID"); - - migrationBuilder.AddPrimaryKey( - name: "PK_User", - table: "User", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Room", - table: "Room", - column: "Id"); - - migrationBuilder.AddPrimaryKey( - name: "PK_Contact", - table: "Contact", - column: "Id"); - - migrationBuilder.AddForeignKey( - name: "FK_Contact_User_OwnerId", - table: "Contact", - column: "OwnerId", - principalTable: "User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Contact_User_UserId", - table: "Contact", - column: "UserId", - principalTable: "User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RefreshToken_User_UserID", - table: "RefreshToken", - column: "UserID", - principalTable: "User", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/qtc-net-server/Migrations/DataContextModelSnapshot.cs b/qtc-net-server/Migrations/DataContextModelSnapshot.cs deleted file mode 100644 index 311e25c..0000000 --- a/qtc-net-server/Migrations/DataContextModelSnapshot.cs +++ /dev/null @@ -1,178 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using qtc_api.Data; - -#nullable disable - -namespace qtc_api.Migrations -{ - [DbContext(typeof(DataContext))] - partial class DataContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "9.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 64); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("OwnerId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("OwnerStatus") - .HasColumnType("int"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.Property("UserStatus") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("OwnerId"); - - b.HasIndex("UserId"); - - b.ToTable("Contacts"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.Property("ID") - .HasColumnType("varchar(255)"); - - b.Property("Expires") - .HasColumnType("datetime(6)"); - - b.Property("Token") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("UserID") - .IsRequired() - .HasColumnType("varchar(255)"); - - b.HasKey("ID"); - - b.HasIndex("UserID"); - - b.ToTable("ValidRefreshTokens"); - }); - - modelBuilder.Entity("qtc_api.Models.Room", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("CreatorId") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Name") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Rooms"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Property("Id") - .HasColumnType("varchar(255)"); - - b.Property("Bio") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("CreatedAt") - .HasColumnType("datetime(6)"); - - b.Property("DateOfBirth") - .HasColumnType("datetime(6)"); - - b.Property("Email") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Role") - .IsRequired() - .HasColumnType("longtext"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Username") - .IsRequired() - .HasColumnType("longtext"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("qtc_api.Models.Contact", b => - { - b.HasOne("qtc_api.Models.User", "Owner") - .WithMany("ContactsMade") - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("qtc_api.Models.User", "User") - .WithMany("ContactsList") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Owner"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.RefreshToken", b => - { - b.HasOne("qtc_api.Models.User", "User") - .WithMany("RefreshTokens") - .HasForeignKey("UserID") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("qtc_api.Models.User", b => - { - b.Navigation("ContactsList"); - - b.Navigation("ContactsMade"); - - b.Navigation("RefreshTokens"); - }); -#pragma warning restore 612, 618 - } - } -}