Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 192 additions & 0 deletions Migrations/20251123194301_ProjectAuditAndSlug.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions Migrations/20251123194301_ProjectAuditAndSlug.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace sparkly_server.Services.Users.Migrations
{
/// <inheritdoc />
public partial class ProjectAuditAndSlug : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "UserName",
table: "users",
type: "character varying(20)",
maxLength: 20,
nullable: false,
oldClrType: typeof(string),
oldType: "text");

migrationBuilder.AlterColumn<string>(
name: "Role",
table: "users",
type: "character varying(20)",
maxLength: 20,
nullable: false,
oldClrType: typeof(string),
oldType: "text");

migrationBuilder.AlterColumn<string>(
name: "PasswordHash",
table: "users",
type: "character varying(300)",
maxLength: 300,
nullable: false,
oldClrType: typeof(string),
oldType: "text");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "UserName",
table: "users",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(20)",
oldMaxLength: 20);

migrationBuilder.AlterColumn<string>(
name: "Role",
table: "users",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(20)",
oldMaxLength: 20);

migrationBuilder.AlterColumn<string>(
name: "PasswordHash",
table: "users",
type: "text",
nullable: false,
oldClrType: typeof(string),
oldType: "character varying(300)",
oldMaxLength: 300);
}
}
}
17 changes: 10 additions & 7 deletions Migrations/AppDbContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("projects", (string)null);
});

modelBuilder.Entity("sparkly_server.Domain.User", b =>
modelBuilder.Entity("sparkly_server.Domain.Users.User", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
Expand All @@ -132,15 +132,18 @@ protected override void BuildModel(ModelBuilder modelBuilder)

b.Property<string>("PasswordHash")
.IsRequired()
.HasColumnType("text");
.HasMaxLength(300)
.HasColumnType("character varying(300)");

b.Property<string>("Role")
.IsRequired()
.HasColumnType("text");
.HasMaxLength(20)
.HasColumnType("character varying(20)");

b.Property<string>("UserName")
.IsRequired()
.HasColumnType("text");
.HasMaxLength(20)
.HasColumnType("character varying(20)");

b.HasKey("Id");

Expand All @@ -152,7 +155,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

modelBuilder.Entity("ProjectUser", b =>
{
b.HasOne("sparkly_server.Domain.User", null)
b.HasOne("sparkly_server.Domain.Users.User", null)
.WithMany()
.HasForeignKey("MembersId")
.OnDelete(DeleteBehavior.Cascade)
Expand All @@ -167,7 +170,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

modelBuilder.Entity("sparkly_server.Domain.Auth.RefreshToken", b =>
{
b.HasOne("sparkly_server.Domain.User", "User")
b.HasOne("sparkly_server.Domain.Users.User", "User")
.WithMany("RefreshTokens")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
Expand All @@ -176,7 +179,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Navigation("User");
});

modelBuilder.Entity("sparkly_server.Domain.User", b =>
modelBuilder.Entity("sparkly_server.Domain.Users.User", b =>
{
b.Navigation("RefreshTokens");
});
Expand Down
Loading