Skip to content

Commit

Permalink
🗃️ ci(profile): update profile class
Browse files Browse the repository at this point in the history
update exceptions and created new ef migration

Signed-off-by: csc530 <[email protected]>
  • Loading branch information
csc530 committed Dec 19, 2023
1 parent a2f166f commit 0e2d78a
Show file tree
Hide file tree
Showing 6 changed files with 294 additions and 51 deletions.

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace resume_builder.Migrations
{
/// <inheritdoc />
public partial class updateProfilePrimaryKeys : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Profiles",
table: "Profiles");

migrationBuilder.DropColumn(
name: "FullName",
table: "Profiles");

migrationBuilder.DropColumn(
name: "WholeName",
table: "Profiles");

migrationBuilder.AlterColumn<string>(
name: "MiddleName",
table: "Profiles",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");

migrationBuilder.AlterColumn<string>(
name: "Company",
table: "Jobs",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);

migrationBuilder.AddPrimaryKey(
name: "PK_Profiles",
table: "Profiles",
columns: new[] { "FirstName", "LastName", "EmailAddress", "PhoneNumber" });
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropPrimaryKey(
name: "PK_Profiles",
table: "Profiles");

migrationBuilder.AlterColumn<string>(
name: "MiddleName",
table: "Profiles",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);

migrationBuilder.AddColumn<string>(
name: "FullName",
table: "Profiles",
type: "TEXT",
nullable: false,
defaultValue: "");

migrationBuilder.AddColumn<string>(
name: "WholeName",
table: "Profiles",
type: "TEXT",
nullable: false,
defaultValue: "");

migrationBuilder.AlterColumn<string>(
name: "Company",
table: "Jobs",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");

migrationBuilder.AddPrimaryKey(
name: "PK_Profiles",
table: "Profiles",
columns: new[] { "FirstName", "MiddleName", "LastName" });
}
}
}
17 changes: 4 additions & 13 deletions resume builder/Migrations/ResumeContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("TEXT");

b.Property<string>("Company")
.IsRequired()
.HasColumnType("TEXT");

b.Property<string>("Description")
Expand Down Expand Up @@ -62,22 +63,16 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("FirstName")
.HasColumnType("TEXT");

b.Property<string>("MiddleName")
.HasColumnType("TEXT");

b.Property<string>("LastName")
.HasColumnType("TEXT");

b.Property<string>("EmailAddress")
.IsRequired()
.HasColumnType("TEXT");

b.Property<string>("FullName")
.IsRequired()
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");

b.Property<string>("PhoneNumber")
.IsRequired()
b.Property<string>("MiddleName")
.HasColumnType("TEXT");

b.Property<string>("Summary")
Expand All @@ -86,11 +81,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("Website")
.HasColumnType("TEXT");

b.Property<string>("WholeName")
.IsRequired()
.HasColumnType("TEXT");

b.HasKey("FirstName", "MiddleName", "LastName");
b.HasKey("FirstName", "LastName", "EmailAddress", "PhoneNumber");

b.ToTable("Profiles");
});
Expand Down
16 changes: 16 additions & 0 deletions resume builder/cli/commands/edit/EditJobCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Diagnostics.CodeAnalysis;
using Spectre.Console.Cli;

namespace resume_builder.cli.commands.edit;

public class EditJobCommand: Command<EditJobSettings>
{
public override int Execute([NotNull] CommandContext context, [NotNull] EditJobSettings settings)
{
throw new NotImplementedException();
}
}

public class EditJobSettings: CommandSettings
{
}
Loading

0 comments on commit 0e2d78a

Please sign in to comment.