Skip to content

Commit

Permalink
cleanup migrations
Browse files Browse the repository at this point in the history
Barsonax committed Apr 26, 2024
1 parent 1d9207c commit 75ad864
Showing 8 changed files with 27 additions and 465 deletions.

This file was deleted.

142 changes: 0 additions & 142 deletions CleanAspCore/Data/Migrations/20230716140415_RemoveHasKey.Designer.cs

This file was deleted.

73 changes: 0 additions & 73 deletions CleanAspCore/Data/Migrations/20230716140415_RemoveHasKey.cs

This file was deleted.

106 changes: 0 additions & 106 deletions CleanAspCore/Data/Migrations/20240426115911_UseGuid.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace CleanAspCore.Persistance.Migrations
namespace CleanAspCore.Migrations
{
/// <inheritdoc />
public partial class InitialMigration : Migration
@@ -14,7 +15,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Departments",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
City = table.Column<string>(type: "text", nullable: false)
},
@@ -27,7 +28,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Jobs",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
@@ -39,13 +40,13 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "Employees",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<Guid>(type: "uuid", nullable: false),
FirstName = table.Column<string>(type: "text", nullable: false),
LastName = table.Column<string>(type: "text", nullable: false),
Email = table.Column<string>(type: "text", nullable: false),
Gender = table.Column<string>(type: "text", nullable: false),
DepartmentId = table.Column<int>(type: "integer", nullable: false),
JobId = table.Column<int>(type: "integer", nullable: false)
DepartmentId = table.Column<Guid>(type: "uuid", nullable: false),
JobId = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
16 changes: 8 additions & 8 deletions CleanAspCore/Data/Migrations/HrContextModelSnapshot.cs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

#nullable disable

namespace CleanAspCore.Persistance.Migrations
namespace CleanAspCore.Migrations
{
[DbContext(typeof(HrContext))]
partial class HrContextModelSnapshot : ModelSnapshot
@@ -22,7 +22,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)

NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

modelBuilder.Entity("CleanAspCore.Domain.Departments.Department", b =>
modelBuilder.Entity("CleanAspCore.Data.Models.Department", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -41,7 +41,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("Departments");
});

modelBuilder.Entity("CleanAspCore.Domain.Employees.Employee", b =>
modelBuilder.Entity("CleanAspCore.Data.Models.Employee", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -74,7 +74,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("Employees");
});

modelBuilder.Entity("CleanAspCore.Domain.Jobs.Job", b =>
modelBuilder.Entity("CleanAspCore.Data.Models.Job", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
@@ -89,21 +89,21 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("Jobs");
});

modelBuilder.Entity("CleanAspCore.Domain.Employees.Employee", b =>
modelBuilder.Entity("CleanAspCore.Data.Models.Employee", b =>
{
b.HasOne("CleanAspCore.Domain.Departments.Department", "Department")
b.HasOne("CleanAspCore.Data.Models.Department", "Department")
.WithMany()
.HasForeignKey("DepartmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();

b.HasOne("CleanAspCore.Domain.Jobs.Job", "Job")
b.HasOne("CleanAspCore.Data.Models.Job", "Job")
.WithMany()
.HasForeignKey("JobId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();

b.OwnsOne("CleanAspCore.Domain.Employees.EmailAddress", "Email", b1 =>
b.OwnsOne("CleanAspCore.Domain.EmailAddress", "Email", b1 =>
{
b1.Property<Guid>("EmployeeId")
.HasColumnType("uuid");
2 changes: 1 addition & 1 deletion CleanAspCore/Features/Import/ImportTestData.cs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ namespace CleanAspCore.Features.Import;

internal static class ImportTestData
{
public static async Task<Ok> Handle(HrContext context, CancellationToken cancellationToken)
internal static async Task<Ok> Handle(HrContext context, CancellationToken cancellationToken)
{
var newJobs = new JobFaker().Generate(10);
foreach (var newJob in newJobs)

0 comments on commit 75ad864

Please sign in to comment.