Skip to content

Commit

Permalink
Merge pull request #1557 from ssc-sp/ep/poc-merge_20250210
Browse files Browse the repository at this point in the history
Merging develop into POC to add API updates for GC Hosting team
  • Loading branch information
ErikApption authored Feb 10, 2025
2 parents 91e4579 + 47d0886 commit 0886d0e
Show file tree
Hide file tree
Showing 48 changed files with 9,528 additions and 370 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

using Datahub.Core.Model.Projects;

namespace Datahub.Application.Services
{
public interface IProjectDeletionService
{
public Task<bool> DeleteWorkspace(string acronym);
public Task<bool> DeleteWorkspace(string acronym, Project_Delete_Questionnaire questionnaire);
}
}
11 changes: 11 additions & 0 deletions Portal/src/Datahub.Core/Data/EFTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static void InitializeDatabase<T>(ILogger logger, IConfiguration configur
where T : DbContext
{
using var context = factory.CreateDbContext();
logger.LogInformation($"Initializing database {GetInfo(context.Database)}-{typeof(T).Name} - reset:{resetDB} - migrate:{migrate}");
try
{
if (resetDB)
Expand All @@ -37,6 +38,16 @@ public static void InitializeDatabase<T>(ILogger logger, IConfiguration configur
{
if (migrate)
{
var pendingMigrations = context.Database.GetPendingMigrations();
if (pendingMigrations.Any())
{
logger.LogInformation("Pending migrations: {Migrations}", string.Join(", ", pendingMigrations));
}
else
{
logger.LogInformation("No pending migrations.");
}

context.Database.Migrate();
//TODO:
//GetMigrations()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ public partial class DeletedQuestionnaireTable : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsDataSteward",
table: "Project_Users",
type: "bit",
nullable: false,
defaultValue: false);
{

migrationBuilder.CreateTable(
name: "Project_Delete_Questionnaires",
Expand Down Expand Up @@ -47,35 +41,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
principalTable: "Projects",
principalColumn: "Project_ID");
});

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 1,
column: "Description",
value: "Revoke the user's access to the workspace");

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 2,
column: "Description",
value: "Head of the workspace and bears business responsibility for success of the workspace");

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 3,
column: "Description",
value: "Management authority within the workspace with direct supervision over the cloud resourcing and users");

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 4,
column: "Description",
value: "Responsible for contributing to the overall workspace objectives and deliverables");


migrationBuilder.CreateIndex(
name: "IX_Project_Delete_Questionnaires_DeletedById",
table: "Project_Delete_Questionnaires",
Expand All @@ -92,38 +58,7 @@ protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Project_Delete_Questionnaires");

migrationBuilder.DropColumn(
name: "IsDataSteward",
table: "Project_Users");

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 1,
column: "Description",
value: "Revoke the user's access to the project's private resources");

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 2,
column: "Description",
value: "Head of the business unit and bears business responsibility for successful implementation and availability");

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 3,
column: "Description",
value: "Management authority within the project with direct supervision over the project resources and deliverables");

migrationBuilder.UpdateData(
table: "Project_Roles",
keyColumn: "Id",
keyValue: 4,
column: "Description",
value: "Responsible for contributing to the overall project objectives and deliverables to ensure success");

}
}
}
Loading

0 comments on commit 0886d0e

Please sign in to comment.