Files
Data-Coupler/CredentialManager/Migrations/20250701203438_AddDataCouplerProfiles.cs
T
Alessio 7e450a358b feat: Aggiunto sistema completo di gestione profili per Data Coupler
- Creata nuova libreria Components con componenti Blazor riutilizzabili
  * ProfileSelector: dropdown per selezione profili salvati
  * ProfileSaver: componente per salvare configurazioni correnti come profili
  * ProfileManagement: modale per gestione profili salvati
  * ProfileQuickActions: bottoni azioni rapide per operazioni sui profili

- Esteso CredentialManager con entità e servizi per DataCouplerProfile
  * Aggiunto modello DataCouplerProfile con configurazioni mapping e metadati
  * Implementata migrazione Entity Framework per memorizzazione profili
  * Creato DataCouplerProfileService per operazioni CRUD
  * Aggiunto CredentialDbContextFactory per operazioni database design-time

- Migliorato componente principale DataCoupler con integrazione profili
  * Integrata funzionalità caricamento/salvataggio profili
  * Aggiunto selettore profili nella parte superiore dell'interfaccia
  * Mantenuta retrocompatibilità con funzionalità esistenti
  * Migliorata esperienza utente con gestione configurazioni salvate

- Aggiornata struttura progetto e dipendenze
  * Aggiunto progetto Components alla soluzione
  * Aggiornati riferimenti progetti e import
  * Rimosso progetto obsoleto TestDatabaseFix

Questo aggiornamento migliora significativamente il flusso di lavoro permettendo agli utenti di salvare, caricare e gestire configurazioni complete di accoppiamento dati come
2025-07-02 00:00:05 +02:00

105 lines
4.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CredentialManager.Migrations
{
/// <inheritdoc />
public partial class AddDataCouplerProfiles : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DataCouplerProfiles",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
Description = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
SourceType = table.Column<string>(type: "TEXT", maxLength: 20, nullable: false),
SourceCredentialId = table.Column<int>(type: "INTEGER", nullable: true),
SourceSchema = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true),
SourceTable = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true),
SourceFilePath = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
DestinationType = table.Column<string>(type: "TEXT", maxLength: 20, nullable: false),
DestinationCredentialId = table.Column<int>(type: "INTEGER", nullable: true),
DestinationSchema = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true),
DestinationTable = table.Column<string>(type: "TEXT", maxLength: 200, nullable: true),
DestinationEndpoint = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
FieldMappingJson = table.Column<string>(type: "TEXT", maxLength: 4000, nullable: true),
CreatedBy = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
LastUsedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
IsActive = table.Column<bool>(type: "INTEGER", nullable: false, defaultValue: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DataCouplerProfiles", x => x.Id);
table.ForeignKey(
name: "FK_DataCouplerProfiles_Credentials_DestinationCredentialId",
column: x => x.DestinationCredentialId,
principalTable: "Credentials",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_DataCouplerProfiles_Credentials_SourceCredentialId",
column: x => x.SourceCredentialId,
principalTable: "Credentials",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_CreatedAt",
table: "DataCouplerProfiles",
column: "CreatedAt");
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_DestinationCredentialId",
table: "DataCouplerProfiles",
column: "DestinationCredentialId");
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_DestinationType",
table: "DataCouplerProfiles",
column: "DestinationType");
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_IsActive",
table: "DataCouplerProfiles",
column: "IsActive");
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_LastUsedAt",
table: "DataCouplerProfiles",
column: "LastUsedAt");
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_Name",
table: "DataCouplerProfiles",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_SourceCredentialId",
table: "DataCouplerProfiles",
column: "SourceCredentialId");
migrationBuilder.CreateIndex(
name: "IX_DataCouplerProfiles_SourceType",
table: "DataCouplerProfiles",
column: "SourceType");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DataCouplerProfiles");
}
}
}