diff --git a/src/SkillBridge/Data/AppDbContext.cs b/src/SkillBridge/Data/AppDbContext.cs index fba5913..6431dea 100644 --- a/src/SkillBridge/Data/AppDbContext.cs +++ b/src/SkillBridge/Data/AppDbContext.cs @@ -44,6 +44,9 @@ public class AppDbContext : DbContext /// public DbSet UserProjectAssignments { get; set; } = null!; + + public DbSet UserAssignmentTasks { get; set; } = null!; + /// /// Initializes a new instance of the class. /// diff --git a/src/SkillBridge/Data/Configurations/AssignmentTaskConfiguration.cs b/src/SkillBridge/Data/Configurations/AssignmentTaskConfiguration.cs index fae6980..81cf1a8 100644 --- a/src/SkillBridge/Data/Configurations/AssignmentTaskConfiguration.cs +++ b/src/SkillBridge/Data/Configurations/AssignmentTaskConfiguration.cs @@ -32,10 +32,6 @@ public void Configure(EntityTypeBuilder builder) .HasColumnName("description") .HasMaxLength(ValidationConstants.AssignmentTask.DescriptionMaxLength); - builder.Property(e => e.IsCompleted) - .HasColumnName("is_completed") - .IsRequired(); - builder.Property(e => e.Sequence) .HasColumnName("sequence") .IsRequired(); @@ -56,10 +52,14 @@ public void Configure(EntityTypeBuilder builder) .WithMany(p => p.Tasks) .HasForeignKey(e => e.ProjectAssignmentId) .OnDelete(DeleteBehavior.Cascade); - + + builder.HasMany(e => e.UserProjectAssignmentTasks) + .WithOne(uat => uat.AssignmentTask) + .HasForeignKey(uat => uat.AssignmentTaskId) + .OnDelete(DeleteBehavior.Cascade); + // Create indexes for common queries builder.HasIndex(e => e.ProjectAssignmentId); builder.HasIndex(e => e.Sequence); - builder.HasIndex(e => e.IsCompleted); } } \ No newline at end of file diff --git a/src/SkillBridge/Data/Configurations/UserAssignmentTaskConfiguration.cs b/src/SkillBridge/Data/Configurations/UserAssignmentTaskConfiguration.cs new file mode 100644 index 0000000..b45ce30 --- /dev/null +++ b/src/SkillBridge/Data/Configurations/UserAssignmentTaskConfiguration.cs @@ -0,0 +1,50 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using SkillBridge.Models.Entities; + +namespace SkillBridge.Data.Configurations +{ + public class UserAssignmentTaskConfiguration : IEntityTypeConfiguration + { + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("user_assignment_tasks"); + + // Composite PK: (user_profile_id, project_assignment_id, assignment_task_id) + builder.HasKey(e => new { e.UserProfileId, e.ProjectAssignmentId, e.AssignmentTaskId }); + + // Columns + builder.Property(e => e.UserProfileId) + .HasColumnName("user_profile_id"); + + builder.Property(e => e.ProjectAssignmentId) + .HasColumnName("project_assignment_id"); + + builder.Property(e => e.AssignmentTaskId) + .HasColumnName("assignment_task_id"); + + builder.Property(e => e.IsCompleted) + .HasColumnName("is_completed") + .HasDefaultValue(false); + + // Relationships + builder.HasOne(e => e.UserProjectAssignment) + .WithMany(upa => upa.UserProjectAssignmentTasks) + .HasForeignKey(e => new { e.UserProfileId, e.ProjectAssignmentId }) + .HasPrincipalKey(upa => new { upa.UserProfileId, upa.ProjectAssignmentId }) + .OnDelete(DeleteBehavior.Cascade); + + builder.HasOne(e => e.AssignmentTask) + .WithMany(t => t.UserProjectAssignmentTasks) + .HasForeignKey(e => e.AssignmentTaskId) + .OnDelete(DeleteBehavior.Cascade); + + // Optional helpful indexes (keep if your queries use them) + builder.HasIndex(e => e.AssignmentTaskId) + .HasDatabaseName("ix_user_assignment_tasks_assignment_task_id"); + + builder.HasIndex(e => new { e.UserProfileId, e.ProjectAssignmentId }) + .HasDatabaseName("ix_user_assignment_tasks_user_project"); + } + } +} diff --git a/src/SkillBridge/Data/Configurations/UserProjectAssignmentConfiguration.cs b/src/SkillBridge/Data/Configurations/UserProjectAssignmentConfiguration.cs index a37231e..9430d44 100644 --- a/src/SkillBridge/Data/Configurations/UserProjectAssignmentConfiguration.cs +++ b/src/SkillBridge/Data/Configurations/UserProjectAssignmentConfiguration.cs @@ -52,6 +52,16 @@ public void Configure(EntityTypeBuilder builder) builder.Property(e => e.CompletedAt) .HasColumnName("completed_at"); + builder.Property(e => e.Deadline) + .HasColumnName("deadline") + .IsRequired(); + + builder.HasMany(e => e.UserProjectAssignmentTasks) + .WithOne(uat => uat.UserProjectAssignment) + .HasForeignKey(uat => new { uat.UserProfileId, uat.ProjectAssignmentId }) + .HasPrincipalKey(e => new { e.UserProfileId, e.ProjectAssignmentId }) + .OnDelete(DeleteBehavior.Cascade); + // Indexes builder.HasIndex(e => e.UserProfileId); builder.HasIndex(e => e.ProjectAssignmentId); diff --git a/src/SkillBridge/Data/Migrations/20250515124827_InitialMigration.Designer.cs b/src/SkillBridge/Data/Migrations/20250515124827_InitialMigration.Designer.cs deleted file mode 100644 index 3e4e39d..0000000 --- a/src/SkillBridge/Data/Migrations/20250515124827_InitialMigration.Designer.cs +++ /dev/null @@ -1,206 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250515124827_InitialMigration")] - partial class InitialMigration - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Endorsify.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.ProjectAssignment", b => - { - b.HasOne("Endorsify.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.ProjectSkill", b => - { - b.HasOne("Endorsify.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Endorsify.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("Endorsify.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250515124827_InitialMigration.cs b/src/SkillBridge/Data/Migrations/20250515124827_InitialMigration.cs deleted file mode 100644 index eb38562..0000000 --- a/src/SkillBridge/Data/Migrations/20250515124827_InitialMigration.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class InitialMigration : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "companies", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), - auth0_user_id = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_companies", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "skills", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), - description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_skills", x => x.id); - }); - - migrationBuilder.CreateTable( - name: "project_assignments", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - title = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - description = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), - deadline = table.Column(type: "timestamp with time zone", nullable: false), - status = table.Column(type: "integer", nullable: false), - company_id = table.Column(type: "uuid", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_project_assignments", x => x.id); - table.ForeignKey( - name: "FK_project_assignments_companies_company_id", - column: x => x.company_id, - principalTable: "companies", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "project_skills", - columns: table => new - { - project_assignment_id = table.Column(type: "uuid", nullable: false), - skill_id = table.Column(type: "uuid", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_project_skills", x => new { x.project_assignment_id, x.skill_id }); - table.ForeignKey( - name: "FK_project_skills_project_assignments_project_assignment_id", - column: x => x.project_assignment_id, - principalTable: "project_assignments", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_project_skills_skills_skill_id", - column: x => x.skill_id, - principalTable: "skills", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_companies_auth0_user_id", - table: "companies", - column: "auth0_user_id", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_project_assignments_company_id", - table: "project_assignments", - column: "company_id"); - - migrationBuilder.CreateIndex( - name: "IX_project_assignments_deadline", - table: "project_assignments", - column: "deadline"); - - migrationBuilder.CreateIndex( - name: "IX_project_assignments_status", - table: "project_assignments", - column: "status"); - - migrationBuilder.CreateIndex( - name: "IX_project_skills_skill_id", - table: "project_skills", - column: "skill_id"); - - migrationBuilder.CreateIndex( - name: "IX_skills_name", - table: "skills", - column: "name", - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "project_skills"); - - migrationBuilder.DropTable( - name: "project_assignments"); - - migrationBuilder.DropTable( - name: "skills"); - - migrationBuilder.DropTable( - name: "companies"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250521161718_updatecompany.Designer.cs b/src/SkillBridge/Data/Migrations/20250521161718_updatecompany.Designer.cs deleted file mode 100644 index 690de0d..0000000 --- a/src/SkillBridge/Data/Migrations/20250521161718_updatecompany.Designer.cs +++ /dev/null @@ -1,277 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250521161718_updatecompany")] - partial class updatecompany - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactInfo") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("contact_info"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250521161718_updatecompany.cs b/src/SkillBridge/Data/Migrations/20250521161718_updatecompany.cs deleted file mode 100644 index 8076e17..0000000 --- a/src/SkillBridge/Data/Migrations/20250521161718_updatecompany.cs +++ /dev/null @@ -1,197 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class updatecompany : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "description", - table: "companies", - newName: "website_url"); - - migrationBuilder.AddColumn( - name: "about", - table: "companies", - type: "character varying(2000)", - maxLength: 2000, - nullable: true); - - migrationBuilder.AddColumn( - name: "activities", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: true); - - migrationBuilder.AddColumn( - name: "banner_url", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: true); - - migrationBuilder.AddColumn( - name: "bulgarian_office_locations", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: true); - - migrationBuilder.AddColumn( - name: "contact_info", - table: "companies", - type: "character varying(1000)", - maxLength: 1000, - nullable: true); - - migrationBuilder.AddColumn( - name: "employees_in_bulgaria", - table: "companies", - type: "integer", - nullable: true); - - migrationBuilder.AddColumn( - name: "employees_worldwide", - table: "companies", - type: "integer", - nullable: true); - - migrationBuilder.AddColumn( - name: "has_offices_in_bulgaria", - table: "companies", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "head_office_location", - table: "companies", - type: "character varying(200)", - maxLength: 200, - nullable: true); - - migrationBuilder.AddColumn( - name: "logo_url", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: true); - - migrationBuilder.AddColumn( - name: "sector", - table: "companies", - type: "character varying(100)", - maxLength: 100, - nullable: true); - - migrationBuilder.AddColumn( - name: "technologies", - table: "companies", - type: "character varying(1000)", - maxLength: 1000, - nullable: true); - - migrationBuilder.AddColumn( - name: "why_work_with_us", - table: "companies", - type: "character varying(2000)", - maxLength: 2000, - nullable: true); - - migrationBuilder.AddColumn( - name: "year_established", - table: "companies", - type: "integer", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_companies_name", - table: "companies", - column: "name"); - - migrationBuilder.CreateIndex( - name: "IX_companies_sector", - table: "companies", - column: "sector"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_companies_name", - table: "companies"); - - migrationBuilder.DropIndex( - name: "IX_companies_sector", - table: "companies"); - - migrationBuilder.DropColumn( - name: "about", - table: "companies"); - - migrationBuilder.DropColumn( - name: "activities", - table: "companies"); - - migrationBuilder.DropColumn( - name: "banner_url", - table: "companies"); - - migrationBuilder.DropColumn( - name: "bulgarian_office_locations", - table: "companies"); - - migrationBuilder.DropColumn( - name: "contact_info", - table: "companies"); - - migrationBuilder.DropColumn( - name: "employees_in_bulgaria", - table: "companies"); - - migrationBuilder.DropColumn( - name: "employees_worldwide", - table: "companies"); - - migrationBuilder.DropColumn( - name: "has_offices_in_bulgaria", - table: "companies"); - - migrationBuilder.DropColumn( - name: "head_office_location", - table: "companies"); - - migrationBuilder.DropColumn( - name: "logo_url", - table: "companies"); - - migrationBuilder.DropColumn( - name: "sector", - table: "companies"); - - migrationBuilder.DropColumn( - name: "technologies", - table: "companies"); - - migrationBuilder.DropColumn( - name: "why_work_with_us", - table: "companies"); - - migrationBuilder.DropColumn( - name: "year_established", - table: "companies"); - - migrationBuilder.RenameColumn( - name: "website_url", - table: "companies", - newName: "description"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250716104712_TasksAdded.Designer.cs b/src/SkillBridge/Data/Migrations/20250716104712_TasksAdded.Designer.cs deleted file mode 100644 index 6e4b71b..0000000 --- a/src/SkillBridge/Data/Migrations/20250716104712_TasksAdded.Designer.cs +++ /dev/null @@ -1,339 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250716104712_TasksAdded")] - partial class TasksAdded - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactInfo") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("contact_info"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250716104712_TasksAdded.cs b/src/SkillBridge/Data/Migrations/20250716104712_TasksAdded.cs deleted file mode 100644 index 40e1f9a..0000000 --- a/src/SkillBridge/Data/Migrations/20250716104712_TasksAdded.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class TasksAdded : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "assignment_tasks", - columns: table => new - { - id = table.Column(type: "uuid", nullable: false), - title = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), - description = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), - is_completed = table.Column(type: "boolean", nullable: false), - sequence = table.Column(type: "integer", nullable: false), - project_assignment_id = table.Column(type: "uuid", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_assignment_tasks", x => x.id); - table.ForeignKey( - name: "FK_assignment_tasks_project_assignments_project_assignment_id", - column: x => x.project_assignment_id, - principalTable: "project_assignments", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_assignment_tasks_is_completed", - table: "assignment_tasks", - column: "is_completed"); - - migrationBuilder.CreateIndex( - name: "IX_assignment_tasks_project_assignment_id", - table: "assignment_tasks", - column: "project_assignment_id"); - - migrationBuilder.CreateIndex( - name: "IX_assignment_tasks_sequence", - table: "assignment_tasks", - column: "sequence"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "assignment_tasks"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250717085122_AssignmentProperties.Designer.cs b/src/SkillBridge/Data/Migrations/20250717085122_AssignmentProperties.Designer.cs deleted file mode 100644 index 86e8d86..0000000 --- a/src/SkillBridge/Data/Migrations/20250717085122_AssignmentProperties.Designer.cs +++ /dev/null @@ -1,363 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250717085122_AssignmentProperties")] - partial class AssignmentProperties - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactInfo") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("contact_info"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250717085122_AssignmentProperties.cs b/src/SkillBridge/Data/Migrations/20250717085122_AssignmentProperties.cs deleted file mode 100644 index 8479397..0000000 --- a/src/SkillBridge/Data/Migrations/20250717085122_AssignmentProperties.cs +++ /dev/null @@ -1,74 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class AssignmentProperties : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "learning_benefits", - table: "project_assignments", - type: "character varying(1000)", - maxLength: 1000, - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "level", - table: "project_assignments", - type: "integer", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "suggested_approach", - table: "project_assignments", - type: "character varying(1000)", - maxLength: 1000, - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "summary", - table: "project_assignments", - type: "character varying(500)", - maxLength: 500, - nullable: false, - defaultValue: ""); - - migrationBuilder.CreateIndex( - name: "IX_project_assignments_level", - table: "project_assignments", - column: "level"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_project_assignments_level", - table: "project_assignments"); - - migrationBuilder.DropColumn( - name: "learning_benefits", - table: "project_assignments"); - - migrationBuilder.DropColumn( - name: "level", - table: "project_assignments"); - - migrationBuilder.DropColumn( - name: "suggested_approach", - table: "project_assignments"); - - migrationBuilder.DropColumn( - name: "summary", - table: "project_assignments"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250727080305_UserProfile.Designer.cs b/src/SkillBridge/Data/Migrations/20250727080305_UserProfile.Designer.cs deleted file mode 100644 index 335b618..0000000 --- a/src/SkillBridge/Data/Migrations/20250727080305_UserProfile.Designer.cs +++ /dev/null @@ -1,382 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250727080305_UserProfile")] - partial class UserProfile - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactInfo") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("contact_info"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250727080305_UserProfile.cs b/src/SkillBridge/Data/Migrations/20250727080305_UserProfile.cs deleted file mode 100644 index 30cc0b0..0000000 --- a/src/SkillBridge/Data/Migrations/20250727080305_UserProfile.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class UserProfile : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "user_profiles", - columns: table => new - { - id = table.Column(type: "text", nullable: false), - created_at = table.Column(type: "timestamp with time zone", nullable: false), - updated_at = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_user_profiles", x => x.id); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "user_profiles"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250727082715_UserProjectAssignment.Designer.cs b/src/SkillBridge/Data/Migrations/20250727082715_UserProjectAssignment.Designer.cs deleted file mode 100644 index 83ba496..0000000 --- a/src/SkillBridge/Data/Migrations/20250727082715_UserProjectAssignment.Designer.cs +++ /dev/null @@ -1,439 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250727082715_UserProjectAssignment")] - partial class UserProjectAssignment - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactInfo") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("contact_info"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.Property("UserProfileId") - .HasColumnType("text") - .HasColumnName("user_profile_id"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("ClaimedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("claimed_at"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("completed_at"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.HasKey("UserProfileId", "ProjectAssignmentId"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("UserProfileId"); - - b.ToTable("user_project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("UserProjectAssignments") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.UserProfile", "UserProfile") - .WithMany("UserProjectAssignments") - .HasForeignKey("UserProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("UserProfile"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - - b.Navigation("UserProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Navigation("UserProjectAssignments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250727082715_UserProjectAssignment.cs b/src/SkillBridge/Data/Migrations/20250727082715_UserProjectAssignment.cs deleted file mode 100644 index d3c8582..0000000 --- a/src/SkillBridge/Data/Migrations/20250727082715_UserProjectAssignment.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class UserProjectAssignment : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "user_project_assignments", - columns: table => new - { - user_profile_id = table.Column(type: "text", nullable: false), - project_assignment_id = table.Column(type: "uuid", nullable: false), - claimed_at = table.Column(type: "timestamp with time zone", nullable: false), - is_completed = table.Column(type: "boolean", nullable: false), - completed_at = table.Column(type: "timestamp with time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_user_project_assignments", x => new { x.user_profile_id, x.project_assignment_id }); - table.ForeignKey( - name: "FK_user_project_assignments_project_assignments_project_assign~", - column: x => x.project_assignment_id, - principalTable: "project_assignments", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_user_project_assignments_user_profiles_user_profile_id", - column: x => x.user_profile_id, - principalTable: "user_profiles", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_user_project_assignments_project_assignment_id", - table: "user_project_assignments", - column: "project_assignment_id"); - - migrationBuilder.CreateIndex( - name: "IX_user_project_assignments_user_profile_id", - table: "user_project_assignments", - column: "user_profile_id"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "user_project_assignments"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250831100534_fixcompany.Designer.cs b/src/SkillBridge/Data/Migrations/20250831100534_fixcompany.Designer.cs deleted file mode 100644 index c918c61..0000000 --- a/src/SkillBridge/Data/Migrations/20250831100534_fixcompany.Designer.cs +++ /dev/null @@ -1,459 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250831100534_fixcompany")] - partial class fixcompany - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactEmail") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("contact_email"); - - b.Property("ContactName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("contact_name"); - - b.Property("ContactPhone") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("contact_phone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .IsRequired() - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.Property("UserProfileId") - .HasColumnType("text") - .HasColumnName("user_profile_id"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("ClaimedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("claimed_at"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("completed_at"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.HasKey("UserProfileId", "ProjectAssignmentId"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("UserProfileId"); - - b.ToTable("user_project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("UserProjectAssignments") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.UserProfile", "UserProfile") - .WithMany("UserProjectAssignments") - .HasForeignKey("UserProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("UserProfile"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - - b.Navigation("UserProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Navigation("UserProjectAssignments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250831100534_fixcompany.cs b/src/SkillBridge/Data/Migrations/20250831100534_fixcompany.cs deleted file mode 100644 index 69ed1db..0000000 --- a/src/SkillBridge/Data/Migrations/20250831100534_fixcompany.cs +++ /dev/null @@ -1,233 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class fixcompany : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "contact_info", - table: "companies"); - - migrationBuilder.AlterColumn( - name: "year_established", - table: "companies", - type: "integer", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "integer", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "website_url", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(500)", - oldMaxLength: 500, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "technologies", - table: "companies", - type: "character varying(1000)", - maxLength: 1000, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(1000)", - oldMaxLength: 1000, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "sector", - table: "companies", - type: "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "head_office_location", - table: "companies", - type: "character varying(200)", - maxLength: 200, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "employees_worldwide", - table: "companies", - type: "integer", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "integer", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "activities", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(500)", - oldMaxLength: 500, - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "about", - table: "companies", - type: "character varying(2000)", - maxLength: 2000, - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "character varying(2000)", - oldMaxLength: 2000, - oldNullable: true); - - migrationBuilder.AddColumn( - name: "contact_email", - table: "companies", - type: "character varying(255)", - maxLength: 255, - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "contact_name", - table: "companies", - type: "character varying(100)", - maxLength: 100, - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "contact_phone", - table: "companies", - type: "character varying(20)", - maxLength: 20, - nullable: false, - defaultValue: ""); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "contact_email", - table: "companies"); - - migrationBuilder.DropColumn( - name: "contact_name", - table: "companies"); - - migrationBuilder.DropColumn( - name: "contact_phone", - table: "companies"); - - migrationBuilder.AlterColumn( - name: "year_established", - table: "companies", - type: "integer", - nullable: true, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "website_url", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(500)", - oldMaxLength: 500); - - migrationBuilder.AlterColumn( - name: "technologies", - table: "companies", - type: "character varying(1000)", - maxLength: 1000, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(1000)", - oldMaxLength: 1000); - - migrationBuilder.AlterColumn( - name: "sector", - table: "companies", - type: "character varying(100)", - maxLength: 100, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(100)", - oldMaxLength: 100); - - migrationBuilder.AlterColumn( - name: "head_office_location", - table: "companies", - type: "character varying(200)", - maxLength: 200, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(200)", - oldMaxLength: 200); - - migrationBuilder.AlterColumn( - name: "employees_worldwide", - table: "companies", - type: "integer", - nullable: true, - oldClrType: typeof(int), - oldType: "integer"); - - migrationBuilder.AlterColumn( - name: "activities", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(500)", - oldMaxLength: 500); - - migrationBuilder.AlterColumn( - name: "about", - table: "companies", - type: "character varying(2000)", - maxLength: 2000, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(2000)", - oldMaxLength: 2000); - - migrationBuilder.AddColumn( - name: "contact_info", - table: "companies", - type: "character varying(1000)", - maxLength: 1000, - nullable: true); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250901110900_UserProfileAddedFileLinks.Designer.cs b/src/SkillBridge/Data/Migrations/20250901110900_UserProfileAddedFileLinks.Designer.cs deleted file mode 100644 index 7b1a5d9..0000000 --- a/src/SkillBridge/Data/Migrations/20250901110900_UserProfileAddedFileLinks.Designer.cs +++ /dev/null @@ -1,471 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250901110900_UserProfileAddedFileLinks")] - partial class UserProfileAddedFileLinks - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactEmail") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("contact_email"); - - b.Property("ContactName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("contact_name"); - - b.Property("ContactPhone") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("contact_phone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .IsRequired() - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CVUpload") - .IsRequired() - .HasColumnType("text"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("GitHubConnection") - .IsRequired() - .HasColumnType("text"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("text"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.Property("UserProfileId") - .HasColumnType("text") - .HasColumnName("user_profile_id"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("ClaimedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("claimed_at"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("completed_at"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.HasKey("UserProfileId", "ProjectAssignmentId"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("UserProfileId"); - - b.ToTable("user_project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("UserProjectAssignments") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.UserProfile", "UserProfile") - .WithMany("UserProjectAssignments") - .HasForeignKey("UserProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("UserProfile"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - - b.Navigation("UserProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Navigation("UserProjectAssignments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250901110900_UserProfileAddedFileLinks.cs b/src/SkillBridge/Data/Migrations/20250901110900_UserProfileAddedFileLinks.cs deleted file mode 100644 index ba342c4..0000000 --- a/src/SkillBridge/Data/Migrations/20250901110900_UserProfileAddedFileLinks.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class UserProfileAddedFileLinks : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CVUpload", - table: "user_profiles", - type: "text", - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "GitHubConnection", - table: "user_profiles", - type: "text", - nullable: false, - defaultValue: ""); - - migrationBuilder.AddColumn( - name: "ProfilePicture", - table: "user_profiles", - type: "text", - nullable: false, - defaultValue: ""); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CVUpload", - table: "user_profiles"); - - migrationBuilder.DropColumn( - name: "GitHubConnection", - table: "user_profiles"); - - migrationBuilder.DropColumn( - name: "ProfilePicture", - table: "user_profiles"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250903105216_UpdatedUserProfileConfiguration.Designer.cs b/src/SkillBridge/Data/Migrations/20250903105216_UpdatedUserProfileConfiguration.Designer.cs deleted file mode 100644 index ffd318e..0000000 --- a/src/SkillBridge/Data/Migrations/20250903105216_UpdatedUserProfileConfiguration.Designer.cs +++ /dev/null @@ -1,474 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250903105216_UpdatedUserProfileConfiguration")] - partial class UpdatedUserProfileConfiguration - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactEmail") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("contact_email"); - - b.Property("ContactName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("contact_name"); - - b.Property("ContactPhone") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("contact_phone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .IsRequired() - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CVUpload") - .IsRequired() - .HasColumnType("text") - .HasColumnName("cv_upload"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("GitHubConnection") - .IsRequired() - .HasColumnType("text") - .HasColumnName("github_connection"); - - b.Property("ProfilePicture") - .IsRequired() - .HasColumnType("text") - .HasColumnName("profile_picture"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.Property("UserProfileId") - .HasColumnType("text") - .HasColumnName("user_profile_id"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("ClaimedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("claimed_at"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("completed_at"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.HasKey("UserProfileId", "ProjectAssignmentId"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("UserProfileId"); - - b.ToTable("user_project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("UserProjectAssignments") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.UserProfile", "UserProfile") - .WithMany("UserProjectAssignments") - .HasForeignKey("UserProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("UserProfile"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - - b.Navigation("UserProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Navigation("UserProjectAssignments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250903105216_UpdatedUserProfileConfiguration.cs b/src/SkillBridge/Data/Migrations/20250903105216_UpdatedUserProfileConfiguration.cs deleted file mode 100644 index 41a9e6a..0000000 --- a/src/SkillBridge/Data/Migrations/20250903105216_UpdatedUserProfileConfiguration.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class UpdatedUserProfileConfiguration : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "ProfilePicture", - table: "user_profiles", - newName: "profile_picture"); - - migrationBuilder.RenameColumn( - name: "GitHubConnection", - table: "user_profiles", - newName: "github_connection"); - - migrationBuilder.RenameColumn( - name: "CVUpload", - table: "user_profiles", - newName: "cv_upload"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "profile_picture", - table: "user_profiles", - newName: "ProfilePicture"); - - migrationBuilder.RenameColumn( - name: "github_connection", - table: "user_profiles", - newName: "GitHubConnection"); - - migrationBuilder.RenameColumn( - name: "cv_upload", - table: "user_profiles", - newName: "CVUpload"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250904161908_UpdateUserProfileEntity.Designer.cs b/src/SkillBridge/Data/Migrations/20250904161908_UpdateUserProfileEntity.Designer.cs deleted file mode 100644 index b29ae71..0000000 --- a/src/SkillBridge/Data/Migrations/20250904161908_UpdateUserProfileEntity.Designer.cs +++ /dev/null @@ -1,471 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250904161908_UpdateUserProfileEntity")] - partial class UpdateUserProfileEntity - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactEmail") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("contact_email"); - - b.Property("ContactName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("contact_name"); - - b.Property("ContactPhone") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("contact_phone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .IsRequired() - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CVUpload") - .HasColumnType("text") - .HasColumnName("cv_upload"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("GitHubConnection") - .HasColumnType("text") - .HasColumnName("github_connection"); - - b.Property("ProfilePicture") - .HasColumnType("text") - .HasColumnName("profile_picture"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.Property("UserProfileId") - .HasColumnType("text") - .HasColumnName("user_profile_id"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("ClaimedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("claimed_at"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("completed_at"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.HasKey("UserProfileId", "ProjectAssignmentId"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("UserProfileId"); - - b.ToTable("user_project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("UserProjectAssignments") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.UserProfile", "UserProfile") - .WithMany("UserProjectAssignments") - .HasForeignKey("UserProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("UserProfile"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - - b.Navigation("UserProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Navigation("UserProjectAssignments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250904161908_UpdateUserProfileEntity.cs b/src/SkillBridge/Data/Migrations/20250904161908_UpdateUserProfileEntity.cs deleted file mode 100644 index 3cb9e6f..0000000 --- a/src/SkillBridge/Data/Migrations/20250904161908_UpdateUserProfileEntity.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class UpdateUserProfileEntity : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "profile_picture", - table: "user_profiles", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "github_connection", - table: "user_profiles", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "cv_upload", - table: "user_profiles", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "text"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "profile_picture", - table: "user_profiles", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "github_connection", - table: "user_profiles", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "cv_upload", - table: "user_profiles", - type: "text", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250905084435_DescrChange.Designer.cs b/src/SkillBridge/Data/Migrations/20250905084435_DescrChange.Designer.cs deleted file mode 100644 index 634e9c0..0000000 --- a/src/SkillBridge/Data/Migrations/20250905084435_DescrChange.Designer.cs +++ /dev/null @@ -1,471 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250905084435_DescrChange")] - partial class DescrChange - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactEmail") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("contact_email"); - - b.Property("ContactName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("contact_name"); - - b.Property("ContactPhone") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("contact_phone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .IsRequired() - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(20000) - .HasColumnType("character varying(20000)") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CVUpload") - .HasColumnType("text") - .HasColumnName("cv_upload"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("GitHubConnection") - .HasColumnType("text") - .HasColumnName("github_connection"); - - b.Property("ProfilePicture") - .HasColumnType("text") - .HasColumnName("profile_picture"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.Property("UserProfileId") - .HasColumnType("text") - .HasColumnName("user_profile_id"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("ClaimedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("claimed_at"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("completed_at"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.HasKey("UserProfileId", "ProjectAssignmentId"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("UserProfileId"); - - b.ToTable("user_project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("UserProjectAssignments") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.UserProfile", "UserProfile") - .WithMany("UserProjectAssignments") - .HasForeignKey("UserProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("UserProfile"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - - b.Navigation("UserProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Navigation("UserProjectAssignments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250905084435_DescrChange.cs b/src/SkillBridge/Data/Migrations/20250905084435_DescrChange.cs deleted file mode 100644 index 8b43cd8..0000000 --- a/src/SkillBridge/Data/Migrations/20250905084435_DescrChange.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class DescrChange : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "description", - table: "project_assignments", - type: "character varying(20000)", - maxLength: 20000, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(2000)", - oldMaxLength: 2000, - oldNullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "description", - table: "project_assignments", - type: "character varying(2000)", - maxLength: 2000, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(20000)", - oldMaxLength: 20000, - oldNullable: true); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250905085120_DescriptionChange.Designer.cs b/src/SkillBridge/Data/Migrations/20250905085120_DescriptionChange.Designer.cs deleted file mode 100644 index 055608f..0000000 --- a/src/SkillBridge/Data/Migrations/20250905085120_DescriptionChange.Designer.cs +++ /dev/null @@ -1,471 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using SkillBridge.Data; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - [DbContext(typeof(AppDbContext))] - [Migration("20250905085120_DescriptionChange")] - partial class DescriptionChange - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.16") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Description") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("description"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("Sequence") - .HasColumnType("integer") - .HasColumnName("sequence"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("IsCompleted"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("Sequence"); - - b.ToTable("assignment_tasks", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("About") - .IsRequired() - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("about"); - - b.Property("Activities") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("activities"); - - b.Property("Auth0UserId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)") - .HasColumnName("auth0_user_id"); - - b.Property("BannerUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("banner_url"); - - b.Property("BulgarianOfficeLocations") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("bulgarian_office_locations"); - - b.Property("ContactEmail") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("character varying(255)") - .HasColumnName("contact_email"); - - b.Property("ContactName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("contact_name"); - - b.Property("ContactPhone") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("contact_phone"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("EmployeesInBulgaria") - .HasColumnType("integer") - .HasColumnName("employees_in_bulgaria"); - - b.Property("EmployeesWorldwide") - .HasColumnType("integer") - .HasColumnName("employees_worldwide"); - - b.Property("HasOfficesInBulgaria") - .HasColumnType("boolean") - .HasColumnName("has_offices_in_bulgaria"); - - b.Property("HeadOfficeLocation") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("head_office_location"); - - b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("logo_url"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.Property("Sector") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("sector"); - - b.Property("Technologies") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("technologies"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.Property("WebsiteUrl") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("website_url"); - - b.Property("WhyWorkWithUs") - .HasMaxLength(2000) - .HasColumnType("character varying(2000)") - .HasColumnName("why_work_with_us"); - - b.Property("YearEstablished") - .IsRequired() - .HasColumnType("integer") - .HasColumnName("year_established"); - - b.HasKey("Id"); - - b.HasIndex("Auth0UserId") - .IsUnique(); - - b.HasIndex("Name"); - - b.HasIndex("Sector"); - - b.ToTable("companies", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("CompanyId") - .HasColumnType("uuid") - .HasColumnName("company_id"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - - b.Property("Description") - .HasMaxLength(20000) - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("LearningBenefits") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("learning_benefits"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Status") - .HasColumnType("integer") - .HasColumnName("status"); - - b.Property("SuggestedApproach") - .IsRequired() - .HasMaxLength(1000) - .HasColumnType("character varying(1000)") - .HasColumnName("suggested_approach"); - - b.Property("Summary") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("summary"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("character varying(200)") - .HasColumnName("title"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.HasIndex("CompanyId"); - - b.HasIndex("Deadline"); - - b.HasIndex("Level"); - - b.HasIndex("Status"); - - b.ToTable("project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("SkillId") - .HasColumnType("uuid") - .HasColumnName("skill_id"); - - b.HasKey("ProjectAssignmentId", "SkillId"); - - b.HasIndex("SkillId"); - - b.ToTable("project_skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uuid") - .HasColumnName("id"); - - b.Property("Description") - .HasMaxLength(500) - .HasColumnType("character varying(500)") - .HasColumnName("description"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("name"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.ToTable("skills", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Property("Id") - .HasColumnType("text") - .HasColumnName("id"); - - b.Property("CVUpload") - .HasColumnType("text") - .HasColumnName("cv_upload"); - - b.Property("CreatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("created_at"); - - b.Property("GitHubConnection") - .HasColumnType("text") - .HasColumnName("github_connection"); - - b.Property("ProfilePicture") - .HasColumnType("text") - .HasColumnName("profile_picture"); - - b.Property("UpdatedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("updated_at"); - - b.HasKey("Id"); - - b.ToTable("user_profiles", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.Property("UserProfileId") - .HasColumnType("text") - .HasColumnName("user_profile_id"); - - b.Property("ProjectAssignmentId") - .HasColumnType("uuid") - .HasColumnName("project_assignment_id"); - - b.Property("ClaimedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("claimed_at"); - - b.Property("CompletedAt") - .HasColumnType("timestamp with time zone") - .HasColumnName("completed_at"); - - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - - b.HasKey("UserProfileId", "ProjectAssignmentId"); - - b.HasIndex("ProjectAssignmentId"); - - b.HasIndex("UserProfileId"); - - b.ToTable("user_project_assignments", (string)null); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("Tasks") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.Company", "Company") - .WithMany("ProjectAssignments") - .HasForeignKey("CompanyId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Company"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectSkill", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("ProjectSkills") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.Skill", "Skill") - .WithMany("ProjectSkills") - .HasForeignKey("SkillId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("Skill"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => - { - b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") - .WithMany("UserProjectAssignments") - .HasForeignKey("ProjectAssignmentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("SkillBridge.Models.Entities.UserProfile", "UserProfile") - .WithMany("UserProjectAssignments") - .HasForeignKey("UserProfileId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("ProjectAssignment"); - - b.Navigation("UserProfile"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => - { - b.Navigation("ProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.ProjectAssignment", b => - { - b.Navigation("ProjectSkills"); - - b.Navigation("Tasks"); - - b.Navigation("UserProjectAssignments"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.Skill", b => - { - b.Navigation("ProjectSkills"); - }); - - modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => - { - b.Navigation("UserProjectAssignments"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250905085120_DescriptionChange.cs b/src/SkillBridge/Data/Migrations/20250905085120_DescriptionChange.cs deleted file mode 100644 index fc8ea82..0000000 --- a/src/SkillBridge/Data/Migrations/20250905085120_DescriptionChange.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class DescriptionChange : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "description", - table: "project_assignments", - type: "text", - maxLength: 20000, - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(20000)", - oldMaxLength: 20000, - oldNullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "description", - table: "project_assignments", - type: "character varying(20000)", - maxLength: 20000, - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldMaxLength: 20000, - oldNullable: true); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250905090219_DescriptionChange2.cs b/src/SkillBridge/Data/Migrations/20250905090219_DescriptionChange2.cs deleted file mode 100644 index 7e02e86..0000000 --- a/src/SkillBridge/Data/Migrations/20250905090219_DescriptionChange2.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class DescriptionChange2 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "summary", - table: "project_assignments", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(500)", - oldMaxLength: 500); - - migrationBuilder.AlterColumn( - name: "suggested_approach", - table: "project_assignments", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(1000)", - oldMaxLength: 1000); - - migrationBuilder.AlterColumn( - name: "learning_benefits", - table: "project_assignments", - type: "text", - nullable: false, - oldClrType: typeof(string), - oldType: "character varying(1000)", - oldMaxLength: 1000); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "summary", - table: "project_assignments", - type: "character varying(500)", - maxLength: 500, - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "suggested_approach", - table: "project_assignments", - type: "character varying(1000)", - maxLength: 1000, - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - - migrationBuilder.AlterColumn( - name: "learning_benefits", - table: "project_assignments", - type: "character varying(1000)", - maxLength: 1000, - nullable: false, - oldClrType: typeof(string), - oldType: "text"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20251003152817_AddDeadlineAndChangeToDuration.cs b/src/SkillBridge/Data/Migrations/20251003152817_AddDeadlineAndChangeToDuration.cs deleted file mode 100644 index 1d0bb8b..0000000 --- a/src/SkillBridge/Data/Migrations/20251003152817_AddDeadlineAndChangeToDuration.cs +++ /dev/null @@ -1,90 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace SkillBridge.Data.Migrations -{ - /// - public partial class AddDeadlineAndChangeToDuration : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_project_assignments_deadline", - table: "project_assignments"); - - migrationBuilder.DropColumn( - name: "deadline", - table: "project_assignments"); - - migrationBuilder.AddColumn( - name: "Deadline", - table: "user_project_assignments", - type: "timestamp with time zone", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "duration", - table: "project_assignments", - type: "interval", - nullable: false, - defaultValue: new TimeSpan(0, 0, 0, 0, 0)); - - migrationBuilder.AlterColumn( - name: "logo_url", - table: "companies", - type: "text", - nullable: true, - oldClrType: typeof(string), - oldType: "character varying(500)", - oldMaxLength: 500, - oldNullable: true); - - migrationBuilder.CreateIndex( - name: "IX_project_assignments_duration", - table: "project_assignments", - column: "duration"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_project_assignments_duration", - table: "project_assignments"); - - migrationBuilder.DropColumn( - name: "Deadline", - table: "user_project_assignments"); - - migrationBuilder.DropColumn( - name: "duration", - table: "project_assignments"); - - migrationBuilder.AddColumn( - name: "deadline", - table: "project_assignments", - type: "timestamp with time zone", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AlterColumn( - name: "logo_url", - table: "companies", - type: "character varying(500)", - maxLength: 500, - nullable: true, - oldClrType: typeof(string), - oldType: "text", - oldNullable: true); - - migrationBuilder.CreateIndex( - name: "IX_project_assignments_deadline", - table: "project_assignments", - column: "deadline"); - } - } -} diff --git a/src/SkillBridge/Data/Migrations/20250905090219_DescriptionChange2.Designer.cs b/src/SkillBridge/Migrations/20251016125626_InitialRebuild.Designer.cs similarity index 85% rename from src/SkillBridge/Data/Migrations/20250905090219_DescriptionChange2.Designer.cs rename to src/SkillBridge/Migrations/20251016125626_InitialRebuild.Designer.cs index 96a36cb..b17721b 100644 --- a/src/SkillBridge/Data/Migrations/20250905090219_DescriptionChange2.Designer.cs +++ b/src/SkillBridge/Migrations/20251016125626_InitialRebuild.Designer.cs @@ -9,11 +9,11 @@ #nullable disable -namespace SkillBridge.Data.Migrations +namespace SkillBridge.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20250905090219_DescriptionChange2")] - partial class DescriptionChange2 + [Migration("20251016125626_InitialRebuild")] + partial class InitialRebuild { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -41,10 +41,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("character varying(2000)") .HasColumnName("description"); - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - b.Property("ProjectAssignmentId") .HasColumnType("uuid") .HasColumnName("project_assignment_id"); @@ -65,8 +61,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("IsCompleted"); - b.HasIndex("ProjectAssignmentId"); b.HasIndex("Sequence"); @@ -150,8 +144,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnName("head_office_location"); b.Property("LogoUrl") - .HasMaxLength(500) - .HasColumnType("character varying(500)") + .HasColumnType("text") .HasColumnName("logo_url"); b.Property("Name") @@ -219,14 +212,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("timestamp with time zone") .HasColumnName("created_at"); - b.Property("Deadline") - .HasColumnType("timestamp with time zone") - .HasColumnName("deadline"); - b.Property("Description") .HasColumnType("text") .HasColumnName("description"); + b.Property("Duration") + .HasColumnType("interval") + .HasColumnName("duration"); + b.Property("LearningBenefits") .IsRequired() .HasColumnType("text") @@ -264,8 +257,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("CompanyId"); - b.HasIndex("Deadline"); - b.HasIndex("Level"); b.HasIndex("Status"); @@ -316,6 +307,37 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("skills", (string)null); }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserAssignmentTask", b => + { + b.Property("UserProfileId") + .HasColumnType("text") + .HasColumnName("user_profile_id"); + + b.Property("ProjectAssignmentId") + .HasColumnType("uuid") + .HasColumnName("project_assignment_id"); + + b.Property("AssignmentTaskId") + .HasColumnType("uuid") + .HasColumnName("assignment_task_id"); + + b.Property("IsCompleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_completed"); + + b.HasKey("UserProfileId", "ProjectAssignmentId", "AssignmentTaskId"); + + b.HasIndex("AssignmentTaskId") + .HasDatabaseName("ix_user_assignment_tasks_assignment_task_id"); + + b.HasIndex("UserProfileId", "ProjectAssignmentId") + .HasDatabaseName("ix_user_assignment_tasks_user_project"); + + b.ToTable("user_assignment_tasks", (string)null); + }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserProfile", b => { b.Property("Id") @@ -365,10 +387,22 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("timestamp with time zone") .HasColumnName("completed_at"); + b.Property("CompletedTasks") + .HasColumnType("integer") + .HasColumnName("completed_tasks"); + + b.Property("Deadline") + .HasColumnType("timestamp with time zone") + .HasColumnName("deadline"); + b.Property("IsCompleted") .HasColumnType("boolean") .HasColumnName("is_completed"); + b.Property("TotalTasks") + .HasColumnType("integer") + .HasColumnName("total_tasks"); + b.HasKey("UserProfileId", "ProjectAssignmentId"); b.HasIndex("ProjectAssignmentId"); @@ -419,6 +453,25 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Skill"); }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserAssignmentTask", b => + { + b.HasOne("SkillBridge.Models.Entities.AssignmentTask", "AssignmentTask") + .WithMany("UserAssignmentTasks") + .HasForeignKey("AssignmentTaskId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SkillBridge.Models.Entities.UserProjectAssignment", "UserProjectAssignment") + .WithMany("UserAssignmentTasks") + .HasForeignKey("UserProfileId", "ProjectAssignmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AssignmentTask"); + + b.Navigation("UserProjectAssignment"); + }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => { b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") @@ -438,6 +491,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("UserProfile"); }); + modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => + { + b.Navigation("UserAssignmentTasks"); + }); + modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => { b.Navigation("ProjectAssignments"); @@ -461,6 +519,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Navigation("UserProjectAssignments"); }); + + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => + { + b.Navigation("UserAssignmentTasks"); + }); #pragma warning restore 612, 618 } } diff --git a/src/SkillBridge/Migrations/20251016125626_InitialRebuild.cs b/src/SkillBridge/Migrations/20251016125626_InitialRebuild.cs new file mode 100644 index 0000000..6c10ee3 --- /dev/null +++ b/src/SkillBridge/Migrations/20251016125626_InitialRebuild.cs @@ -0,0 +1,307 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SkillBridge.Migrations +{ + /// + public partial class InitialRebuild : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "companies", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + about = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: false), + logo_url = table.Column(type: "text", nullable: true), + banner_url = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), + activities = table.Column(type: "character varying(500)", maxLength: 500, nullable: false), + sector = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + head_office_location = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + technologies = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: false), + year_established = table.Column(type: "integer", nullable: false), + has_offices_in_bulgaria = table.Column(type: "boolean", nullable: false), + bulgarian_office_locations = table.Column(type: "character varying(500)", maxLength: 500, nullable: true), + employees_in_bulgaria = table.Column(type: "integer", nullable: true), + employees_worldwide = table.Column(type: "integer", nullable: false), + why_work_with_us = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + website_url = table.Column(type: "character varying(500)", maxLength: 500, nullable: false), + contact_name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + contact_email = table.Column(type: "character varying(255)", maxLength: 255, nullable: false), + contact_phone = table.Column(type: "character varying(20)", maxLength: 20, nullable: false), + auth0_user_id = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_companies", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "skills", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + name = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_skills", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "user_profiles", + columns: table => new + { + id = table.Column(type: "text", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: true), + profile_picture = table.Column(type: "text", nullable: true), + cv_upload = table.Column(type: "text", nullable: true), + github_connection = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_user_profiles", x => x.id); + }); + + migrationBuilder.CreateTable( + name: "project_assignments", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + title = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + description = table.Column(type: "text", nullable: true), + summary = table.Column(type: "text", nullable: false), + learning_benefits = table.Column(type: "text", nullable: false), + suggested_approach = table.Column(type: "text", nullable: false), + level = table.Column(type: "integer", nullable: false), + duration = table.Column(type: "interval", nullable: false), + status = table.Column(type: "integer", nullable: false), + company_id = table.Column(type: "uuid", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_project_assignments", x => x.id); + table.ForeignKey( + name: "FK_project_assignments_companies_company_id", + column: x => x.company_id, + principalTable: "companies", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "assignment_tasks", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + title = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + description = table.Column(type: "character varying(2000)", maxLength: 2000, nullable: true), + sequence = table.Column(type: "integer", nullable: false), + project_assignment_id = table.Column(type: "uuid", nullable: false), + created_at = table.Column(type: "timestamp with time zone", nullable: false), + updated_at = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_assignment_tasks", x => x.id); + table.ForeignKey( + name: "FK_assignment_tasks_project_assignments_project_assignment_id", + column: x => x.project_assignment_id, + principalTable: "project_assignments", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "project_skills", + columns: table => new + { + project_assignment_id = table.Column(type: "uuid", nullable: false), + skill_id = table.Column(type: "uuid", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_project_skills", x => new { x.project_assignment_id, x.skill_id }); + table.ForeignKey( + name: "FK_project_skills_project_assignments_project_assignment_id", + column: x => x.project_assignment_id, + principalTable: "project_assignments", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_project_skills_skills_skill_id", + column: x => x.skill_id, + principalTable: "skills", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "user_project_assignments", + columns: table => new + { + user_profile_id = table.Column(type: "text", nullable: false), + project_assignment_id = table.Column(type: "uuid", nullable: false), + claimed_at = table.Column(type: "timestamp with time zone", nullable: false), + is_completed = table.Column(type: "boolean", nullable: false), + completed_at = table.Column(type: "timestamp with time zone", nullable: true), + deadline = table.Column(type: "timestamp with time zone", nullable: false), + total_tasks = table.Column(type: "integer", nullable: false), + completed_tasks = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_user_project_assignments", x => new { x.user_profile_id, x.project_assignment_id }); + table.ForeignKey( + name: "FK_user_project_assignments_project_assignments_project_assign~", + column: x => x.project_assignment_id, + principalTable: "project_assignments", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_user_project_assignments_user_profiles_user_profile_id", + column: x => x.user_profile_id, + principalTable: "user_profiles", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "user_assignment_tasks", + columns: table => new + { + assignment_task_id = table.Column(type: "uuid", nullable: false), + project_assignment_id = table.Column(type: "uuid", nullable: false), + user_profile_id = table.Column(type: "text", nullable: false), + is_completed = table.Column(type: "boolean", nullable: false, defaultValue: false) + }, + constraints: table => + { + table.PrimaryKey("PK_user_assignment_tasks", x => new { x.user_profile_id, x.project_assignment_id, x.assignment_task_id }); + table.ForeignKey( + name: "FK_user_assignment_tasks_assignment_tasks_assignment_task_id", + column: x => x.assignment_task_id, + principalTable: "assignment_tasks", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_user_assignment_tasks_user_project_assignments_user_profile~", + columns: x => new { x.user_profile_id, x.project_assignment_id }, + principalTable: "user_project_assignments", + principalColumns: new[] { "user_profile_id", "project_assignment_id" }, + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_assignment_tasks_project_assignment_id", + table: "assignment_tasks", + column: "project_assignment_id"); + + migrationBuilder.CreateIndex( + name: "IX_assignment_tasks_sequence", + table: "assignment_tasks", + column: "sequence"); + + migrationBuilder.CreateIndex( + name: "IX_companies_auth0_user_id", + table: "companies", + column: "auth0_user_id", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_companies_name", + table: "companies", + column: "name"); + + migrationBuilder.CreateIndex( + name: "IX_companies_sector", + table: "companies", + column: "sector"); + + migrationBuilder.CreateIndex( + name: "IX_project_assignments_company_id", + table: "project_assignments", + column: "company_id"); + + migrationBuilder.CreateIndex( + name: "IX_project_assignments_level", + table: "project_assignments", + column: "level"); + + migrationBuilder.CreateIndex( + name: "IX_project_assignments_status", + table: "project_assignments", + column: "status"); + + migrationBuilder.CreateIndex( + name: "IX_project_skills_skill_id", + table: "project_skills", + column: "skill_id"); + + migrationBuilder.CreateIndex( + name: "IX_skills_name", + table: "skills", + column: "name", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_user_assignment_tasks_assignment_task_id", + table: "user_assignment_tasks", + column: "assignment_task_id"); + + migrationBuilder.CreateIndex( + name: "ix_user_assignment_tasks_user_project", + table: "user_assignment_tasks", + columns: new[] { "user_profile_id", "project_assignment_id" }); + + migrationBuilder.CreateIndex( + name: "IX_user_project_assignments_project_assignment_id", + table: "user_project_assignments", + column: "project_assignment_id"); + + migrationBuilder.CreateIndex( + name: "IX_user_project_assignments_user_profile_id", + table: "user_project_assignments", + column: "user_profile_id"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "project_skills"); + + migrationBuilder.DropTable( + name: "user_assignment_tasks"); + + migrationBuilder.DropTable( + name: "skills"); + + migrationBuilder.DropTable( + name: "assignment_tasks"); + + migrationBuilder.DropTable( + name: "user_project_assignments"); + + migrationBuilder.DropTable( + name: "project_assignments"); + + migrationBuilder.DropTable( + name: "user_profiles"); + + migrationBuilder.DropTable( + name: "companies"); + } + } +} diff --git a/src/SkillBridge/Data/Migrations/20251003152817_AddDeadlineAndChangeToDuration.Designer.cs b/src/SkillBridge/Migrations/20251018130551_TakeOffTotalTaskAndCompletedTask.Designer.cs similarity index 87% rename from src/SkillBridge/Data/Migrations/20251003152817_AddDeadlineAndChangeToDuration.Designer.cs rename to src/SkillBridge/Migrations/20251018130551_TakeOffTotalTaskAndCompletedTask.Designer.cs index 985b17d..818d81d 100644 --- a/src/SkillBridge/Data/Migrations/20251003152817_AddDeadlineAndChangeToDuration.Designer.cs +++ b/src/SkillBridge/Migrations/20251018130551_TakeOffTotalTaskAndCompletedTask.Designer.cs @@ -9,11 +9,11 @@ #nullable disable -namespace SkillBridge.Data.Migrations +namespace SkillBridge.Migrations { [DbContext(typeof(AppDbContext))] - [Migration("20251003152817_AddDeadlineAndChangeToDuration")] - partial class AddDeadlineAndChangeToDuration + [Migration("20251018130551_TakeOffTotalTaskAndCompletedTask")] + partial class TakeOffTotalTaskAndCompletedTask { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -41,10 +41,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("character varying(2000)") .HasColumnName("description"); - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - b.Property("ProjectAssignmentId") .HasColumnType("uuid") .HasColumnName("project_assignment_id"); @@ -65,8 +61,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("IsCompleted"); - b.HasIndex("ProjectAssignmentId"); b.HasIndex("Sequence"); @@ -263,8 +257,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("CompanyId"); - b.HasIndex("Duration"); - b.HasIndex("Level"); b.HasIndex("Status"); @@ -365,7 +357,8 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnName("completed_at"); b.Property("Deadline") - .HasColumnType("timestamp with time zone"); + .HasColumnType("timestamp with time zone") + .HasColumnName("deadline"); b.Property("IsCompleted") .HasColumnType("boolean") @@ -380,6 +373,37 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.ToTable("user_project_assignments", (string)null); }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignmentTask", b => + { + b.Property("UserProfileId") + .HasColumnType("text") + .HasColumnName("user_profile_id"); + + b.Property("ProjectAssignmentId") + .HasColumnType("uuid") + .HasColumnName("project_assignment_id"); + + b.Property("AssignmentTaskId") + .HasColumnType("uuid") + .HasColumnName("assignment_task_id"); + + b.Property("IsCompleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_completed"); + + b.HasKey("UserProfileId", "ProjectAssignmentId", "AssignmentTaskId"); + + b.HasIndex("AssignmentTaskId") + .HasDatabaseName("ix_user_assignment_tasks_assignment_task_id"); + + b.HasIndex("UserProfileId", "ProjectAssignmentId") + .HasDatabaseName("ix_user_assignment_tasks_user_project"); + + b.ToTable("user_assignment_tasks", (string)null); + }); + modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => { b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") @@ -440,6 +464,30 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("UserProfile"); }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignmentTask", b => + { + b.HasOne("SkillBridge.Models.Entities.AssignmentTask", "AssignmentTask") + .WithMany("UserAssignmentTasks") + .HasForeignKey("AssignmentTaskId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SkillBridge.Models.Entities.UserProjectAssignment", "UserProjectAssignment") + .WithMany("UserAssignmentTasks") + .HasForeignKey("UserProfileId", "ProjectAssignmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AssignmentTask"); + + b.Navigation("UserProjectAssignment"); + }); + + modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => + { + b.Navigation("UserAssignmentTasks"); + }); + modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => { b.Navigation("ProjectAssignments"); @@ -463,6 +511,11 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Navigation("UserProjectAssignments"); }); + + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => + { + b.Navigation("UserAssignmentTasks"); + }); #pragma warning restore 612, 618 } } diff --git a/src/SkillBridge/Migrations/20251018130551_TakeOffTotalTaskAndCompletedTask.cs b/src/SkillBridge/Migrations/20251018130551_TakeOffTotalTaskAndCompletedTask.cs new file mode 100644 index 0000000..70fa148 --- /dev/null +++ b/src/SkillBridge/Migrations/20251018130551_TakeOffTotalTaskAndCompletedTask.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SkillBridge.Migrations +{ + /// + public partial class TakeOffTotalTaskAndCompletedTask : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "completed_tasks", + table: "user_project_assignments"); + + migrationBuilder.DropColumn( + name: "total_tasks", + table: "user_project_assignments"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "completed_tasks", + table: "user_project_assignments", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "total_tasks", + table: "user_project_assignments", + type: "integer", + nullable: false, + defaultValue: 0); + } + } +} diff --git a/src/SkillBridge/Data/Migrations/AppDbContextModelSnapshot.cs b/src/SkillBridge/Migrations/AppDbContextModelSnapshot.cs similarity index 87% rename from src/SkillBridge/Data/Migrations/AppDbContextModelSnapshot.cs rename to src/SkillBridge/Migrations/AppDbContextModelSnapshot.cs index 938a64a..3e699fa 100644 --- a/src/SkillBridge/Data/Migrations/AppDbContextModelSnapshot.cs +++ b/src/SkillBridge/Migrations/AppDbContextModelSnapshot.cs @@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - +using SkillBridge.Data; #nullable disable -namespace SkillBridge.Data.Migrations +namespace SkillBridge.Migrations { [DbContext(typeof(AppDbContext))] partial class AppDbContextModelSnapshot : ModelSnapshot @@ -38,10 +38,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("character varying(2000)") .HasColumnName("description"); - b.Property("IsCompleted") - .HasColumnType("boolean") - .HasColumnName("is_completed"); - b.Property("ProjectAssignmentId") .HasColumnType("uuid") .HasColumnName("project_assignment_id"); @@ -62,8 +58,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.HasIndex("IsCompleted"); - b.HasIndex("ProjectAssignmentId"); b.HasIndex("Sequence"); @@ -221,7 +215,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Duration") .HasColumnType("interval") - .HasColumnName("Duration"); + .HasColumnName("duration"); b.Property("LearningBenefits") .IsRequired() @@ -260,8 +254,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("CompanyId"); - b.HasIndex("Duration"); - b.HasIndex("Level"); b.HasIndex("Status"); @@ -378,6 +370,37 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("user_project_assignments", (string)null); }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignmentTask", b => + { + b.Property("UserProfileId") + .HasColumnType("text") + .HasColumnName("user_profile_id"); + + b.Property("ProjectAssignmentId") + .HasColumnType("uuid") + .HasColumnName("project_assignment_id"); + + b.Property("AssignmentTaskId") + .HasColumnType("uuid") + .HasColumnName("assignment_task_id"); + + b.Property("IsCompleted") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("is_completed"); + + b.HasKey("UserProfileId", "ProjectAssignmentId", "AssignmentTaskId"); + + b.HasIndex("AssignmentTaskId") + .HasDatabaseName("ix_user_assignment_tasks_assignment_task_id"); + + b.HasIndex("UserProfileId", "ProjectAssignmentId") + .HasDatabaseName("ix_user_assignment_tasks_user_project"); + + b.ToTable("user_assignment_tasks", (string)null); + }); + modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => { b.HasOne("SkillBridge.Models.Entities.ProjectAssignment", "ProjectAssignment") @@ -438,6 +461,30 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("UserProfile"); }); + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignmentTask", b => + { + b.HasOne("SkillBridge.Models.Entities.AssignmentTask", "AssignmentTask") + .WithMany("UserAssignmentTasks") + .HasForeignKey("AssignmentTaskId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("SkillBridge.Models.Entities.UserProjectAssignment", "UserProjectAssignment") + .WithMany("UserAssignmentTasks") + .HasForeignKey("UserProfileId", "ProjectAssignmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AssignmentTask"); + + b.Navigation("UserProjectAssignment"); + }); + + modelBuilder.Entity("SkillBridge.Models.Entities.AssignmentTask", b => + { + b.Navigation("UserAssignmentTasks"); + }); + modelBuilder.Entity("SkillBridge.Models.Entities.Company", b => { b.Navigation("ProjectAssignments"); @@ -461,6 +508,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Navigation("UserProjectAssignments"); }); + + modelBuilder.Entity("SkillBridge.Models.Entities.UserProjectAssignment", b => + { + b.Navigation("UserAssignmentTasks"); + }); #pragma warning restore 612, 618 } } diff --git a/src/SkillBridge/Models/Entities/AssignmentTask.cs b/src/SkillBridge/Models/Entities/AssignmentTask.cs index c08034a..1673724 100644 --- a/src/SkillBridge/Models/Entities/AssignmentTask.cs +++ b/src/SkillBridge/Models/Entities/AssignmentTask.cs @@ -24,10 +24,7 @@ public class AssignmentTask /// public string? Description { get; set; } - /// - /// Gets or sets whether the task is completed - /// - public bool IsCompleted { get; set; } = false; + /// /// Gets or sets the sequence number of the task (for ordering) @@ -57,5 +54,10 @@ public class AssignmentTask /// [JsonSchemaIgnore] public DateTime? UpdatedAt { get; set; } + + /// + /// Gets or sets the collection of tasks belonging to this project assignment + /// + public ICollection UserProjectAssignmentTasks { get; set; } = new List(); } } \ No newline at end of file diff --git a/src/SkillBridge/Models/Entities/UserProjectAssignment.cs b/src/SkillBridge/Models/Entities/UserProjectAssignment.cs index 4f8ac31..a42e674 100644 --- a/src/SkillBridge/Models/Entities/UserProjectAssignment.cs +++ b/src/SkillBridge/Models/Entities/UserProjectAssignment.cs @@ -48,4 +48,9 @@ public class UserProjectAssignment public DateTime? CompletedAt { get; set; } public DateTime Deadline { get; set; } + + /// + /// Gets or sets the collection of tasks belonging to this user project assignment + /// + public ICollection UserProjectAssignmentTasks { get; set; } = new List(); } \ No newline at end of file diff --git a/src/SkillBridge/Models/Entities/UserProjectAssignmentTask.cs b/src/SkillBridge/Models/Entities/UserProjectAssignmentTask.cs new file mode 100644 index 0000000..c5b6f9b --- /dev/null +++ b/src/SkillBridge/Models/Entities/UserProjectAssignmentTask.cs @@ -0,0 +1,18 @@ +using NJsonSchema.Annotations; + +namespace SkillBridge.Models.Entities +{ + public class UserProjectAssignmentTask + { + [JsonSchemaIgnore] public Guid AssignmentTaskId { get; set; } + [JsonSchemaIgnore] public AssignmentTask? AssignmentTask { get; set; } + + [JsonSchemaIgnore] public Guid ProjectAssignmentId { get; set; } + [JsonSchemaIgnore] public string UserProfileId { get; set; } = default!; + + // principal: the row in user_project_assignments + [JsonSchemaIgnore] public UserProjectAssignment? UserProjectAssignment { get; set; } + + public bool IsCompleted { get; set; } = false; + } +} diff --git a/src/SkillBridge/Models/Response/AssignmentTaskResponse.cs b/src/SkillBridge/Models/Response/AssignmentTaskResponse.cs index 2dc82f0..a400e31 100644 --- a/src/SkillBridge/Models/Response/AssignmentTaskResponse.cs +++ b/src/SkillBridge/Models/Response/AssignmentTaskResponse.cs @@ -1,3 +1,5 @@ +using SkillBridge.Models.Entities; + namespace SkillBridge.Models.Response; /// @@ -9,37 +11,36 @@ public class AssignmentTaskResponse /// Gets or sets the unique identifier for the task /// public Guid Id { get; set; } - + /// /// Gets or sets the title of the task /// public string Title { get; set; } = default!; - + /// /// Gets or sets the description of the task /// public string? Description { get; set; } - + /// /// Gets or sets whether the task is completed /// public bool IsCompleted { get; set; } - /// /// Gets or sets the sequence number of the task (for ordering) /// public int Sequence { get; set; } - + /// /// Gets or sets the ID of the project assignment this task belongs to /// public Guid ProjectAssignmentId { get; set; } - + /// /// Gets or sets the date when this task was created /// public DateTime CreatedAt { get; set; } - + /// /// Gets or sets the date when this task was last updated /// diff --git a/src/SkillBridge/Models/Response/UserProjectAssignmentResponse.cs b/src/SkillBridge/Models/Response/UserProjectAssignmentResponse.cs index 8c267c1..4a1adaf 100644 --- a/src/SkillBridge/Models/Response/UserProjectAssignmentResponse.cs +++ b/src/SkillBridge/Models/Response/UserProjectAssignmentResponse.cs @@ -29,4 +29,11 @@ public class UserProjectAssignmentResponse public DateTime? CompletedAt { get; set; } public DateTime Deadline { get; set; } + + public int TotalTasks => ProjectAssignment.Tasks.Count; + + public int CompletedTasks { get; set; } + + public double CompletionPercentage => + TotalTasks == 0 ? 0 : Math.Round((double)CompletedTasks / TotalTasks * 100, 2); } \ No newline at end of file diff --git a/src/SkillBridge/Services/ProjectAssignment/ProjectAssignmentService.cs b/src/SkillBridge/Services/ProjectAssignment/ProjectAssignmentService.cs index 1a8711a..f38237c 100644 --- a/src/SkillBridge/Services/ProjectAssignment/ProjectAssignmentService.cs +++ b/src/SkillBridge/Services/ProjectAssignment/ProjectAssignmentService.cs @@ -9,7 +9,9 @@ using SkillBridge.Models.Request; using SkillBridge.Models.Response; using SkillBridge.Models.Specifications; +using SkillBridge.Services.CurrentUser; using SkillBridge.Services.Skill; +using static SkillBridge.Infrastructure.Validation.ValidationConstants; namespace SkillBridge.Services.ProjectAssignment; @@ -22,6 +24,7 @@ public class ProjectAssignmentService : IProjectAssignmentService private readonly IMapper _mapper; private readonly ILogger _logger; private readonly ISkillService _skillService; + private readonly ICurrentUser _currentUser; /// /// Initializes a new instance of the class. @@ -30,12 +33,14 @@ public ProjectAssignmentService( AppDbContext dbContext, IMapper mapper, ILogger logger, - ISkillService skillService) + ISkillService skillService, + ICurrentUser current) { _dbContext = dbContext; _mapper = mapper; _logger = logger; _skillService = skillService; + _currentUser = current; } /// @@ -52,7 +57,7 @@ public async Task CreateAsync(Guid companyId, CreateP _logger.LogWarning("Company with ID {CompanyId} not found", companyId); throw new EntityNotFoundException("Company", companyId); } - + // Get or create skills by names using SkillService List skillIds = new(); if (request.Skills.Any()) @@ -67,7 +72,7 @@ public async Task CreateAsync(Guid companyId, CreateP // Prepare project skills if any skills are specified if (skillIds.Any()) { - projectAssignment.ProjectSkills = skillIds.Select(skillId => new ProjectSkill + projectAssignment.ProjectSkills = skillIds.Select(skillId => new Models.Entities.ProjectSkill { SkillId = skillId }).ToList(); @@ -80,7 +85,7 @@ public async Task CreateAsync(Guid companyId, CreateP projectAssignment.Tasks = request.Tasks.Select(taskRequest => { - var task = _mapper.Map(taskRequest); + var task = _mapper.Map(taskRequest); // No need to set ProjectAssignmentId as EF Core will handle this return task; }).ToList(); @@ -199,7 +204,7 @@ public async Task UpdateAsync(Guid id, UpdateProjectA // Update basic properties _mapper.Map(request, projectAssignment); projectAssignment.UpdatedAt = DateTime.UtcNow; - + // Get or create skills by names using SkillService List skillIds = new(); if (request.Skills.Any()) @@ -209,10 +214,10 @@ public async Task UpdateAsync(Guid id, UpdateProjectA // Update skills - remove existing and add new ones _dbContext.ProjectSkills.RemoveRange(projectAssignment.ProjectSkills); - + if (skillIds.Any()) { - var projectSkills = skillIds.Select(skillId => new ProjectSkill + var projectSkills = skillIds.Select(skillId => new Models.Entities.ProjectSkill { ProjectAssignmentId = projectAssignment.Id, SkillId = skillId @@ -274,7 +279,7 @@ public async Task CreateTaskAsync(Guid projectId, Create } // Create the task - var task = _mapper.Map(request); + var task = _mapper.Map(request); task.ProjectAssignmentId = projectId; // Save the task @@ -439,14 +444,39 @@ public async Task CompleteTaskAsync(Guid projectId, Guid throw new EntityNotFoundException("AssignmentTask", taskId); } - if (task.IsCompleted == false) + var auth0UserId = _currentUser.GetUserId(); + _logger.LogInformation("Updating profile with ID: {UserProfileId}", auth0UserId); + + var userAssignmentTask = await _dbContext.UserAssignmentTasks + .FirstOrDefaultAsync(uat => uat.ProjectAssignmentId == projectId + && uat.AssignmentTaskId == taskId + && uat.UserProfileId == auth0UserId); + + + + if (userAssignmentTask is null) { - task.IsCompleted = true; + // Optional: verify the user is assigned to this project before creating the row + var isAssigned = await _dbContext.UserProjectAssignments + .AnyAsync(a => a.UserProfileId == auth0UserId && a.ProjectAssignmentId == projectId); + if (!isAssigned) + throw new InvalidOperationException("User is not assigned to this project."); + + userAssignmentTask = new UserProjectAssignmentTask + { + UserProfileId = auth0UserId, + ProjectAssignmentId = projectId, + AssignmentTaskId = taskId, + IsCompleted = true // first toggle sets it completed + }; + _dbContext.UserAssignmentTasks.Add(userAssignmentTask); } - else if (task.IsCompleted == true) + else { - task.IsCompleted = false; + userAssignmentTask.IsCompleted = !userAssignmentTask.IsCompleted; // toggle + } + task.UpdatedAt = DateTime.UtcNow; _dbContext.AssignmentTasks.Update(task); @@ -455,7 +485,10 @@ public async Task CompleteTaskAsync(Guid projectId, Guid _logger.LogInformation("Task updated successfully with ID: {TaskId} for project assignment ID: {ProjectAssignmentId}", taskId, projectId); - return _mapper.Map(task); + var response = _mapper.Map(task); + response.IsCompleted = userAssignmentTask.IsCompleted; + + return response; } /// diff --git a/src/SkillBridge/Services/UserProjectAssignment/UserProjectAssignmentService.cs b/src/SkillBridge/Services/UserProjectAssignment/UserProjectAssignmentService.cs index 36c794e..d64efa1 100644 --- a/src/SkillBridge/Services/UserProjectAssignment/UserProjectAssignmentService.cs +++ b/src/SkillBridge/Services/UserProjectAssignment/UserProjectAssignmentService.cs @@ -36,9 +36,9 @@ public UserProjectAssignmentService( /// public async Task ClaimProjectAsync(string userId, ClaimProjectRequest request) { - _logger.LogInformation("User {UserId} claiming project assignment {ProjectAssignmentId}", + _logger.LogInformation("User {UserId} claiming project assignment {ProjectAssignmentId}", userId, request.ProjectAssignmentId); - + // Verify user profile exists var userExists = await _dbContext.UserProfiles.AnyAsync(u => u.Id == userId); if (!userExists) @@ -46,7 +46,7 @@ public async Task ClaimProjectAsync(string userId _logger.LogWarning("User profile with ID {UserId} not found", userId); throw new EntityNotFoundException("UserProfile", userId); } - + // Verify project assignment exists and is published var projectAssignment = await _dbContext.ProjectAssignments .Include(p => p.Company) @@ -54,24 +54,24 @@ public async Task ClaimProjectAsync(string userId .ThenInclude(ps => ps.Skill) .Include(p => p.Tasks) .FirstOrDefaultAsync(p => p.Id == request.ProjectAssignmentId); - + if (projectAssignment == null) { _logger.LogWarning("Project assignment with ID {ProjectAssignmentId} not found", request.ProjectAssignmentId); throw new EntityNotFoundException("ProjectAssignment", request.ProjectAssignmentId); } - + // Check if the user has already claimed this project var existingClaim = await _dbContext.UserProjectAssignments .FirstOrDefaultAsync(up => up.UserProfileId == userId && up.ProjectAssignmentId == request.ProjectAssignmentId); - + if (existingClaim != null) { _logger.LogWarning("User {UserId} has already claimed project assignment {ProjectAssignmentId}", userId, request.ProjectAssignmentId); throw new InvalidOperationException("You have already claimed this project assignment"); } - + // Create new user project assignment var userProjectAssignment = new Models.Entities.UserProjectAssignment { @@ -81,14 +81,14 @@ public async Task ClaimProjectAsync(string userId IsCompleted = false, Deadline = DateTime.UtcNow + projectAssignment.Duration, }; - + // Save to database await _dbContext.UserProjectAssignments.AddAsync(userProjectAssignment); await _dbContext.SaveChangesAsync(); - + _logger.LogInformation("User {UserId} successfully claimed project assignment {ProjectAssignmentId}", userId, request.ProjectAssignmentId); - + // Build the response var response = new UserProjectAssignmentResponse { @@ -98,7 +98,7 @@ public async Task ClaimProjectAsync(string userId CompletedAt = userProjectAssignment.CompletedAt, Deadline = userProjectAssignment.Deadline }; - + return response; } @@ -108,7 +108,7 @@ public async Task ClaimProjectAsync(string userId public async Task> GetUserProjectsAsync(string userId) { _logger.LogInformation("Getting all project assignments claimed by user {UserId}", userId); - + // Verify user profile exists var userExists = await _dbContext.UserProfiles.AnyAsync(u => u.Id == userId); if (!userExists) @@ -116,7 +116,7 @@ public async Task> GetUserProjectsAsy _logger.LogWarning("User profile with ID {UserId} not found", userId); throw new EntityNotFoundException("UserProfile", userId); } - + // Get all user project assignments with related data var userProjectAssignments = await _dbContext.UserProjectAssignments .Where(upa => upa.UserProfileId == userId) @@ -126,22 +126,24 @@ public async Task> GetUserProjectsAsy .ThenInclude(pa => pa.ProjectSkills) .ThenInclude(ps => ps.Skill) .Include(upa => upa.ProjectAssignment) - .ThenInclude(pa => pa.Tasks) + .ThenInclude(pa => pa.Tasks). + Include(upa => upa.UserProjectAssignmentTasks) .OrderByDescending(upa => upa.ClaimedAt) .ToListAsync(); - + _logger.LogInformation("Found {Count} project assignments claimed by user {UserId}", userProjectAssignments.Count, userId); - + // Map to response model var response = userProjectAssignments.Select(upa => new UserProjectAssignmentResponse { ProjectAssignment = _mapper.Map(upa.ProjectAssignment), ClaimedAt = upa.ClaimedAt, IsCompleted = upa.IsCompleted, - CompletedAt = upa.CompletedAt + CompletedAt = upa.CompletedAt, + CompletedTasks = upa.UserProjectAssignmentTasks.Count(x => x.IsCompleted), }); - + return response; } @@ -152,7 +154,7 @@ public async Task CompleteProjectAsync(string use { _logger.LogInformation("User {UserId} marking project assignment {ProjectAssignmentId} as completed", userId, projectAssignmentId); - + // Find the user project assignment var userProjectAssignment = await _dbContext.UserProjectAssignments .Include(upa => upa.ProjectAssignment) @@ -162,20 +164,20 @@ public async Task CompleteProjectAsync(string use .ThenInclude(ps => ps.Skill) .Include(upa => upa.ProjectAssignment) .ThenInclude(pa => pa.Tasks) - .FirstOrDefaultAsync(upa => - upa.UserProfileId == userId && + .FirstOrDefaultAsync(upa => + upa.UserProfileId == userId && upa.ProjectAssignmentId == projectAssignmentId); - + if (userProjectAssignment == null) { _logger.LogWarning( "User project assignment not found for user {UserId} and project {ProjectAssignmentId}", userId, projectAssignmentId); throw new EntityNotFoundException( - "UserProjectAssignment", + "UserProjectAssignment", $"User: {userId}, Project: {projectAssignmentId}"); } - + if (userProjectAssignment.IsCompleted) { _logger.LogWarning( @@ -183,18 +185,18 @@ public async Task CompleteProjectAsync(string use projectAssignmentId, userId); throw new InvalidOperationException("This project assignment is already marked as completed"); } - + // Mark as completed userProjectAssignment.IsCompleted = true; userProjectAssignment.CompletedAt = DateTime.UtcNow; - + // Save changes await _dbContext.SaveChangesAsync(); - + _logger.LogInformation( "User {UserId} successfully marked project assignment {ProjectAssignmentId} as completed", userId, projectAssignmentId); - + // Build response var response = new UserProjectAssignmentResponse { @@ -203,7 +205,7 @@ public async Task CompleteProjectAsync(string use IsCompleted = userProjectAssignment.IsCompleted, CompletedAt = userProjectAssignment.CompletedAt }; - + return response; } } \ No newline at end of file diff --git a/src/SkillBridge/SkillBridge.csproj b/src/SkillBridge/SkillBridge.csproj index c8f6291..62d7f15 100644 --- a/src/SkillBridge/SkillBridge.csproj +++ b/src/SkillBridge/SkillBridge.csproj @@ -35,4 +35,8 @@ + + + +