Remove Migrations As I've Moved To A "Database First" Updating Model

This commit is contained in:
Alan Moon 2025-07-06 15:54:33 -07:00
parent 5a8fb7cade
commit feafdc08e2
11 changed files with 0 additions and 1595 deletions

View File

@ -1,133 +0,0 @@
// <auto-generated />
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
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Contacts");
});
modelBuilder.Entity("qtc_api.Models.RefreshToken", b =>
{
b.Property<string>("ID")
.HasColumnType("varchar(255)");
b.Property<DateTime>("Expires")
.HasColumnType("datetime(6)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UserID")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("ValidRefreshTokens");
});
modelBuilder.Entity("qtc_api.Models.Room", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("CreatorId")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Rooms");
});
modelBuilder.Entity("qtc_api.Models.User", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProfilePicture")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Username")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,100 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace qtc_api.Migrations
{
/// <inheritdoc />
public partial class InitialData : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterDatabase()
.Annotation("MySQL:Charset", "utf8mb4");
migrationBuilder.CreateTable(
name: "Contacts",
columns: table => new
{
Id = table.Column<string>(type: "varchar(255)", nullable: false),
OwnerId = table.Column<string>(type: "longtext", nullable: false),
UserId = table.Column<string>(type: "longtext", nullable: false),
Status = table.Column<int>(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<string>(type: "varchar(255)", nullable: false),
Name = table.Column<string>(type: "longtext", nullable: false),
CreatorId = table.Column<string>(type: "longtext", nullable: false),
CreatedAt = table.Column<DateTime>(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<string>(type: "varchar(255)", nullable: false),
Username = table.Column<string>(type: "longtext", nullable: false),
ProfilePicture = table.Column<string>(type: "longtext", nullable: false),
Bio = table.Column<string>(type: "longtext", nullable: false),
Role = table.Column<string>(type: "longtext", nullable: false),
PasswordHash = table.Column<string>(type: "longtext", nullable: false),
Email = table.Column<string>(type: "longtext", nullable: false),
DateOfBirth = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
Status = table.Column<int>(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<string>(type: "varchar(255)", nullable: false),
UserID = table.Column<string>(type: "longtext", nullable: false),
Token = table.Column<string>(type: "longtext", nullable: false),
Expires = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ValidRefreshTokens", x => x.ID);
})
.Annotation("MySQL:Charset", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Contacts");
migrationBuilder.DropTable(
name: "Rooms");
migrationBuilder.DropTable(
name: "Users");
migrationBuilder.DropTable(
name: "ValidRefreshTokens");
}
}
}

View File

@ -1,136 +0,0 @@
// <auto-generated />
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
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("OwnerStatus")
.HasColumnType("int");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("UserStatus")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Contacts");
});
modelBuilder.Entity("qtc_api.Models.RefreshToken", b =>
{
b.Property<string>("ID")
.HasColumnType("varchar(255)");
b.Property<DateTime>("Expires")
.HasColumnType("datetime(6)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UserID")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("ID");
b.ToTable("ValidRefreshTokens");
});
modelBuilder.Entity("qtc_api.Models.Room", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("CreatorId")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Rooms");
});
modelBuilder.Entity("qtc_api.Models.User", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProfilePicture")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Username")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Users");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -1,39 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace qtc_api.Migrations
{
/// <inheritdoc />
public partial class AddExtraStatus : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Status",
table: "Contacts",
newName: "UserStatus");
migrationBuilder.AddColumn<int>(
name: "OwnerStatus",
table: "Contacts",
type: "int",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "OwnerStatus",
table: "Contacts");
migrationBuilder.RenameColumn(
name: "UserStatus",
table: "Contacts",
newName: "Status");
}
}
}

View File

@ -1,160 +0,0 @@
// <auto-generated />
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
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("OwnerStatus")
.HasColumnType("int");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("UserStatus")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.HasIndex("UserId");
b.ToTable("Contact");
});
modelBuilder.Entity("qtc_api.Models.RefreshToken", b =>
{
b.Property<string>("ID")
.HasColumnType("varchar(255)");
b.Property<DateTime>("Expires")
.HasColumnType("datetime(6)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UserID")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("ID");
b.HasIndex("UserID");
b.ToTable("RefreshToken");
});
modelBuilder.Entity("qtc_api.Models.User", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProfilePicture")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("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
}
}
}

View File

@ -1,226 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace qtc_api.Migrations
{
/// <inheritdoc />
public partial class RefreshTokensForeignKey : Migration
{
/// <inheritdoc />
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<string>(
name: "UserID",
table: "RefreshToken",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "Contact",
type: "varchar(255)",
nullable: false,
oldClrType: typeof(string),
oldType: "longtext");
migrationBuilder.AlterColumn<string>(
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);
}
/// <inheritdoc />
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<string>(
name: "UserID",
table: "ValidRefreshTokens",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "Contacts",
type: "longtext",
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(255)");
migrationBuilder.AlterColumn<string>(
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<string>(type: "varchar(255)", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
CreatorId = table.Column<string>(type: "longtext", nullable: false),
Name = table.Column<string>(type: "longtext", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Rooms", x => x.Id);
})
.Annotation("MySQL:Charset", "utf8mb4");
}
}
}

View File

@ -1,181 +0,0 @@
// <auto-generated />
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
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("OwnerStatus")
.HasColumnType("int");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("UserStatus")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.HasIndex("UserId");
b.ToTable("Contact");
});
modelBuilder.Entity("qtc_api.Models.RefreshToken", b =>
{
b.Property<string>("ID")
.HasColumnType("varchar(255)");
b.Property<DateTime>("Expires")
.HasColumnType("datetime(6)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UserID")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("ID");
b.HasIndex("UserID");
b.ToTable("RefreshToken");
});
modelBuilder.Entity("qtc_api.Models.Room", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("CreatorId")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Room");
});
modelBuilder.Entity("qtc_api.Models.User", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProfilePicture")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("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
}
}
}

View File

@ -1,37 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace qtc_api.Migrations
{
/// <inheritdoc />
public partial class AddRemainingRelations : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Room",
columns: table => new
{
Id = table.Column<string>(type: "varchar(255)", nullable: false),
Name = table.Column<string>(type: "longtext", nullable: false),
CreatorId = table.Column<string>(type: "longtext", nullable: false),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Room", x => x.Id);
})
.Annotation("MySQL:Charset", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Room");
}
}
}

View File

@ -1,181 +0,0 @@
// <auto-generated />
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
{
/// <inheritdoc />
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<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("OwnerStatus")
.HasColumnType("int");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("UserStatus")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.HasIndex("UserId");
b.ToTable("Contacts");
});
modelBuilder.Entity("qtc_api.Models.RefreshToken", b =>
{
b.Property<string>("ID")
.HasColumnType("varchar(255)");
b.Property<DateTime>("Expires")
.HasColumnType("datetime(6)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UserID")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("ID");
b.HasIndex("UserID");
b.ToTable("ValidRefreshTokens");
});
modelBuilder.Entity("qtc_api.Models.Room", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("CreatorId")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Rooms");
});
modelBuilder.Entity("qtc_api.Models.User", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProfilePicture")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("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
}
}
}

View File

@ -1,224 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace qtc_api.Migrations
{
/// <inheritdoc />
public partial class ValidRefreshTokens : Migration
{
/// <inheritdoc />
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);
}
/// <inheritdoc />
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);
}
}
}

View File

@ -1,178 +0,0 @@
// <auto-generated />
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<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("OwnerId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("OwnerStatus")
.HasColumnType("int");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("varchar(255)");
b.Property<int>("UserStatus")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("OwnerId");
b.HasIndex("UserId");
b.ToTable("Contacts");
});
modelBuilder.Entity("qtc_api.Models.RefreshToken", b =>
{
b.Property<string>("ID")
.HasColumnType("varchar(255)");
b.Property<DateTime>("Expires")
.HasColumnType("datetime(6)");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("UserID")
.IsRequired()
.HasColumnType("varchar(255)");
b.HasKey("ID");
b.HasIndex("UserID");
b.ToTable("ValidRefreshTokens");
});
modelBuilder.Entity("qtc_api.Models.Room", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("CreatorId")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("longtext");
b.HasKey("Id");
b.ToTable("Rooms");
});
modelBuilder.Entity("qtc_api.Models.User", b =>
{
b.Property<string>("Id")
.HasColumnType("varchar(255)");
b.Property<string>("Bio")
.IsRequired()
.HasColumnType("longtext");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("DateOfBirth")
.HasColumnType("datetime(6)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("ProfilePicture")
.IsRequired()
.HasColumnType("longtext");
b.Property<string>("Role")
.IsRequired()
.HasColumnType("longtext");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("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
}
}
}